Commit c0cf050d authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

Add remoting FTL API key

Add API key for remoting to use during the signaling process. Note that
this key is only used by Chrome Remote Desktop and will not be used in
the Chrome browser.

Internal CL: https://chrome-internal-review.googlesource.com/c/chrome/google_apis/internal/+/831973

Bug: 927962
Change-Id: Iecfa48aebe1078a4a0c747f42711000d9155fc3f
Reviewed-on: https://chromium-review.googlesource.com/c/1450409Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Auto-Submit: Yuwei Huang <yuweih@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630352}
parent f98aeb56
...@@ -73,6 +73,10 @@ ...@@ -73,6 +73,10 @@
#define GOOGLE_API_KEY_PHYSICAL_WEB_TEST DUMMY_API_TOKEN #define GOOGLE_API_KEY_PHYSICAL_WEB_TEST DUMMY_API_TOKEN
#endif #endif
#if !defined(GOOGLE_API_KEY_REMOTING_FTL)
#define GOOGLE_API_KEY_REMOTING_FTL DUMMY_API_TOKEN
#endif
// These are used as shortcuts for developers and users providing // These are used as shortcuts for developers and users providing
// OAuth credentials via preprocessor defines or environment // OAuth credentials via preprocessor defines or environment
// variables. If set, they will be used to replace any of the client // variables. If set, they will be used to replace any of the client
...@@ -111,6 +115,11 @@ class APIKeyCache { ...@@ -111,6 +115,11 @@ class APIKeyCache {
api_key_non_stable_ = api_key_; api_key_non_stable_ = api_key_;
#endif #endif
api_key_remoting_ftl_ =
CalculateKeyValue(GOOGLE_API_KEY_REMOTING_FTL,
STRINGIZE_NO_EXPANSION(GOOGLE_API_KEY_REMOTING_FTL),
NULL, std::string(), environment.get(), command_line);
std::string default_client_id = std::string default_client_id =
CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_ID, CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_ID,
STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
...@@ -198,6 +207,7 @@ class APIKeyCache { ...@@ -198,6 +207,7 @@ class APIKeyCache {
void set_api_key(const std::string& api_key) { api_key_ = api_key; } void set_api_key(const std::string& api_key) { api_key_ = api_key; }
#endif #endif
std::string api_key_non_stable() const { return api_key_non_stable_; } std::string api_key_non_stable() const { return api_key_non_stable_; }
std::string api_key_remoting_ftl() const { return api_key_remoting_ftl_; }
std::string GetClientID(OAuth2Client client) const { std::string GetClientID(OAuth2Client client) const {
DCHECK_LT(client, CLIENT_NUM_ITEMS); DCHECK_LT(client, CLIENT_NUM_ITEMS);
...@@ -293,6 +303,7 @@ class APIKeyCache { ...@@ -293,6 +303,7 @@ class APIKeyCache {
std::string api_key_; std::string api_key_;
std::string api_key_non_stable_; std::string api_key_non_stable_;
std::string api_key_remoting_ftl_;
std::string client_ids_[CLIENT_NUM_ITEMS]; std::string client_ids_[CLIENT_NUM_ITEMS];
std::string client_secrets_[CLIENT_NUM_ITEMS]; std::string client_secrets_[CLIENT_NUM_ITEMS];
}; };
...@@ -312,6 +323,10 @@ std::string GetNonStableAPIKey() { ...@@ -312,6 +323,10 @@ std::string GetNonStableAPIKey() {
return g_api_key_cache.Get().api_key_non_stable(); return g_api_key_cache.Get().api_key_non_stable();
} }
std::string GetFtlAPIKey() {
return g_api_key_cache.Get().api_key_remoting_ftl();
}
#if defined(OS_IOS) #if defined(OS_IOS)
void SetAPIKey(const std::string& api_key) { void SetAPIKey(const std::string& api_key) {
g_api_key_cache.Get().set_api_key(api_key); g_api_key_cache.Get().set_api_key(api_key);
......
...@@ -73,6 +73,10 @@ std::string GetAPIKey(); ...@@ -73,6 +73,10 @@ std::string GetAPIKey();
// Non-stable channels may have a different Google API key. // Non-stable channels may have a different Google API key.
std::string GetNonStableAPIKey(); std::string GetNonStableAPIKey();
// Retrieves the Chrome Remote Desktop FTL API key to be used during the
// signaling process.
std::string GetRemotingFtlAPIKey();
#if defined(OS_IOS) #if defined(OS_IOS)
// Sets the API key. This should be called as early as possible before this // Sets the API key. This should be called as early as possible before this
// API key is even accessed. // API key is even accessed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment