-
Notifications
You must be signed in to change notification settings - Fork 916
Updates StsCredentialsProvider to explicitly handle AwsSessionCredentials #4067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
"type": "feature", | ||
"category": "AWS SDK for Java v2, AWS STS", | ||
"contributor": "", | ||
"description": "Updates the core STS credential provider logic to return AwsSessionCredentials instead of STS Credentials, and adds expirationTime to AwsSessionCredentials\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra quote
@@ -0,0 +1,6 @@ | |||
{ | |||
"type": "feature", | |||
"category": "AWS SDK for Java v2, AWS STS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we just document the addition of expirationTime to AwsSessionCredentials? The other one is hopefully internal-only(ish). Otherwise I think we should have two different release notes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will update
return this; | ||
} | ||
|
||
public Builder expiration(Instant expiration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: expirationTime?
return hashCode; | ||
} | ||
|
||
public static final class Builder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we javadoc this?
private StsAuthUtils() { | ||
} | ||
|
||
public static AwsSessionCredentials fromStsCredentials(Credentials credentials) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think toAwsSessionCredentials
might be a better name. The "from" type is evident by the method parameter. The "to" type is more useful in the method name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, it read better
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ials (#4067) * Updates StsCredentialsProvider to explicitly handle AwsSessionCredentials
Motivation and Context
The abstract base class for STS credentials provider was recently made public. This change changes the protected
getUpdatedCredentials
method to returnAwsSessionCredentials
, a public class, instead of instead of the STS model classCredentials
, so that the SDK handles and stores credentials in a type which may be modified by the SDK. The change is not strictly backwards compatible, but given the short timespan between the two PRs it's unlikely that more than the occasional user would be affected.Modifications
getUpdatedCredentials
method to returnAwsSessionCredentials
instead of the STS model classCredentials
.StsCredentialsProvider
.expirationTime
toAwsSessionCredentials
in order to convert STS credentials to session credentials. Previously, expiration has been stored outside of the session credentialsSessionCredentialsHolder
which has been rendered obsolete by this changeTesting
Unit tests added.
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License