Skip to content

Commit

Permalink
Clean up linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Mar 24, 2020
1 parent 3cd6beb commit 83ef478
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aws/credentials/endpointcreds/provider.go
Expand Up @@ -119,6 +119,8 @@ func (p *Provider) Retrieve() (credentials.Value, error) {
return p.RetrieveWithContext(aws.BackgroundContext())
}

// RetrieveWithContext will attempt to request the credentials from the endpoint the Provider
// was configured for. And error will be returned if the retrieval fails.
func (p *Provider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) {
resp, err := p.getCredentials(ctx)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions aws/credentials/stscreds/assume_role_provider.go
Expand Up @@ -273,6 +273,7 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
return p.RetrieveWithContext(aws.BackgroundContext())
}

// RetrieveWithContext generates a new set of temporary credentials using STS.
func (p *AssumeRoleProvider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) {
// Apply defaults where parameters are not set.
if p.RoleSessionName == "" {
Expand Down
3 changes: 3 additions & 0 deletions aws/credentials/stscreds/web_identity_provider.go
Expand Up @@ -67,6 +67,9 @@ func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) {
return p.RetrieveWithContext(aws.BackgroundContext())
}

// RetrieveWithContext will attempt to assume a role from a token which is located at
// 'WebIdentityTokenFilePath' specified destination and if that is empty an
// error will be returned.
func (p *WebIdentityRoleProvider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) {
b, err := ioutil.ReadFile(p.tokenFilePath)
if err != nil {
Expand Down

0 comments on commit 83ef478

Please sign in to comment.