Skip to content

Commit c91bc77

Browse files
authored
Remove create-session-mode header for internally used CreateSession API in S3 Express (#3992)
## Motivation and Context This PR stops populating `SessionMode` by default for the `CreateSession` API internally used by S3 Express, as the value already matched the service-side default and it was already not sent by other SDKs. ## Testing - Existing tests in CI (i.e. canary) - Updated S3 Express integration tests to verify that no `SessionMode` header is present by the `CreateSession` API internally used by S3 Express ## Checklist - [x] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 587e714 commit c91bc77

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.changelog/1738340700.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
applies_to:
3+
- aws-sdk-rust
4+
authors:
5+
- ysaito1001
6+
references:
7+
- smithy-rs#3992
8+
breaking: false
9+
new_feature: false
10+
bug_fix: true
11+
---
12+
Stop populating `SessionMode` by default for the `CreateSession` API internally used by S3 Express. This will allow the service to choose a default value for `SessionMode` field based on bucket/access point being used.

aws/rust-runtime/aws-inlineable/src/s3_express.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,7 @@ pub(crate) mod identity_provider {
553553
config_builder.runtime_components = rc_builder;
554554

555555
let client = crate::Client::from_conf(config_builder.build());
556-
let response = client
557-
.create_session()
558-
.bucket(bucket_name)
559-
.session_mode(crate::types::SessionMode::ReadWrite)
560-
.send()
561-
.await?;
556+
let response = client.create_session().bucket(bucket_name).send().await?;
562557

563558
response
564559
.credentials

aws/sdk/integration-tests/s3/tests/data/express/mixed-auths.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
"uri": "https://s3express-test-bucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com/?session",
99
"headers": {
1010
"authorization": [
11-
"AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-west-2/s3express/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-create-session-mode;x-amz-date;x-amz-user-agent, Signature=38991fe77e65f7e9ffba9ddaeb0ba457d8673bb5c11068eaeb53a4f5fa7c4136"
12-
],
13-
"x-amz-create-session-mode": [
14-
"ReadWrite"
11+
"AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-west-2/s3express/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=41c2b04a140b0973d5f82d18c412c21a2328d86435b5568e4fbdf6af5d99ebb5"
1512
],
1613
"amz-sdk-request": [
1714
"attempt=1; max=3"
@@ -308,13 +305,10 @@
308305
"20090213T233130Z"
309306
],
310307
"authorization": [
311-
"AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-west-2/s3express/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-create-session-mode;x-amz-date;x-amz-user-agent, Signature=9e664e775f458662091e9df58f1f37f66cb74e21ac19fd9a618a9189285ca152"
308+
"AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-west-2/s3express/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=44d20d3ee77ea1d7d0dd871e27b862b48803e1810ac4ae4debed958ceef3af4e"
312309
],
313310
"x-amz-content-sha256": [
314311
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
315-
],
316-
"x-amz-create-session-mode": [
317-
"ReadWrite"
318312
]
319313
},
320314
"method": "GET"

aws/sdk/integration-tests/s3/tests/express.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ async fn create_session_request_should_not_include_x_amz_s3session_token() {
5151

5252
let req = request.expect_request();
5353
assert!(
54-
req.headers().get("x-amz-create-session-mode").is_some(),
55-
"`x-amz-create-session-mode` should appear in headers of the first request when an express bucket is specified"
54+
req.headers().get("x-amz-create-session-mode").is_none(),
55+
"`x-amz-create-session-mode` should not appear in headers of the first request when an express bucket is specified"
5656
);
5757
assert!(req.headers().get("x-amz-security-token").is_some());
5858
assert!(req.headers().get("x-amz-s3session-token").is_none());
@@ -109,7 +109,6 @@ async fn mixed_auths() {
109109
fn create_session_request() -> http::Request<SdkBody> {
110110
http::Request::builder()
111111
.uri("https://s3express-test-bucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com/?session")
112-
.header("x-amz-create-session-mode", "ReadWrite")
113112
.method("GET")
114113
.body(SdkBody::empty())
115114
.unwrap()

0 commit comments

Comments
 (0)