Skip to content

Commit

Permalink
chore(auth): restore endpoint googleapis.com to user and ID token imp…
Browse files Browse the repository at this point in the history
…ersonate (#11057)

refs: #10953
  • Loading branch information
quartzmo authored Oct 29, 2024
1 parent 93d3f92 commit 2a667c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auth/credentials/impersonate/impersonate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import (

var (
universeDomainPlaceholder = "UNIVERSE_DOMAIN"
iamCredentialsEndpoint = "https://iamcredentials.UNIVERSE_DOMAIN"
iamCredentialsEndpoint = "https://iamcredentials.googleapis.com"
iamCredentialsUniverseDomainEndpoint = "https://iamcredentials.UNIVERSE_DOMAIN"
oauth2Endpoint = "https://oauth2.googleapis.com"
errMissingTargetPrincipal = errors.New("impersonate: target service account must be provided")
errMissingScopes = errors.New("impersonate: scopes must be provided")
Expand Down Expand Up @@ -236,7 +237,7 @@ func (i impersonatedTokenProvider) Token(ctx context.Context) (*auth.Token, erro
if err != nil {
return nil, err
}
endpoint := strings.Replace(iamCredentialsEndpoint, universeDomainPlaceholder, universeDomain, 1)
endpoint := strings.Replace(iamCredentialsUniverseDomainEndpoint, universeDomainPlaceholder, universeDomain, 1)
url := fmt.Sprintf("%s/v1/%s:generateAccessToken", endpoint, formatIAMServiceAccountName(i.targetPrincipal))
req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(b))
if err != nil {
Expand Down

0 comments on commit 2a667c6

Please sign in to comment.