Skip to content

Adjust no_auth test expectation to address semver hazards failure #4211

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

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 0 additions & 25 deletions aws/sdk/integration-tests/s3/tests/express.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,28 +453,3 @@ async fn s3_express_auth_flow_should_not_be_reached_with_no_auth_schemes() {
// If s3 Express auth flow were exercised, no request would be received, most likely due to `TimeoutError`.
let _ = request.expect_request();
}

#[tracing_test::traced_test]
#[tokio::test]
async fn no_auth_should_be_selected_when_no_credentials_is_configured() {
let (http_client, _) = capture_request(None);
let config = aws_config::from_env()
.http_client(http_client)
.region(Region::new("us-east-2"))
.no_credentials()
.load()
.await;

let client = Client::new(&config);
let _ = dbg!(
client
.list_objects_v2()
.bucket("doesnotmatter")
.send()
.await
);

assert!(logs_contain(
"resolving identity scheme_id=AuthSchemeId { scheme_id: \"no_auth\" }"
));
}
29 changes: 29 additions & 0 deletions aws/sdk/integration-tests/s3/tests/no_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

use aws_sdk_s3::config::Region;
use aws_sdk_s3::{Client, Config};
use aws_smithy_http_client::test_util::capture_request;
use aws_smithy_http_client::test_util::dvr::ReplayingClient;
use aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID;
use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs;

#[tokio::test]
Expand Down Expand Up @@ -131,3 +134,29 @@ async fn get_object() {
.await
.unwrap();
}

#[tracing_test::traced_test]
#[tokio::test]
async fn no_auth_should_be_selected_when_no_credentials_is_configured() {
let (http_client, _) = capture_request(None);
let config = aws_config::from_env()
.http_client(http_client)
.region(Region::new("us-east-2"))
.no_credentials()
.load()
.await;

let client = Client::new(&config);
let _ = dbg!(
client
.list_objects_v2()
.bucket("doesnotmatter")
.send()
.await
);

assert!(logs_contain(&format!(
"resolving identity scheme_id=AuthSchemeId {{ scheme_id: \"{auth_scheme_id_str}\" }}",
auth_scheme_id_str = NO_AUTH_SCHEME_ID.inner(),
)));
}
Loading