Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add S3 Express identity cache (#3390)
## Motivation and Context Adds a default implementation for S3 Express identity cache. ## Description This PR adds the said cache for S3 Express. This cache is not configurable from outside and solely owned by the default S3 Express identity provider. It is implemented in terms of an LRU cache keyed on a string generated by `sha256hmac(random 64-byte key, access_key_id + secret_key) + bucket_name` (note: `access_key_id` and `secret_key` are for a customer's credentials but not for a retrieved `create_session` API token). Cache values are of type `ExpiringCache` that contains a session token retrieved by S3's `create_session` API. When a customer is trying to use a cached session token but if it has expired, `ExpiringCache` calls the S3's `create_session` API, stores in it a new session token, and returns it to the customer. ## Testing Added unit tests for `S3IdentityCache` and a connection recording test for `list-objects-v2` running against both express and regular buckets to exercise a use case where a customer is switching between those buckets. ---- _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 <[email protected]> Co-authored-by: Russell Cohen <[email protected]> Co-authored-by: AWS SDK Rust Bot <[email protected]> Co-authored-by: AWS SDK Rust Bot <[email protected]> Co-authored-by: Zelda Hessler <[email protected]>
- Loading branch information