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

Unified Diff: google_apis/google_api_keys.cc

Issue 19796006: Support service accounts in the chromoting host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
Index: google_apis/google_api_keys.cc
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index fc4b54735b44042eb79c7845028b37020491ac63..4c401d9c098e5f019e8cf27c45e24fa8d979d702 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -49,6 +49,14 @@
#define GOOGLE_CLIENT_SECRET_REMOTING DUMMY_API_TOKEN
#endif
+#if !defined(GOOGLE_CLIENT_ID_REMOTING_SERVICE_ACCOUNT)
+#define GOOGLE_CLIENT_ID_REMOTING_SERVICE_ACCOUNT DUMMY_API_TOKEN
+#endif
+
+#if !defined(GOOGLE_CLIENT_SECRET_REMOTING_SERVICE_ACCOUNT)
+#define GOOGLE_CLIENT_SECRET_REMOTING_SERVICE_ACCOUNT DUMMY_API_TOKEN
+#endif
+
// These are used as shortcuts for developers and users providing
// OAuth credentials via preprocessor defines or environment
// variables. If set, they will be used to replace any of the client
@@ -152,6 +160,21 @@ class APIKeyCache {
default_client_secret,
environment.get(),
command_line);
+
+ client_ids_[CLIENT_REMOTING_SERVICE_ACCOUNT] = CalculateKeyValue(
+ GOOGLE_CLIENT_ID_REMOTING_SERVICE_ACCOUNT,
+ STRINGIZE_NO_EXPANSION(GOOGLE_CLIENT_ID_REMOTING_SERVICE_ACCOUNT),
+ NULL,
+ default_client_id,
+ environment.get(),
+ command_line);
+ client_secrets_[CLIENT_REMOTING_SERVICE_ACCOUNT] = CalculateKeyValue(
+ GOOGLE_CLIENT_SECRET_REMOTING_SERVICE_ACCOUNT,
+ STRINGIZE_NO_EXPANSION(GOOGLE_CLIENT_SECRET_REMOTING_SERVICE_ACCOUNT),
+ NULL,
+ default_client_secret,
+ environment.get(),
+ command_line);
}
std::string api_key() const { return api_key_; }

Powered by Google App Engine
This is Rietveld 408576698