Skip to content

Update presign interceptors to resolve auth scheme directly instead of reading SELECTED_AUTH_SCHEME#6930

Merged
S-Saranya1 merged 3 commits into
feature/master/core-interceptors-migrationfrom
somepal/update-presign-interceptors-to-resolve-auth-scheme
May 8, 2026
Merged

Update presign interceptors to resolve auth scheme directly instead of reading SELECTED_AUTH_SCHEME#6930
S-Saranya1 merged 3 commits into
feature/master/core-interceptors-migrationfrom
somepal/update-presign-interceptors-to-resolve-auth-scheme

Conversation

@S-Saranya1
Copy link
Copy Markdown

Motivation and Context

The RDS, Neptune, DocDB, and EC2 presign interceptors generate presigned URLs for cross-region operations. To do this, they need a signer and credentials from the resolved auth scheme.

Previously, these interceptors read SELECTED_AUTH_SCHEME from execution attributes in modifyHttpRequest. This worked because the generated AuthSchemeInterceptor resolved the auth scheme in beforeExecution, which ran before modifyHttpRequest.

After moving auth scheme resolution to a pipeline stage (#6755), the real resolution now happens in AuthSchemeResolutionStage, which runs after all interceptors.

Modifications

Updated the presign interceptors to resolve the auth scheme by calling AuthSchemeResolver.selectAuthScheme() directly. The inputs needed for resolution (AUTH_SCHEME_OPTIONS_RESOLVER, AUTH_SCHEMES, IDENTITY_PROVIDERS) are already available in execution attributes at interceptor time.

This produces the same result as the pipeline stage would.

Testing

Verified with existing presign tests across all four services

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

@S-Saranya1 S-Saranya1 requested a review from a team as a code owner April 30, 2026 23:01
@S-Saranya1 S-Saranya1 force-pushed the somepal/update-presign-interceptors-to-resolve-auth-scheme branch from b460b0b to 84305bb Compare April 30, 2026 23:37
}

/**
* Resolves the auth scheme for presigning. After the pipeline refactoring, SELECTED_AUTH_SCHEME may not be set
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit - This comment is useful for reviewing this PR, but long term we'll forget what the "pipeline refactoring" is. I think we can just shorten to describe what this is doing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Makes sense, updated it.

private SelectedAuthScheme<? extends Identity> resolveAuthScheme(SdkRequest request,
ExecutionAttributes executionAttributes) {
AuthSchemeOptionsResolver optionsResolver =
executionAttributes.getAttribute(SdkInternalExecutionAttribute.AUTH_SCHEME_OPTIONS_RESOLVER);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can never remember how our presigning works and whether request level overrides can be used or not.... but are they handled correctly?

I think in AuthSchemeResolutionStage.updateIdentityProvidersIfNeeded we do a check for the IDENTITY_PROVIDER_UPDATER for request level overrides that I don't think is handled here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point! yes, request level overrides need to be respected here. Updated the logic to use IDENTITY_PROVIDER_UPDATER before selecting the auth scheme.

@S-Saranya1 S-Saranya1 merged commit 413b425 into feature/master/core-interceptors-migration May 8, 2026
15 of 30 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants