-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add S3 Express identity cache #3390
Conversation
This commit adds supporting types for S3 Express. They are provided via the S3 customization and defining Rust types live in `aws-inlineable`.
This commit updates parts of the orchestrator so that when an S3 Express bucket name is passed, control flow will be directed to placeholder types added in the previous commit.
…/customize/s3/S3ExpressDecorator.kt Co-authored-by: John DiSanti <[email protected]>
This commit addresses #3386 (comment)
This commit addresses #3386 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
...dk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExpressDecorator.kt
Outdated
Show resolved
Hide resolved
...dk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3ExpressDecorator.kt
Outdated
Show resolved
Hide resolved
dbg!(result).expect("success"); | ||
|
||
http_client | ||
.validate_body_and_headers(Some(&["x-amz-s3session-token"]), "application/xml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to validate this header, you can use a custom timesource to stop time. Then I think it will be deterministic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe a header x-amz-s3session-token
is included for validate_body_and_headers
, maybe you're referring to assert_requests_match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(deleted, wrong PR)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
This commit addresses #3390 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
This commit addresses #3390 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
## Motivation and Context Allows the Rust SDK to use [S3 Express One Zone](https://aws.amazon.com/s3/storage-classes/express-one-zone/) ## Description The PR adds the said S3-specific functionality to the Rust SDK. The code changes have already been reviewed by previous sub PRs, but it's worth going through them again as a whole: - #3386 - #3388 - #3390 - #3432 - #3433 - #3459 - #3457 - #3462 In addition to the PRs above, commit eebe8af increases the canary lambda's memory size to 512MB from 128MB (also makes it configurable through a command line arg for `canary-runner`). By default, lambda's allowed memory size is 128MB but with the addition of `canary-wasm` in main, canary lambda's memory usage will be 152MB, causing the lambda to be killed by a signal during runtime. The commit addresses that issue. ## Testing - Unit tests in [aws/rust-runtime/aws-inlineable/src/s3_express.rs](https://github.com/smithy-lang/smithy-rs/blob/7f8c28b7038372927ec6196eff88384452f908dd/aws/rust-runtime/aws-inlineable/src/s3_express.rs) - Integration tests in [aws/sdk/integration-tests/s3/tests/express.rs](https://github.com/smithy-lang/smithy-rs/blob/7f8c28b7038372927ec6196eff88384452f908dd/aws/sdk/integration-tests/s3/tests/express.rs) - Canary in smithy-rs#3462 ## 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 <[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]> Co-authored-by: Russell Cohen <[email protected]>
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
andsecret_key
are for a customer's credentials but not for a retrievedcreate_session
API token).Cache values are of type
ExpiringCache
that contains a session token retrieved by S3'screate_session
API. When a customer is trying to use a cached session token but if it has expired,ExpiringCache
calls the S3'screate_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 forlist-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.