From 3ce87dd3800b90da028f08d75023144c03f5706f Mon Sep 17 00:00:00 2001 From: Halvard Skogsrud Date: Tue, 3 Dec 2024 05:27:55 +1100 Subject: [PATCH] credentials/google: Add cloud-platform scope for ADC (#7887) --- credentials/google/google.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/credentials/google/google.go b/credentials/google/google.go index d18e370df4e7..5a9c9461f0e4 100644 --- a/credentials/google/google.go +++ b/credentials/google/google.go @@ -30,6 +30,8 @@ import ( "google.golang.org/grpc/internal" ) +const defaultCloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + var logger = grpclog.Component("credentials") // DefaultCredentialsOptions constructs options to build DefaultCredentials. @@ -120,7 +122,7 @@ var ( return alts.NewClientCreds(alts.DefaultClientOptions()) } newADC = func(ctx context.Context) (credentials.PerRPCCredentials, error) { - return oauth.NewApplicationDefault(ctx) + return oauth.NewApplicationDefault(ctx, defaultCloudPlatformScope) } )