| Index: appengine/chromium_rietveld/codereview/auth_utils.py
|
| diff --git a/appengine/chromium_rietveld/codereview/auth_utils.py b/appengine/chromium_rietveld/codereview/auth_utils.py
|
| index 2389fb30872c703eb26ca3fb2029ead1b7f53cc3..bc89b4d72aad7404e7db62e134dfbd3c1c5fd07b 100644
|
| --- a/appengine/chromium_rietveld/codereview/auth_utils.py
|
| +++ b/appengine/chromium_rietveld/codereview/auth_utils.py
|
| @@ -94,6 +94,16 @@ class SecretKey(ndb.Model):
|
| config.additional_client_ids)
|
|
|
|
|
| +class OwnClientId(ndb.Model):
|
| + """Model to store Rietveld's own API client ids."""
|
| + client_id = ndb.StringProperty()
|
| +
|
| +
|
| +def get_own_web_client_id():
|
| + """Returns client id for the web client."""
|
| + return OwnClientId.get_or_insert('web').client_id
|
| +
|
| +
|
| def _get_client_id(tries=3):
|
| """Call oauth.get_client_id() and retry if it times out."""
|
| for attempt in xrange(tries):
|
| @@ -104,7 +114,7 @@ def _get_client_id(tries=3):
|
| if attempt == tries - 1:
|
| raise
|
|
|
| -
|
| +
|
| def get_current_rietveld_oauth_user():
|
| """Gets the current OAuth 2.0 user associated with a request.
|
|
|
|
|