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

Side by Side Diff: google_apis/google_api_keys.py

Issue 1094133003: Added (incomplete) implementation of HostListApi using GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcd-client-fix
Patch Set: Removed extranous TODO Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | remoting/remoting_webapp_files.gypi » ('j') | remoting/webapp/build-webapp.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Python API for retrieving API keys. 6 """Python API for retrieving API keys.
7 7
8 Note that this does not have the exact same semantics as the C++ API 8 Note that this does not have the exact same semantics as the C++ API
9 in google_api_keys.h, since it does not have access to gyp variables 9 in google_api_keys.h, since it does not have access to gyp variables
10 or preprocessor defines. 10 or preprocessor defines.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return token 63 return token
64 else: 64 else:
65 return DUMMY_TOKEN 65 return DUMMY_TOKEN
66 66
67 67
68 def GetAPIKey(): 68 def GetAPIKey():
69 """Returns the simple API key.""" 69 """Returns the simple API key."""
70 return _GetToken('GOOGLE_API_KEY') 70 return _GetToken('GOOGLE_API_KEY')
71 71
72 72
73 def GetAPIKeyRemoting():
74 """Returns the simple API key."""
75 return _GetToken('GOOGLE_API_KEY_REMOTING')
76
77
73 def GetClientID(client_name): 78 def GetClientID(client_name):
74 """Returns the OAuth 2.0 client ID for the client of the given name.""" 79 """Returns the OAuth 2.0 client ID for the client of the given name."""
75 return _GetToken('GOOGLE_CLIENT_ID_%s' % client_name) 80 return _GetToken('GOOGLE_CLIENT_ID_%s' % client_name)
76 81
77 82
78 def GetClientSecret(client_name): 83 def GetClientSecret(client_name):
79 """Returns the OAuth 2.0 client secret for the client of the given name.""" 84 """Returns the OAuth 2.0 client secret for the client of the given name."""
80 return _GetToken('GOOGLE_CLIENT_SECRET_%s' % client_name) 85 return _GetToken('GOOGLE_CLIENT_SECRET_%s' % client_name)
81 86
82 87
83 if __name__ == "__main__": 88 if __name__ == "__main__":
84 print 'GOOGLE_API_KEY=%s' % GetAPIKey() 89 print 'GOOGLE_API_KEY=%s' % GetAPIKey()
90 print 'GOOGLE_API_KEY_REMOTING=%s' % GetAPIKeyRemoting()
85 print 'GOOGLE_CLIENT_ID_MAIN=%s' % GetClientID('MAIN') 91 print 'GOOGLE_CLIENT_ID_MAIN=%s' % GetClientID('MAIN')
86 print 'GOOGLE_CLIENT_SECRET_MAIN=%s' % GetClientSecret('MAIN') 92 print 'GOOGLE_CLIENT_SECRET_MAIN=%s' % GetClientSecret('MAIN')
87 print 'GOOGLE_CLIENT_ID_CLOUD_PRINT=%s' % GetClientID('CLOUD_PRINT') 93 print 'GOOGLE_CLIENT_ID_CLOUD_PRINT=%s' % GetClientID('CLOUD_PRINT')
88 print 'GOOGLE_CLIENT_SECRET_CLOUD_PRINT=%s' % GetClientSecret('CLOUD_PRINT') 94 print 'GOOGLE_CLIENT_SECRET_CLOUD_PRINT=%s' % GetClientSecret('CLOUD_PRINT')
89 print 'GOOGLE_CLIENT_ID_REMOTING=%s' % GetClientID('REMOTING') 95 print 'GOOGLE_CLIENT_ID_REMOTING=%s' % GetClientID('REMOTING')
90 print 'GOOGLE_CLIENT_SECRET_REMOTING=%s' % GetClientSecret('REMOTING') 96 print 'GOOGLE_CLIENT_SECRET_REMOTING=%s' % GetClientSecret('REMOTING')
91 print 'GOOGLE_CLIENT_ID_REMOTING_HOST=%s' % GetClientID('REMOTING_HOST') 97 print 'GOOGLE_CLIENT_ID_REMOTING_HOST=%s' % GetClientID('REMOTING_HOST')
92 print 'GOOGLE_CLIENT_SECRET_REMOTING_HOST=%s' % GetClientSecret( 98 print 'GOOGLE_CLIENT_SECRET_REMOTING_HOST=%s' % GetClientSecret(
93 'REMOTING_HOST') 99 'REMOTING_HOST')
94 print 'GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=%s' %GetClientID( 100 print 'GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=%s' %GetClientID(
95 'REMOTING_IDENTITY_API') 101 'REMOTING_IDENTITY_API')
OLDNEW
« no previous file with comments | « no previous file | remoting/remoting_webapp_files.gypi » ('j') | remoting/webapp/build-webapp.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698