Skip to content

Commit

Permalink
Add documentation to behavior of Assume role credential provider (#3624)
Browse files Browse the repository at this point in the history
Add a clarifying comment that credentials refresh themselves automatically.
  • Loading branch information
bradseiler committed Jan 12, 2021
1 parent 5c273e2 commit 8b6b7bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions aws/credentials/stscreds/assume_role_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ type AssumeRoleProvider struct {
MaxJitterFrac float64
}

// NewCredentials returns a pointer to a new Credentials object wrapping the
// NewCredentials returns a pointer to a new Credentials value wrapping the
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
// role will be named after a nanosecond timestamp of this operation.
// role will be named after a nanosecond timestamp of this operation. The
// Credentials value will attempt to refresh the credentials using the provider
// when Credentials.Get is called, if the cached credentials are expiring.
//
// Takes a Config provider to create the STS client. The ConfigProvider is
// satisfied by the session.Session type.
Expand All @@ -268,9 +270,11 @@ func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*As
return credentials.NewCredentials(p)
}

// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the
// NewCredentialsWithClient returns a pointer to a new Credentials value wrapping the
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
// role will be named after a nanosecond timestamp of this operation.
// role will be named after a nanosecond timestamp of this operation. The
// Credentials value will attempt to refresh the credentials using the provider
// when Credentials.Get is called, if the cached credentials are expiring.
//
// Takes an AssumeRoler which can be satisfied by the STS client.
//
Expand Down

0 comments on commit 8b6b7bf

Please sign in to comment.