-
Notifications
You must be signed in to change notification settings - Fork 916
Add new Identity interfaces #3773
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
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Outdated
Show resolved
Hide resolved
core/identity-spi/src/main/java/software/amazon/awssdk/identity/spi/AwsCredentialsIdentity.java
Outdated
Show resolved
Hide resolved
core/identity-spi/src/main/java/software/amazon/awssdk/identity/spi/TokenIdentity.java
Outdated
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/AwsCredentials.java
Outdated
Show resolved
Hide resolved
|
||
@Immutable | ||
@SdkInternalApi | ||
final class AwsCredentialsIdentityImpl implements AwsCredentialsIdentity { |
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.
I haven't seen any mention in the design doc of a direct implementation of AwsCredentialsIdentity
. Do we need this class?
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.
This is to support the static create methods in AwsCredentialsIdentity which are called out in the design doc. Cannot use the existing AwsBasicCredentials as that would be a circular dependency, so defined copies of them here as @SdkInternalApi and package-private.
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.
We're also discussing offline, but if we do decide to keep them they should be in an internal subpackage
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.
I'd vote for removing those classes. They are implementation details and we'd need to maintain two copies of the same implementations. We could consider creating a factory class in auth module that makes it easier for people to create static 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.
👍 removed for now.
core/identity-spi/src/main/java/software/amazon/awssdk/identity/spi/ResolveIdentityRequest.java
Outdated
Show resolved
Hide resolved
core/identity-spi/src/main/java/software/amazon/awssdk/identity/spi/TokenIdentity.java
Outdated
Show resolved
Hide resolved
core/identity-spi/src/main/java/software/amazon/awssdk/identity/spi/IdentityProvider.java
Outdated
Show resolved
Hide resolved
Was getting these errors otherwise: ``` [ERROR] Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.6:cmp (default) on project auth: There is at least one incompatibility: software.amazon.awssdk.auth.credentials.AwsCredentials.accessKeyId():METHOD_REMOVED,software.amazon.awssdk.auth.credentials.AwsCredentials.secretAccessKey():METHOD_REMOVED,software.amazon.awssdk.auth.token.credentials.SdkToken.expirationTime():METHOD_REMOVED,software.amazon.awssdk.auth.token.credentials.SdkToken.token():METHOD_REMOVED -> [Help 1] ```
SonarCloud Quality Gate failed. |
|
||
@Override | ||
public int hashCode() { | ||
return 31 + Objects.hashCode(properties); |
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.
I think this should be 32 * Objects.hashCode(properties);
instead.
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.
Sorry, 31 * ...
, i.e., not +
.
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.
Actually, I think since there is only 1 field in this class, I can just return Objects.hashCode(properties);
. Will update in new PR as this is merged.
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.
Updating in #3814
@@ -630,6 +630,10 @@ | |||
<exclude>software.amazon.awssdk.core.signer.NoOpSigner</exclude> | |||
<exclude>software.amazon.awssdk.auth.credentials.ProfileCredentialsProviderFactory</exclude> | |||
<exclude>software.amazon.awssdk.utils.async.InputStreamSubscriber</exclude> | |||
|
|||
<!-- Moving the interface methods to new SRA super interfaces causes japicmp to complain --> |
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.
the errors without this are:
[ERROR] Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.6:cmp (default) on project auth: There is at least one incompatibility: software.amazon.awssdk.auth.credentials.AwsCredentials.accessKeyId():METHOD_REMOVED,software.amazon.awssdk.auth.credentials.AwsCredentials.secretAccessKey():METHOD_REMOVED,software.amazon.awssdk.auth.token.credentials.SdkToken.expirationTime():METHOD_REMOVED,software.amazon.awssdk.auth.token.credentials.SdkToken.token():METHOD_REMOVED -> [Help 1]
Motivation and Context
As part of Smithy Reference Architecture, we are defining new Identity and Auth components. This changes adds the new Identity interfaces.
Modifications
This changes adds the new Identity interfaces and related changes to existing interfaces to be sub-types of the new interfaces, to maintain backwards compatibility.
Changes to ClientBuilders and other classes to use the new interfaces will be in separate PR next.
Testing
No specific new tests. Made sure build succeeds.
./mvnw clean install -pl :identity-spi,:auth -am
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