Add support for environment token provider for services whose SigV4 signing names are bedrock
#4241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Adds support for environment token provider for AWS services whose SigV4 service signing name matches
bedrock
. Setting this environment variable,AWS_BEARER_TOKEN_BEDROCK
, allows SDKs to prefer thehttpBearerAuth
auth scheme and to retrieve aToken
value from the said environment.Description
Customers would use the environment variable in question like so:
Under the hood, this is equivalent roughly to
This behind-the-scenes convenience is implemented in
impl From<&SdkConfig> for Builder
, similar to how a service-specific environment is implemented for the endpoint URL.However,
impl From<&SdkConfig> for Builder
implies that customers need to create a service client fromSdkConfig
(typically through ConfigLoader::load) in order to take advantage of the environment variable. If customers create the service client directly from the service config builder, the environment variable will not be applied, i.e.Testing
bedrockruntime
(whose model is already checked in toaws/sdk/aws-models
)Checklist
.changelog
directory, specifying "aws-sdk-rust" in theapplies_to
key.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.