-
Notifications
You must be signed in to change notification settings - Fork 853
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
Lets AsyncSignedRequest and SignedRequest implement CopyableBuilder #4607
Conversation
…o signed requests can be modified
import software.amazon.awssdk.utils.builder.CopyableBuilder; | ||
import software.amazon.awssdk.utils.builder.ToCopyableBuilder; |
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.
unnecessary import
@@ -15,6 +15,7 @@ | |||
|
|||
package software.amazon.awssdk.http.auth.spi.internal.signer; | |||
|
|||
import java.util.Objects; |
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.
unnecessary import
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.
yeah I missed running checkstyle locally, fixing...
… updating spotbugs check
List<String> concreteClassBuilderFields = builderFields.get(concreteClass); | ||
if (concreteClassBuilderFields == null) { | ||
concreteClassBuilderFields = new ArrayList<>(); | ||
} |
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.
getOrDefault?
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.
That'd be nice(r)
Kudos, SonarCloud Quality Gate passed! |
Motivation and Context
In the new signing flow, the input to the signer is a SignRequest (AsyncSignRequest) and the output is a SignedRequest (AsyncSignedRequest). SignRequest implements CopyableBuilder which means it supports
toBuilder
andcopy
, but SignedRequest does not. For use cases where a SignedRequest needs modification, for instance to manipulate headers in the SdkHttpRequest within the SignedRequest, it should implement this interfaceModifications
CopyableBuilder
DefaultNoAuthAuthSchema
and instead lets that (anonymous) signer use the default buildersTesting
Unit tested
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