From 2a8fe80698a9dcd57358a3f522eba2c45160a4f6 Mon Sep 17 00:00:00 2001 From: Guillaume Blaquiere Date: Wed, 15 Sep 2021 10:16:09 +0200 Subject: [PATCH] fix: add ImpersonationURL check --- google/google.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/google.go b/google/google.go index 0e5b53d..c4fe932 100644 --- a/google/google.go +++ b/google/google.go @@ -184,7 +184,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar } return cfg.TokenSource(ctx) case impersonatedServiceAccount: - if f.SourceCredentials == nil { + if f.ServiceAccountImpersonationURL != "" && f.SourceCredentials == nil { return nil, errors.New("missing 'source_credentials' field in credentials") }