google/externalaccount: add support for workforce pool credentials

This commit is contained in:
Ryan Kohler
2021-09-30 13:35:18 -07:00
parent 2bc19b1117
commit 7969d9bbda
2 changed files with 14 additions and 1 deletions

View File

@@ -123,6 +123,7 @@ type credentialsFile struct {
ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"`
CredentialSource externalaccount.CredentialSource `json:"credential_source"`
QuotaProjectID string `json:"quota_project_id"`
WorkforcePoolUserProject string `json:"workforce_pool_user_project"`
}
func (f *credentialsFile) jwtConfig(scopes []string, subject string) *jwt.Config {
@@ -176,6 +177,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar
CredentialSource: f.CredentialSource,
QuotaProjectID: f.QuotaProjectID,
Scopes: params.Scopes,
WorkforcePoolUserProject: f.WorkforcePoolUserProject,
}
return cfg.TokenSource(ctx)
case "":