fix(clients): express endpoints are key-only; has_oauth covers service accounts; make google-live
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,11 @@ std::shared_ptr<clients::Auth> Credentials::api_key_from_env(const char* name) {
|
||||
return api_key(std::move(key));
|
||||
}
|
||||
|
||||
bool Credentials::has_oauth() {
|
||||
return !env("GOOGLE_ACCESS_TOKEN").empty() || !env("GOOGLE_ACCESS_TOKEN_FILE").empty() ||
|
||||
!env("GOOGLE_APPLICATION_CREDENTIALS").empty();
|
||||
}
|
||||
|
||||
std::shared_ptr<clients::Auth> Credentials::oauth_from_env() {
|
||||
std::string token = env("GOOGLE_ACCESS_TOKEN");
|
||||
if (!token.empty()) return bearer(std::move(token));
|
||||
|
||||
Reference in New Issue
Block a user