Add initial support assume role credential resolver#721
Open
arandito wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Important
This PR adds a standalone Assume Role credential resolver that can only be used programmatically. We do not currently support reading from a shared AWS config file and do not have a mechanism to create profile-based credential providers in the default chain. Once both land, users will be able to configure assume role credentials from their shared config file. However, this will immediately unblock anyone wishing to use assume role credentials.
Description
This PR adds an Assume Role credentials resolver the Smithy Python runtime that allows clients to source credentials from the Amazon Security Token Service (STS) using the AssumeRole API.
Changes
AssumeRoleCredentialsResolverin theidentitymodule of thesmithy-aws-corepackagesource_resolverthat must be of theAWSCredentialsResolvertype. It then converts the API output shape into anAWSCredentialsIdentity.mfa_serialand an asyncmfa_code_providercallback. The callback is invoked on every assume so a fresh, single-use token code is supplied on each credential refresh._private/nested_clients/aws_sdk_sts/that includes only theAssumeRoleoperation, exposed behind a new[assume-role]package extra that pulls insmithy-xmlfor the awsQuery protocol.Testing
aws-sdk-bedrock-runtimeclient.AssumeRoleCredentialResolveruses nested resolver to sign AssumeRole requestTesting script:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.