Skip to content
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-credential-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-credential-types"
version = "1.2.8"
version = "1.2.9"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
description = "Types for AWS SDK credentials."
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub enum AwsCredentialFeature {
CredentialsImds,
/// An operation called using a Bearer token resolved from service-specific environment variables
BearerServiceEnvVars,
/// An operation called using S3 Express bucket credentials
S3ExpressBucket,
}

impl Storable for AwsCredentialFeature {
Expand Down
424 changes: 412 additions & 12 deletions aws/rust-runtime/aws-inlineable/src/s3_express.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-runtime"
version = "1.5.12"
version = "1.5.13"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly."
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ impl ProvideBusinessMetric for AwsCredentialFeature {
CredentialsHttp => Some(BusinessMetric::CredentialsHttp),
CredentialsImds => Some(BusinessMetric::CredentialsImds),
BearerServiceEnvVars => Some(BusinessMetric::BearerServiceEnvVars),
S3ExpressBucket => Some(BusinessMetric::S3ExpressBucket),
otherwise => {
// This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate
// while continuing to use an outdated version of an SDK crate or the `aws-credential-types`
Expand Down
17 changes: 15 additions & 2 deletions aws/sdk/integration-tests/s3/tests/express.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::time::{Duration, SystemTime};

use aws_config::timeout::TimeoutConfig;
use aws_config::Region;
use aws_runtime::user_agent::test_util::assert_ua_does_not_contain_metric_values;
use aws_sdk_s3::config::endpoint::{EndpointFuture, Params, ResolveEndpoint};
use aws_sdk_s3::config::{Builder, Credentials};
use aws_sdk_s3::presigning::PresigningConfig;
Expand Down Expand Up @@ -54,6 +55,11 @@ async fn create_session_request_should_not_include_x_amz_s3session_token() {
);
assert!(req.headers().get("x-amz-security-token").is_some());
assert!(req.headers().get("x-amz-s3session-token").is_none());

// The first request uses regular SigV4 credentials (for CreateSession), not S3 Express credentials,
// so metric "J" should NOT be present yet. It will appear on subsequent requests that use S3 Express credentials.
let user_agent = req.headers().get("x-amz-user-agent").unwrap();
assert_ua_does_not_contain_metric_values(user_agent, &["J"]);
}

#[tokio::test]
Expand Down Expand Up @@ -273,9 +279,9 @@ async fn default_checksum_should_be_crc32_for_operation_requiring_checksum() {
.iter()
.filter(|(key, _)| key.starts_with("x-amz-checksum"))
.collect();

assert_eq!(1, checksum_headers.len());
assert_eq!("x-amz-checksum-crc32", checksum_headers[0].0);

http_client.assert_requests_match(&[""]);
}

Expand Down Expand Up @@ -304,7 +310,6 @@ async fn default_checksum_should_be_none() {
.iter()
.map(|checksum| format!("amz-checksum-{}", checksum.to_lowercase()))
.chain(std::iter::once("content-md5".to_string()));

assert!(!all_checksums.any(|checksum| http_client
.actual_requests()
.any(|req| req.headers().iter().any(|(key, _)| key == checksum))));
Expand Down Expand Up @@ -332,6 +337,10 @@ async fn disable_s3_express_session_auth_at_service_client_level() {
req.headers().get("x-amz-create-session-mode").is_none(),
"x-amz-create-session-mode should not appear in headers when S3 Express session auth is disabled"
);

// Verify that the User-Agent does NOT contain the S3ExpressBucket metric "J" when session auth is disabled
let user_agent = req.headers().get("x-amz-user-agent").unwrap();
assert_ua_does_not_contain_metric_values(user_agent, &["J"]);
}

#[tokio::test]
Expand Down Expand Up @@ -418,6 +427,10 @@ async fn support_customer_overriding_express_credentials_provider() {
.expect("x-amz-security-token should be present");
assert_eq!(expected_session_token, actual_session_token);
assert!(req.headers().get("x-amz-s3session-token").is_none());

// Verify that the User-Agent does NOT contain the S3ExpressBucket metric "J" for regular buckets
let user_agent = req.headers().get("x-amz-user-agent").unwrap();
assert_ua_does_not_contain_metric_values(user_agent, &["J"]);
}

#[tokio::test]
Expand Down
Loading