Skip to content

Commit

Permalink
Use a common build api scope string
Browse files Browse the repository at this point in the history
  • Loading branch information
Databean committed Nov 7, 2024
1 parent 504c18a commit eeb1ff7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion base/cvd/cuttlefish/host/commands/cvd/fetch/fetch_cvd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Result<std::unique_ptr<BuildApi>> GetBuildApi(const BuildApiFlags& flags) {
std::chrono::milliseconds(5000));

std::vector<std::string> scopes = {
"https://www.googleapis.com/auth/androidbuild.internal",
kAndroidBuildApiScope,
"https://www.googleapis.com/auth/userinfo.email",
};
Result<std::unique_ptr<CredentialSource>> cvd_creds =
Expand Down
5 changes: 1 addition & 4 deletions base/cvd/cuttlefish/host/libs/web/credential_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
namespace cuttlefish {
namespace {

constexpr char kBuildScope[] =
"https://www.googleapis.com/auth/androidbuild.internal";

constexpr auto kRefreshWindow = std::chrono::minutes(2);

// Credentials with known expiration times with behavior to load new
Expand Down Expand Up @@ -159,7 +156,7 @@ std::unique_ptr<CredentialSource> TryParseServiceAccount(
return {};
}
auto result = ServiceAccountOauthCredentialSource::FromJson(
http_client, content, kBuildScope);
http_client, content, kAndroidBuildApiScope);
if (!result.ok()) {
LOG(DEBUG) << "Failed to load service account json file: \n"
<< result.error().FormatForEnv();
Expand Down
3 changes: 3 additions & 0 deletions base/cvd/cuttlefish/host/libs/web/credential_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

namespace cuttlefish {

constexpr char kAndroidBuildApiScope[] =
"https://www.googleapis.com/auth/androidbuild.internal";

class CredentialSource {
public:
virtual ~CredentialSource() = default;
Expand Down

0 comments on commit eeb1ff7

Please sign in to comment.