0

Reland "Add Boca API key."

This reverts commit b2aa0c30ff.

Reason for revert: google_internal needed a manual roll up: https://chromium-review.googlesource.com/c/chromium/src/+/5917342

Original change's description:
> Revert "Add Boca API key."
>
> This reverts commit 43bf3dc6db.
>
> Reason for revert: Causes massive breakage in ChromeOS tests all over the tree. Bisected as culprit.
>
> Original change's description:
> > Add Boca API key.
> >
> > The Boca API key will be used for Live Translate on ChromeOS.
> >
> > Bug: b/359931233
> > Change-Id: Ie9b18ec6d0eb781c245301125b177ed4161386c4
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5908987
> > Reviewed-by: Avynn Donaghe <avynn@google.com>
> > Commit-Queue: Dorian Brandon <dorianbrandon@google.com>
> > Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1364855}
>
> Bug: b/359931233
> Change-Id: Ifc49a7176f484f511edf11601b9afedca2f34e23
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912855
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Steinar H Gunderson <sesse@chromium.org>
> Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1364904}

Bug: b/359931233
Change-Id: Ib665729e9de678cd921bf8642043d00efb458ef9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5917407
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
Commit-Queue: Dorian Brandon <dorianbrandon@google.com>
Cr-Commit-Position: refs/heads/main@{#1366428}
This commit is contained in:
Dorian Brandon
2024-10-09 20:39:54 +00:00
committed by Chromium LUCI CQ
parent eb67d41478
commit dec8a3beba
6 changed files with 22 additions and 0 deletions

@ -203,6 +203,13 @@ ApiKeyCache::ApiKeyCache(const DefaultApiKeys& default_api_keys) {
std::string(), environment.get(), command_line, gaia_config,
default_api_keys.allow_override_via_environment,
default_api_keys.allow_unset_values);
api_key_boca_ = CalculateKeyValue(
default_api_keys.google_api_key_boca,
STRINGIZE_NO_EXPANSION(GOOGLE_API_KEY_BOCA), std::string(), nullptr,
std::string(), environment.get(), command_line, gaia_config,
default_api_keys.allow_override_via_environment,
default_api_keys.allow_unset_values);
#endif
metrics_key_ = CalculateKeyValue(

@ -43,6 +43,7 @@ class COMPONENT_EXPORT(GOOGLE_APIS) ApiKeyCache {
const std::string& api_key_sharing() const { return api_key_sharing_; }
const std::string& api_key_read_aloud() const { return api_key_read_aloud_; }
const std::string& api_key_fresnel() const { return api_key_fresnel_; }
const std::string& api_key_boca() const { return api_key_boca_; }
#endif
const std::string& metrics_key() const { return metrics_key_; }
@ -72,6 +73,7 @@ class COMPONENT_EXPORT(GOOGLE_APIS) ApiKeyCache {
std::string api_key_sharing_;
std::string api_key_read_aloud_;
std::string api_key_fresnel_;
std::string api_key_boca_;
#endif
std::string metrics_key_;

@ -88,6 +88,10 @@
#if !defined(GOOGLE_API_KEY_FRESNEL)
#define GOOGLE_API_KEY_FRESNEL google_apis::DefaultApiKeys::kUnsetApiToken
#endif
#if !defined(GOOGLE_API_KEY_BOCA)
#define GOOGLE_API_KEY_BOCA google_apis::DefaultApiKeys::kUnsetApiToken
#endif
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// These are used as shortcuts for developers and users providing
@ -122,6 +126,7 @@ constexpr ::google_apis::DefaultApiKeys GetDefaultApiKeysFromDefinedValues() {
.google_api_key_sharing = GOOGLE_API_KEY_SHARING,
.google_api_key_read_aloud = GOOGLE_API_KEY_READ_ALOUD,
.google_api_key_fresnel = GOOGLE_API_KEY_FRESNEL,
.google_api_key_boca = GOOGLE_API_KEY_BOCA,
#endif
.google_client_id_main = GOOGLE_CLIENT_ID_MAIN,
.google_client_secret_main = GOOGLE_CLIENT_SECRET_MAIN,

@ -35,6 +35,7 @@ struct DefaultApiKeys {
const char* google_api_key_sharing;
const char* google_api_key_read_aloud;
const char* google_api_key_fresnel;
const char* google_api_key_boca;
#endif
const char* google_client_id_main;

@ -99,6 +99,10 @@ const std::string& GetReadAloudAPIKey() {
const std::string& GetFresnelAPIKey() {
return GetApiKeyCacheInstance().api_key_fresnel();
}
const std::string& GetBocaAPIKey() {
return GetApiKeyCacheInstance().api_key_boca();
}
#endif
#if BUILDFLAG(SUPPORT_EXTERNAL_GOOGLE_API_KEY)

@ -111,6 +111,9 @@ COMPONENT_EXPORT(GOOGLE_APIS) const std::string& GetReadAloudAPIKey();
// Retrieves the Fresnel API Key.
COMPONENT_EXPORT(GOOGLE_APIS) const std::string& GetFresnelAPIKey();
// Retrieves the Boca API Key.
COMPONENT_EXPORT(GOOGLE_APIS) const std::string& GetBocaAPIKey();
#endif
#if BUILDFLAG(SUPPORT_EXTERNAL_GOOGLE_API_KEY)