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

Unified Diff: remoting/webapp/build-webapp.py

Issue 10939005: Remove API keys from source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « google_apis/google_api_keys.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/build-webapp.py
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index 9b8599adb6cc7bf530132fe1809772c2f9176a03..6212246e90961f8bbe78138e52f7902c971e4c06 100755
--- a/remoting/webapp/build-webapp.py
+++ b/remoting/webapp/build-webapp.py
@@ -23,6 +23,12 @@ import sys
import time
import zipfile
+# Munge include path to find the google_api_keys API, and import it.
+if __name__ == '__main__':
+ sys.path.append(
+ os.path.abspath(os.path.join(sys.path[0], '../../google_apis')))
Wez 2012/09/18 01:10:36 This assumes that the path containing "google_apis
Jamie 2012/09/18 01:23:57 It certainly appears to be when you run this using
+import google_api_keys
+
def findAndReplace(filepath, findString, replaceString):
"""Does a search and replace on the contents of a file."""
oldFilename = os.path.basename(filepath) + '.old'
@@ -184,16 +190,11 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
oauth2RedirectUrlJson)
# Set the correct API keys.
- if (buildtype == 'Official'):
- apiClientId = ('440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.' +
- 'apps.googleusercontent.com')
- apiClientSecret = 'Bgur6DFiOMM1h8x-AQpuTQlK'
- oauth2UseOfficialClientId = 'true';
- else:
- apiClientId = ('440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.' +
- 'apps.googleusercontent.com')
- apiClientSecret = 'W2ieEsG-R1gIA4MMurGrgMc_'
- oauth2UseOfficialClientId = 'false';
+ apiClientId = google_api_keys.GetClientID('REMOTING')
+ apiClientSecret = google_api_keys.GetClientSecret('REMOTING')
+ # TODO(jamiewalch): Get rid of the useOfficialClientId hack.
Wez 2012/09/18 01:10:36 nit: Create & refer to a bug for that work.
Jamie 2012/09/18 01:23:57 Done.
+ oauth2UseOfficialClientId = 'true';
+
findAndReplace(os.path.join(destination, 'plugin_settings.js'),
"'API_CLIENT_ID'",
"'" + apiClientId + "'")
« no previous file with comments | « google_apis/google_api_keys.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698