Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5027)

Unified Diff: chrome/common/extensions/docs/server2/gitiles_file_system.py

Issue 639773006: Docserver: Log the Gitiles access token so that it can be re-used in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/gitiles_file_system.py
diff --git a/chrome/common/extensions/docs/server2/gitiles_file_system.py b/chrome/common/extensions/docs/server2/gitiles_file_system.py
index 71cd68a068ae40f6054befd3a544eca085fbef1f..2962235da84e6c0a1d6f71824ea7694e6a08883b 100644
--- a/chrome/common/extensions/docs/server2/gitiles_file_system.py
+++ b/chrome/common/extensions/docs/server2/gitiles_file_system.py
@@ -53,9 +53,18 @@ class GitilesFileSystem(FileSystem):
'''Class to fetch filesystem data from the Chromium project's gitiles
service.
'''
- @staticmethod
- def Create(branch='master', commit=None):
+ _logged_tokens = set()
+
+ @classmethod
+ def Create(cls, branch='master', commit=None):
token, _ = app_identity.get_access_token(GITILES_OAUTH2_SCOPE)
+
+ # Log the access token (once per token) so that it can be sneakily re-used
+ # in development.
+ if token not in cls._logged_tokens:
+ logging.info('Got token %s for scope %s' % (token, GITILES_OAUTH2_SCOPE))
+ cls._logged_tokens.add(token)
+
path_prefix = '' if token is None else _AUTH_PATH_PREFIX
if commit:
base_url = '%s%s/%s/%s' % (
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698