Skip to content

Add support for overriding authSchemeProvider per request#6892

Merged
alextwoods merged 7 commits intomasterfrom
alexwoo/per_request_auth
Apr 25, 2026
Merged

Add support for overriding authSchemeProvider per request#6892
alextwoods merged 7 commits intomasterfrom
alexwoo/per_request_auth

Conversation

@alextwoods
Copy link
Copy Markdown
Contributor

Add support for overriding authSchemeProvider per request

Motivation and Context

We already support endpointProvider request override (see #3978). This adds the same support for authSchemeProvider.

This supports cases such as overriding signing region per request.

Modifications

This follows the same pattern as adding endpointProvider request override, see: #3978

Testing

New and existing unit tests

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.

License

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

@alextwoods alextwoods requested a review from a team as a code owner April 22, 2026 21:32
@alextwoods alextwoods added the api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team label Apr 23, 2026
AuthSchemeProvider authSchemeProvider = clientConfig.option(SdkClientOption.AUTH_SCHEME_PROVIDER);
// Use the request-level auth scheme provider if the customer specified an override, otherwise fall back to the one
// on the client.
AuthSchemeProvider authSchemeProvider = resolveAuthSchemeProvider(originalRequest, clientConfig);
Copy link
Copy Markdown
Contributor

@zoewangg zoewangg Apr 23, 2026

Choose a reason for hiding this comment

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

Can we add functional tests to verify end to end behavior, something like EndpointAuthSigningPropertiesTest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great idea, added!

@alextwoods alextwoods enabled auto-merge April 23, 2026 21:02
@sonarqubecloud
Copy link
Copy Markdown

@alextwoods alextwoods added this pull request to the merge queue Apr 24, 2026
@davidh44 davidh44 removed this pull request from the merge queue due to a manual request Apr 24, 2026
@davidh44 davidh44 enabled auto-merge April 24, 2026 02:11
@davidh44 davidh44 added this pull request to the merge queue Apr 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 24, 2026
@alextwoods alextwoods added this pull request to the merge queue Apr 24, 2026
@alextwoods alextwoods removed this pull request from the merge queue due to a manual request Apr 24, 2026
@alextwoods alextwoods enabled auto-merge April 25, 2026 00:16
@alextwoods alextwoods mentioned this pull request Apr 25, 2026
12 tasks
@alextwoods alextwoods added this pull request to the merge queue Apr 25, 2026
Merged via the queue into master with commit 959c394 Apr 25, 2026
11 of 12 checks passed
@github-actions
Copy link
Copy Markdown

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 Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants