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

Ensure identity resolver is set when a credentials provider is given only at operation level #3156

Merged

Conversation

ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Nov 8, 2023

Motivation and Context

Fixes awslabs/aws-sdk-rust#901

Description

This PR is a rework of #3021 whose fix was inadvertently discarded during #3077. The way we fix the issue is slightly different. In this PR, we add an identity resolver to runtime components within set_credentials_provider, instead of using ServiceConfig.OperationConfigOverride.

Testing

Added a Kotlin integration test to CredentialProviderConfigTest.kt based on the customer reported issue.

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ysaito1001 ysaito1001 requested a review from a team as a code owner November 8, 2023 22:05
Copy link

github-actions bot commented Nov 8, 2023

Copy link

github-actions bot commented Nov 8, 2023

Copy link
Collaborator

@jdisanti jdisanti left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link

github-actions bot commented Nov 9, 2023

This commit updates request authorization in test request used in
`generate_random` because the PR now causes
`Credentials::for_tests_with_session_token` to take priority, instead of
a credentials provider set by `with_test_defaults`.
@ysaito1001 ysaito1001 added this pull request to the merge queue Nov 10, 2023
Merged via the queue into main with commit 9a82b44 Nov 10, 2023
39 checks passed
@ysaito1001 ysaito1001 deleted the ysaito/do-ensure-auth-scheme-exists-for-config-override branch November 10, 2023 05:56
@rcoh rcoh mentioned this pull request Nov 10, 2023
7 tasks
@ysaito1001 ysaito1001 added the needs-backport needs to be merged back into the main branch label Nov 10, 2023
rcoh pushed a commit that referenced this pull request Nov 13, 2023
…only at operation level (#3156)

Fixes awslabs/aws-sdk-rust#901

This PR is a rework of #3021
whose fix was inadvertently discarded during
#3077. The way we fix the issue
is slightly different. In this PR, we add an identity resolver to
runtime components within `set_credentials_provider`, instead of using
`ServiceConfig.OperationConfigOverride`.

Added a Kotlin integration test to `CredentialProviderConfigTest.kt`
based on the customer reported issue.

<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
rcoh pushed a commit that referenced this pull request Nov 13, 2023
…only at operation level (#3156)

Fixes awslabs/aws-sdk-rust#901

This PR is a rework of #3021
whose fix was inadvertently discarded during
#3077. The way we fix the issue
is slightly different. In this PR, we add an identity resolver to
runtime components within `set_credentials_provider`, instead of using
`ServiceConfig.OperationConfigOverride`.

Added a Kotlin integration test to `CredentialProviderConfigTest.kt`
based on the customer reported issue.

<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
rcoh pushed a commit that referenced this pull request Dec 1, 2023
…evisouly set (#3278)

## Motivation and Context
Fixes awslabs/aws-sdk-rust#973

## Description
Prior to the PR, if a customer explicitly passed a credentials provider
to a client's config `Builder::set_credentials_provider`, what's passed
did not override a credentials provider previously set ([actual use
case](awslabs/aws-sdk-rust#973 (comment))).

While in general, we recommend customers single-source a credentials
provider through
[aws_config::ConfigLoader::credentials_provider](https://docs.rs/aws-config/1.0.1/aws_config/struct.ConfigLoader.html#method.credentials_provider),
we should eliminate the said footgun in case they directly pass a
credentials provider to a client's config `Builder`.

The PR reverts test signature updates in
#3156 (in hindsight, having
to update test signatures in that PR was a sign of regression).

## Testing
Added a Kotlin test to `CredentialProviderConfigTest.kt` to verify the
fix

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport needs to be merged back into the main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config_override results in DispatchFailure
2 participants