Skip to content

Conversation

@gosar
Copy link
Contributor

@gosar gosar commented Oct 6, 2023

Motivation and Context

As I was reading code in this class, as part of debugging something, felt moving some code around made it easier to follow code. And maybe some style guide would recommend public methods earlier.

Modifications

  • Move public methods to top of DefaultAwsV4HttpSigner.
  • Move some smaller private methods to the end.
  • Changed v4PayloadSigner and v4PayloadAsyncSigner parameter to be specific sync/async instead of BaseSignRequest.
  • V4Context is not Immutable.
  • In test, remove content length from builder instead of signed request.

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@gosar gosar requested a review from a team as a code owner October 6, 2023 08:20
@gosar gosar changed the title Move public methods to top of DefaultAwsV4HttpSigner Minor refacotring to AwsV4HttpSigner impl Oct 6, 2023
@gosar gosar force-pushed the gosar/sra-ia-DefaultAwsV4HttpSigner branch from 6956c2f to b44f83d Compare October 6, 2023 08:45
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 9 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 478 Code Smells

85.1% 85.1% Coverage
4.2% 4.2% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Comment on lines +27 to +28
// TODO(sra-identity-auth): Consider if we can rename this to convey something more. maybe,
// V4RequestSigningResult/V4RequestSigningResultData? Note there is V4aContext similarly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, V4Context is a terrible name. I like V4RequestSigningResult or V4RequestSigningOutput

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take up the TODOs separately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it needs to be a builder anymore with the payload-signer now having a dedicated method to modify the request that is ran before request-signing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, I noticed later it can be changed, but didn't take that on immediately. It's SdkInternal, so non-blocking, so was planing to address both TODOs later.

@gosar gosar merged commit aa3e3ed into feature/master/sra-identity-auth Oct 6, 2023
@gosar gosar deleted the gosar/sra-ia-DefaultAwsV4HttpSigner branch October 6, 2023 17:16
aws-sdk-java-automation added a commit that referenced this pull request Dec 5, 2025
…d5007a114

Pull request: release <- staging/884f85a2-db64-4085-ab69-4acd5007a114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants