Skip to content

Commit 6e2aaff

Browse files
committed
Remove Sts prefix in the request name as it is duplicate with the package
1 parent c50beac commit 6e2aaff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

google/internal/externalaccount/basecredentials.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (ts tokenSource) Token() (*oauth2.Token, error) {
208208
if err != nil {
209209
return nil, err
210210
}
211-
stsRequest := stsexchange.StsTokenExchangeRequest{
211+
stsRequest := stsexchange.TokenExchangeRequest{
212212
GrantType: "urn:ietf:params:oauth:grant-type:token-exchange",
213213
Audience: conf.Audience,
214214
Scope: conf.Scopes,

google/internal/stsexchange/sts_exchange.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func defaultHeader() http.Header {
2828
// The first 4 fields are all mandatory. headers can be used to pass additional
2929
// headers beyond the bare minimum required by the token exchange. options can
3030
// be used to pass additional JSON-structured options to the remote server.
31-
func ExchangeToken(ctx context.Context, endpoint string, request *StsTokenExchangeRequest, authentication ClientAuthentication, headers http.Header, options map[string]interface{}) (*Response, error) {
31+
func ExchangeToken(ctx context.Context, endpoint string, request *TokenExchangeRequest, authentication ClientAuthentication, headers http.Header, options map[string]interface{}) (*Response, error) {
3232
data := url.Values{}
3333
data.Set("audience", request.Audience)
3434
data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange")
@@ -99,8 +99,8 @@ func makeRequest(ctx context.Context, endpoint string, data url.Values, authenti
9999
return &stsResp, nil
100100
}
101101

102-
// StsTokenExchangeRequest contains fields necessary to make an oauth2 token exchange.
103-
type StsTokenExchangeRequest struct {
102+
// TokenExchangeRequest contains fields necessary to make an oauth2 token exchange.
103+
type TokenExchangeRequest struct {
104104
ActingParty struct {
105105
ActorToken string
106106
ActorTokenType string

google/internal/stsexchange/sts_exchange_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var auth = ClientAuthentication{
2222
ClientSecret: clientSecret,
2323
}
2424

25-
var exchangeTokenRequest = StsTokenExchangeRequest{
25+
var exchangeTokenRequest = TokenExchangeRequest{
2626
ActingParty: struct {
2727
ActorToken string
2828
ActorTokenType string

0 commit comments

Comments
 (0)