Skip to content

Commit

Permalink
change name of token provider option
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita committed Nov 10, 2022
1 parent 178ca51 commit 2f6a7aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/resolve_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *S
oidcClient := ssooidc.NewFromConfig(cfgCopy)
tokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath, optFns...)
options = append(options, func(o *ssocreds.Options) {
o.TokenProvider = tokenProvider
o.SSOTokenProvider = tokenProvider
o.CachedTokenFilepath = cachedPath
})
} else {
Expand Down
6 changes: 3 additions & 3 deletions credentials/ssocreds/sso_credentials_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Options struct {

// Used by the SSOCredentialProvider if a token configuration
// profile is used in the shared config
TokenProvider *SSOTokenProvider
SSOTokenProvider *SSOTokenProvider
}

// Provider is an AWS credential provider that retrieves temporary AWS
Expand Down Expand Up @@ -87,8 +87,8 @@ func New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL strin
// direct access on the cached token.
func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {
var accessToken *string
if p.options.TokenProvider != nil {
token, err := p.options.TokenProvider.RetrieveBearerToken(ctx)
if p.options.SSOTokenProvider != nil {
token, err := p.options.SSOTokenProvider.RetrieveBearerToken(ctx)
if err != nil {
return aws.Credentials{}, err
}
Expand Down

0 comments on commit 2f6a7aa

Please sign in to comment.