Add `NoCredentialsCache` that offers no caching ability (#2720)
## Motivation and Context Related to https://github.com/awslabs/aws-sdk-rust/issues/809 ## Description It has been discovered that when `AssumeRoleProvider` is used, the Rust SDK emits `credentials cache miss occurred` twice per request. The reason why that log is shown twice is illustrated in the following diagram:  One of the cache miss messages is due to the fact `AssumeRoleProvider` internally uses an STS client, which, in turn, is wrapped by a `LazyCredentialsCache` by default. However, that use of `LazyCredentialsCache` is pointless because caching is already in effect with the outermost `LazyCredentialsCache`. This PR adds a new kind of `CredentialsCache`, `NoCredentialsCache`. As its name suggests, it simplify delegates `provide_cached_credentials` to the underlying provider's `provide_credentials` with no caching functionality. We then update `SsoCredentialsProvider`, `AssumeRoleProvider`, and `WebIdentityTokenCredentialsProvider` to use `NoCredentialsCache` for their STS clients so the logs won't show `credentials cache miss occurred` twice per request. ## Testing - Added unit tests for `NoCredentialsCache` - Updated unit test for `AssumeRoleProvider` to verify `NoCredentialsCache` is used by default ## Checklist - [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:Yuki Saito <awsaito@amazon.com>
Loading
Please register or sign in to comment