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 exists when a credentials provider is given only at operation level #3021

Conversation

ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Oct 3, 2023

Motivation and Context

Fixes awslabs/aws-sdk-rust#901

Description

When a credentials provider is specified only at the operation level (but not at the service config level), the code in the above PR fails on request dispatch, saying NoMatchingAuthScheme. This occurs today because if we do not set a credentials provider at the service config level, we will not set the identity resolver for sigv4. The same goes for configuring a SigningRegion when it is only supplied at the operation level.

This PR fixes the said issue so that config_override sets

  • the identity resolver for sigv4 when a credentials provider is supplied only at the operation config level
  • a SigningRegion when a Region is given only at the operation level

Testing

Added a Kotlin integ test test_specifying_credentials_provider_only_at_operation_level_should_work based on the customer reported PR.

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 October 3, 2023 19:12
@ysaito1001 ysaito1001 added the needs-backport needs to be merged back into the main branch label Oct 3, 2023
@ysaito1001 ysaito1001 requested a review from a team as a code owner October 3, 2023 19:37
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

CHANGELOG.next.toml Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@ysaito1001 ysaito1001 enabled auto-merge (squash) October 4, 2023 03:21
@ysaito1001 ysaito1001 merged commit 40aaa1e into smithy-rs-release-0.56.x Oct 4, 2023
40 of 41 checks passed
@ysaito1001 ysaito1001 deleted the ysaito/ensure-auth-scheme-exists-for-config-override branch October 4, 2023 03:44
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

github-merge-queue bot pushed a commit that referenced this pull request Nov 10, 2023
…only at operation level (#3156)

## 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
<!--- 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 rcoh removed the needs-backport needs to be merged back into the main branch label Nov 13, 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._
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.

4 participants