Skip to content

Commit

Permalink
Remove Sts prefix in the request name as it is duplicate with the pac…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
BigTailWolf committed Sep 28, 2023
1 parent c50beac commit 6e2aaff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion google/internal/externalaccount/basecredentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (ts tokenSource) Token() (*oauth2.Token, error) {
if err != nil {
return nil, err
}
stsRequest := stsexchange.StsTokenExchangeRequest{
stsRequest := stsexchange.TokenExchangeRequest{
GrantType: "urn:ietf:params:oauth:grant-type:token-exchange",
Audience: conf.Audience,
Scope: conf.Scopes,
Expand Down
6 changes: 3 additions & 3 deletions google/internal/stsexchange/sts_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func defaultHeader() http.Header {
// The first 4 fields are all mandatory. headers can be used to pass additional
// headers beyond the bare minimum required by the token exchange. options can
// be used to pass additional JSON-structured options to the remote server.
func ExchangeToken(ctx context.Context, endpoint string, request *StsTokenExchangeRequest, authentication ClientAuthentication, headers http.Header, options map[string]interface{}) (*Response, error) {
func ExchangeToken(ctx context.Context, endpoint string, request *TokenExchangeRequest, authentication ClientAuthentication, headers http.Header, options map[string]interface{}) (*Response, error) {
data := url.Values{}
data.Set("audience", request.Audience)
data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange")
Expand Down Expand Up @@ -99,8 +99,8 @@ func makeRequest(ctx context.Context, endpoint string, data url.Values, authenti
return &stsResp, nil
}

// StsTokenExchangeRequest contains fields necessary to make an oauth2 token exchange.
type StsTokenExchangeRequest struct {
// TokenExchangeRequest contains fields necessary to make an oauth2 token exchange.
type TokenExchangeRequest struct {
ActingParty struct {
ActorToken string
ActorTokenType string
Expand Down
2 changes: 1 addition & 1 deletion google/internal/stsexchange/sts_exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var auth = ClientAuthentication{
ClientSecret: clientSecret,
}

var exchangeTokenRequest = StsTokenExchangeRequest{
var exchangeTokenRequest = TokenExchangeRequest{
ActingParty: struct {
ActorToken string
ActorTokenType string
Expand Down

0 comments on commit 6e2aaff

Please sign in to comment.