Skip to content
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

Enable request-level token provider override #4171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenying-wang
Copy link

Motivation and Context

Currently, AWS SDK for Java 2.0 clients don't support override SdkTokenProvider in the request level for the bearer token authorization operations. If using different SdkTokenProviders, it will be required to create one instances of the client per SdkTokenProvider, which will undermine the runtime performance.

Modifications

This change enables request-level SdkTokenProvider override.

Testing

The Unit test is added to cover the change.

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

@chenying-wang chenying-wang requested a review from a team as a code owner July 10, 2023 03:51
@debora-ito
Copy link
Member

@chenying-wang can you tell us more about your use case?
Are you implementing a custom TokenProvider?

@chenying-wang
Copy link
Author

@debora-ito

No, we are not implementing a custom SdkTokenProvider and we are just using the StaticTokenProvider.

We have built the backend service that will vend the custom bearer token to the clients and also authenticate the clients based on the bearer token. We will have a client service using the AWS SDK for Java 2.0 client to interact with the said service with the bearer token authentication. Now, each time the client service will have to create a new instance of the SDK service client for each bearer token, and the performance is not ideal.

Therefore, we want to the SDK client to have capability to override the bearer token at request level so that we don't have to create multiple SDK client instances.

Hope this makes sense.

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