Skip to content

Conversation

@gosar
Copy link
Contributor

@gosar gosar commented Oct 2, 2023

Motivation and Context

This addresses #4396 (comment). If authType=none, there is no need to do identity resolution. #4519 shows that that was the behavior before SRA (since they pass in the PR). But this behavior was changing because of #4396 (comment) and this PR fixes it.

Modifications

First I added a commit that adds the same pre SRA tests from #4519. Also, added some more tests for similar expected behavior for post SRA. Without making the change to AwsExecutionContextBuilder, these tests failed:

  • preSra_authTypeNone_signerRequestOverride_doesNotAssignSigner_doesNotResolveIdentity
  • preSra_authTypeNone_doesNotAssignSigner_doesNotResolveIdentity
  • preSra_authTypeNone_signerClientOverride_doesNotAssignSigner_doesNotResolveIdentity
  • postSra_authTypeNone_signerRequestOverride_doesNotAssignSigner_doesNotResolveIdentity
  • postSra_authTypeNone_signerClientOverride_doesNotAssignSigner_doesNotResolveIdentity

Then I added a 2nd commit to the source code that fixes all these tests. It kind reverts the change to loadSigner from #4396.

I don't intend to merge #4519 to master directly, but those tests will get added via this PR to the SRA feature branch, and then merged to master.

Testing

see notes above.

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 2, 2023 21:18
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 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 500 Code Smells

85.0% 85.0% Coverage
4.3% 4.3% Duplication

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

if (context.executionAttributes().getAttribute(SdkInternalExecutionAttribute.AUTH_SCHEMES) != null) {
SelectedAuthScheme<?> selectedAuthScheme =
context.executionAttributes().getAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME);
log.debug(() -> String.format("Using SelectedAuthScheme: %s", selectedAuthScheme.authSchemeOption().schemeId()));
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to use String.format.

@gosar gosar merged commit d7d3892 into feature/master/sra-identity-auth Oct 3, 2023
@gosar gosar deleted the gosar/sra-ia-authTypeNone branch October 3, 2023 20:03
sugmanue pushed a commit that referenced this pull request Oct 31, 2023
* Add authType=none tests to AwsExecutionContentBuilderTest

Some of these tests are failing. Will fix them in next commit

* If authType=none don't use the old signer, even if overridden

* Update signing stage logic for authType=none

* Add asserts on identity resolution for authType=none
sugmanue added a commit that referenced this pull request Nov 6, 2023
* Set TIME_OFFSET attribtue in SRA signin methods (#4483)

* Verify that execution attributes set by old interceptors can be read by new signers. (#4494)

* Move S3Presigner fully to SRA with HttpSigner (#4569)

* Remove derived attribute logic for PRESIGNER_EXPIRATION (#4602)

* Remove derived attribute logic for PRESIGNER_EXPIRATION

Because of the 2 instant() calls in the write/read mappings, a basic
write this attribute and read it back, would give different values.

Since this attribute should only be set/read explicitly by our
presigner code, we don't need this mapping logic at all.

Also, update S3PresignerTest to assert isEqualTo instead of isCloseTo
and remove unnecessary override

* Remove PRESIGNER_EXPIRATION mirroring test

* Enable SRA Auth for S3

* Make follow up changes from PR 4396 (#4454)

* Make SigingStage updates similar to AsyncSigningStage.
* Simplify (Async)SigningStageTests based on updated logic.
* Minor typos

* If authType=none don't use the old signer, even if overridden  (#4523)

* Add authType=none tests to AwsExecutionContentBuilderTest

Some of these tests are failing. Will fix them in next commit

* If authType=none don't use the old signer, even if overridden

* Update signing stage logic for authType=none

* Add asserts on identity resolution for authType=none

* Add a missing http-auth-aws dependecy to aws-core

* Add a changelog entry

---------

Co-authored-by: Zoe Wang <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Jaykumar Gosar <[email protected]>
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.

2 participants