1 1 | /*
|
2 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3 3 | * SPDX-License-Identifier: Apache-2.0
|
4 4 | */
|
5 5 |
|
6 6 | use aws_credential_types::provider::SharedCredentialsProvider;
|
7 - | use aws_sdk_s3control::config::{Credentials, Region};
|
7 + | use aws_sdk_s3control::config::{retry::RetryConfig, {Credentials, Region};
|
8 8 | use aws_sdk_s3control::{Client, Config};
|
9 9 | use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient};
|
10 10 | use aws_smithy_types::body::SdkBody;
|
11 11 | use http_1x::header::AUTHORIZATION;
|
12 12 |
|
13 13 | #[tokio::test]
|
14 14 | async fn test_signer() {
|
15 15 | let http_client = StaticReplayClient::new(vec![ReplayEvent::new(
|
16 16 | http_1x::Request::builder()
|
17 17 | .header("authorization",
|
18 18 | "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/s3/aws4_request, \
|
19 19 | SignedHeaders=host;x-amz-account-id;x-amz-content-sha256;x-amz-date;x-amz-user-agent, \
|
20 20 | Signature=0102a74cb220f8445c4efada17660572ff813e07b524032ec831e8c2514be903")
|
21 21 | .uri("https://test-bucket.s3-control.us-east-1.amazonaws.com/v20180820/accesspoint")
|
22 22 | .body(SdkBody::empty())
|
23 23 | .unwrap(),
|
24 24 | http_1x::Response::builder().status(200).body(SdkBody::empty()).unwrap(),
|
25 25 | )]);
|
26 26 | let config = Config::builder()
|
27 27 | .credentials_provider(SharedCredentialsProvider::new(
|
28 28 | Credentials::for_tests_with_session_token(),
|
29 29 | ))
|
30 30 | .http_client(http_client.clone())
|
31 31 | .region(Region::new("us-east-1"))
|
32 32 | .with_test_defaults()
|
33 + | .retry_config(RetryConfig::disabled())
|
33 34 | .build();
|
34 35 | let client = Client::from_conf(config);
|
35 36 |
|
36 37 | let _ = client
|
37 38 | .list_access_points()
|
38 39 | .account_id("test-bucket")
|
39 40 | .send()
|
40 41 | .await
|
41 42 | .expect_err("empty response");
|
42 43 |
|