aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

`aws-config` credentials providers inconsistently cache when explicitly configured

Open jdisanti opened this issue 3 years ago • 1 comments
trafficstars

The default credentials chain has caching, and AssumeRoleCredentialsProvider has caching when set explicitly on SdkConfig. The rest of the credentials providers don't cache when set up explicitly though. Ideally, credentials providers would just always cache—one should not need to think about it. Even better if things are smart enough to not double-cache (does AssumeRoleCredentialsProvider add a redundant layer of caching to the default chain?).

jdisanti avatar Oct 05 '22 16:10 jdisanti

The type system could potentially be used to enforce that caching is configured correctly. The SdkConfig could take a dyn CachingCredentialsProvider trait while all the credentials providers only implement CredentialsProvider. Then the caching wrappers such as LazyCachingCredentialsProvider could implement CachingCredentialsProvider. This would make it impossible to override credentials providers without caching, or if someone really wanted no caching, a manual implementation of CachingCredentialsProvider would be needed.

jdisanti avatar Oct 05 '22 16:10 jdisanti

Closing this, as it's been implemented in https://github.com/awslabs/smithy-rs/pull/2122 (plus its follow-up https://github.com/awslabs/smithy-rs/pull/2227).

ysaito1001 avatar Jan 23 '23 20:01 ysaito1001

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Jan 23 '23 20:01 github-actions[bot]