From 679c24c66d950060555d4dbb3c4eb695bbf3aabb Mon Sep 17 00:00:00 2001 From: Pascal Breuninger Date: Thu, 14 Dec 2023 12:56:37 +0100 Subject: [PATCH] fix: add cloud-platform scope to default token source --- pkg/gcloud/gcloud.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/gcloud/gcloud.go b/pkg/gcloud/gcloud.go index 4b3560e..77e4553 100644 --- a/pkg/gcloud/gcloud.go +++ b/pkg/gcloud/gcloud.go @@ -60,7 +60,11 @@ func SetupEnvJson(ctx context.Context) error { } func DefaultTokenSource(ctx context.Context) (oauth2.TokenSource, error) { - return google.DefaultTokenSource(ctx) + scopes := []string{ + "https://www.googleapis.com/auth/cloud-platform", + } + + return google.DefaultTokenSource(ctx, scopes...) } func ParseToken(tok string) (*oauth2.Token, error) {