AWS SDK

AWS SDK

rev. c177bc6112cbc5135de1e24e8d7509ab305c676a

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssooidc/Cargo.toml

@@ -15,15 +75,75 @@
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40     40   
version = "1.8.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.5"
          45  +
version = "1.8.6"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53     53   
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]

tmp-codegen-diff/aws-sdk/sdk/sts/Cargo.toml

@@ -19,19 +136,136 @@
   39     39   
version = "0.60.7"
   40     40   
   41     41   
[dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44     44   
version = "1.8.6"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime-api]
   47     47   
path = "../aws-smithy-runtime-api"
   48     48   
features = ["client", "http-02x"]
   49         -
version = "1.8.5"
          49  +
version = "1.8.6"
   50     50   
   51     51   
[dependencies.aws-smithy-types]
   52     52   
path = "../aws-smithy-types"
   53     53   
version = "1.3.2"
   54     54   
   55     55   
[dependencies.aws-smithy-xml]
   56     56   
path = "../aws-smithy-xml"
   57     57   
version = "0.60.10"
   58     58   
   59     59   
[dependencies.aws-types]
   60     60   
path = "../aws-types"
   61     61   
version = "1.3.8"
   62     62   
   63     63   
[dependencies.fastrand]
   64     64   
version = "2.0.0"
   65     65   
   66     66   
[dependencies.http]
   67     67   
version = "0.2.9"
   68     68   
   69     69   
[dependencies.regex-lite]
   70     70   
version = "0.1.5"
   71     71   
   72     72   
[dependencies.tracing]
   73     73   
version = "0.1"
   74     74   
[dev-dependencies.aws-credential-types]
   75     75   
path = "../aws-credential-types"
   76     76   
features = ["test-util"]
   77     77   
version = "1.2.5"
   78     78   
   79     79   
[dev-dependencies.aws-runtime]
   80     80   
path = "../aws-runtime"
   81     81   
features = ["test-util"]
   82     82   
version = "1.5.10"
   83     83   
   84     84   
[dev-dependencies.aws-smithy-async]
   85     85   
path = "../aws-smithy-async"
   86     86   
features = ["test-util"]
   87     87   
version = "1.2.5"
   88     88   
   89     89   
[dev-dependencies.aws-smithy-http-client]
   90     90   
path = "../aws-smithy-http-client"
   91     91   
features = ["test-util", "wire-mock"]
   92     92   
version = "1.0.6"
   93     93   
   94     94   
[dev-dependencies.aws-smithy-protocol-test]
   95     95   
path = "../aws-smithy-protocol-test"
   96     96   
version = "0.63.4"
   97     97   
   98     98   
[dev-dependencies.aws-smithy-runtime]
   99     99   
path = "../aws-smithy-runtime"
  100    100   
features = ["test-util"]
  101    101   
version = "1.8.6"
  102    102   
  103    103   
[dev-dependencies.aws-smithy-runtime-api]
  104    104   
path = "../aws-smithy-runtime-api"
  105    105   
features = ["test-util"]
  106         -
version = "1.8.5"
         106  +
version = "1.8.6"
  107    107   
  108    108   
[dev-dependencies.aws-smithy-types]
  109    109   
path = "../aws-smithy-types"
  110    110   
features = ["test-util"]
  111    111   
version = "1.3.2"
  112    112   
  113    113   
[dev-dependencies.futures-util]
  114    114   
version = "0.3.25"
  115    115   
features = ["alloc"]
  116    116   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/timestreamquery/Cargo.toml

@@ -15,15 +139,139 @@
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40     40   
version = "1.8.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.5"
          45  +
version = "1.8.6"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53     53   
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tokio]
   68     68   
version = "1.23.1"
   69     69   
features = ["sync"]
   70     70   
   71     71   
[dependencies.tracing]
   72     72   
version = "0.1"
   73     73   
[dev-dependencies.aws-config]
   74     74   
path = "../aws-config"
   75         -
version = "1.8.3"
          75  +
version = "1.8.4"
   76     76   
   77     77   
[dev-dependencies.aws-credential-types]
   78     78   
path = "../aws-credential-types"
   79     79   
features = ["test-util"]
   80     80   
version = "1.2.5"
   81     81   
   82     82   
[dev-dependencies.aws-runtime]
   83     83   
path = "../aws-runtime"
   84     84   
features = ["test-util"]
   85     85   
version = "1.5.10"
   86     86   
   87     87   
[dev-dependencies.aws-smithy-async]
   88     88   
path = "../aws-smithy-async"
   89     89   
features = ["test-util"]
   90     90   
version = "1.2.5"
   91     91   
   92     92   
[dev-dependencies.aws-smithy-http-client]
   93     93   
path = "../aws-smithy-http-client"
   94     94   
features = ["test-util", "wire-mock"]
   95     95   
version = "1.0.6"
   96     96   
   97     97   
[dev-dependencies.aws-smithy-protocol-test]
   98     98   
path = "../aws-smithy-protocol-test"
   99     99   
version = "0.63.4"
  100    100   
  101    101   
[dev-dependencies.aws-smithy-runtime]
  102    102   
path = "../aws-smithy-runtime"
  103    103   
features = ["test-util"]
  104    104   
version = "1.8.6"
  105    105   
  106    106   
[dev-dependencies.aws-smithy-runtime-api]
  107    107   
path = "../aws-smithy-runtime-api"
  108    108   
features = ["test-util"]
  109         -
version = "1.8.5"
         109  +
version = "1.8.6"
  110    110   
  111    111   
[dev-dependencies.aws-smithy-types]
  112    112   
path = "../aws-smithy-types"
  113    113   
features = ["test-util"]
  114    114   
version = "1.3.2"
  115    115   
  116    116   
[dev-dependencies.futures-util]
  117    117   
version = "0.3.25"
  118    118   
features = ["alloc"]
  119    119   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/timestreamwrite/Cargo.toml

@@ -15,15 +98,98 @@
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40     40   
version = "1.8.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.5"
          45  +
version = "1.8.6"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53     53   
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tokio]
   68     68   
version = "1.23.1"
   69     69   
features = ["sync"]
   70     70   
   71     71   
[dependencies.tracing]
   72     72   
version = "0.1"
   73     73   
[dev-dependencies.aws-config]
   74     74   
path = "../aws-config"
   75         -
version = "1.8.3"
          75  +
version = "1.8.4"
   76     76   
   77     77   
[dev-dependencies.aws-credential-types]
   78     78   
path = "../aws-credential-types"
   79     79   
features = ["test-util"]
   80     80   
version = "1.2.5"
   81     81   
   82     82   
[dev-dependencies.aws-smithy-async]
   83     83   
path = "../aws-smithy-async"
   84     84   
features = ["test-util"]
   85     85   
version = "1.2.5"

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/Cargo.toml

@@ -25,25 +158,158 @@
   45     45   
version = "0.61.4"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime]
   48     48   
path = "../aws-smithy-runtime"
   49     49   
features = ["client"]
   50     50   
version = "1.8.6"
   51     51   
   52     52   
[dependencies.aws-smithy-runtime-api]
   53     53   
path = "../aws-smithy-runtime-api"
   54     54   
features = ["client", "http-02x"]
   55         -
version = "1.8.5"
          55  +
version = "1.8.6"
   56     56   
   57     57   
[dependencies.aws-smithy-types]
   58     58   
path = "../aws-smithy-types"
   59     59   
features = ["http-body-0-4-x"]
   60     60   
version = "1.3.2"
   61     61   
   62     62   
[dependencies.aws-types]
   63     63   
path = "../aws-types"
   64     64   
version = "1.3.8"
   65     65   
   66     66   
[dependencies.bytes]
   67     67   
version = "1.4.0"
   68     68   
   69     69   
[dependencies.fastrand]
   70     70   
version = "2.0.0"
   71     71   
   72     72   
[dependencies.http]
   73     73   
version = "0.2.9"
   74     74   
   75     75   
[dependencies.hyper]
   76     76   
version = "0.14.26"
   77     77   
features = ["stream"]
   78     78   
   79     79   
[dependencies.regex-lite]
   80     80   
version = "0.1.5"
   81     81   
   82     82   
[dependencies.tracing]
   83     83   
version = "0.1"
   84     84   
[dev-dependencies.async-stream]
   85     85   
version = "0.3.0"
   86     86   
   87     87   
[dev-dependencies.aws-config]
   88     88   
path = "../aws-config"
   89         -
version = "1.8.3"
          89  +
version = "1.8.4"
   90     90   
   91     91   
[dev-dependencies.aws-credential-types]
   92     92   
path = "../aws-credential-types"
   93     93   
features = ["test-util"]
   94     94   
version = "1.2.5"
   95     95   
   96     96   
[dev-dependencies.aws-runtime]
   97     97   
path = "../aws-runtime"
   98     98   
features = ["test-util"]
   99     99   
version = "1.5.10"
  100    100   
  101    101   
[dev-dependencies.aws-smithy-async]
  102    102   
path = "../aws-smithy-async"
  103    103   
features = ["test-util"]
  104    104   
version = "1.2.5"
  105    105   
  106    106   
[dev-dependencies.aws-smithy-eventstream]
  107    107   
path = "../aws-smithy-eventstream"
  108    108   
features = ["test-util"]
  109    109   
version = "0.60.10"
  110    110   
  111    111   
[dev-dependencies.aws-smithy-http-client]
  112    112   
path = "../aws-smithy-http-client"
  113    113   
features = ["test-util", "wire-mock"]
  114    114   
version = "1.0.6"
  115    115   
  116    116   
[dev-dependencies.aws-smithy-protocol-test]
  117    117   
path = "../aws-smithy-protocol-test"
  118    118   
version = "0.63.4"
  119    119   
  120    120   
[dev-dependencies.aws-smithy-runtime]
  121    121   
path = "../aws-smithy-runtime"
  122    122   
features = ["test-util"]
  123    123   
version = "1.8.6"
  124    124   
  125    125   
[dev-dependencies.aws-smithy-runtime-api]
  126    126   
path = "../aws-smithy-runtime-api"
  127    127   
features = ["test-util"]
  128         -
version = "1.8.5"
         128  +
version = "1.8.6"
  129    129   
  130    130   
[dev-dependencies.aws-smithy-types]
  131    131   
path = "../aws-smithy-types"
  132    132   
features = ["test-util"]
  133    133   
version = "1.3.2"
  134    134   
  135    135   
[dev-dependencies.futures-core]
  136    136   
version = "0.3.25"
  137    137   
  138    138   
[dev-dependencies.futures-util]

tmp-codegen-diff/aws-sdk/tests/credential_features/Cargo.toml

@@ -0,1 +0,62 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "credential-features-tests"
           4  +
version = "0.1.0"
           5  +
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
           6  +
edition = "2021"
           7  +
license = "Apache-2.0"
           8  +
repository = "https://github.com/smithy-lang/smithy-rs"
           9  +
publish = false
          10  +
          11  +
[dev-dependencies]
          12  +
http = "0.2.0"
          13  +
          14  +
[dev-dependencies.aws-config]
          15  +
path = "../../sdk/aws-config"
          16  +
features = ["test-util", "behavior-version-latest"]
          17  +
version = "1.8.4"
          18  +
          19  +
[dev-dependencies.aws-runtime]
          20  +
path = "../../sdk/aws-runtime"
          21  +
features = ["test-util"]
          22  +
version = "1.5.10"
          23  +
          24  +
[dev-dependencies.aws-types]
          25  +
path = "../../sdk/aws-types"
          26  +
version = "1.3.8"
          27  +
          28  +
[dev-dependencies.aws-credential-types]
          29  +
path = "../../sdk/aws-credential-types"
          30  +
version = "1.2.5"
          31  +
          32  +
[dev-dependencies.aws-sdk-s3]
          33  +
path = "../../sdk/s3"
          34  +
features = ["test-util", "behavior-version-latest"]
          35  +
version = "0.0.0-local"
          36  +
          37  +
[dev-dependencies.aws-smithy-async]
          38  +
path = "../../sdk/aws-smithy-async"
          39  +
features = ["rt-tokio"]
          40  +
version = "1.2.5"
          41  +
          42  +
[dev-dependencies.aws-smithy-http-client]
          43  +
path = "../../sdk/aws-smithy-http-client"
          44  +
features = ["test-util", "wire-mock"]
          45  +
version = "1.0.6"
          46  +
          47  +
[dev-dependencies.aws-smithy-runtime]
          48  +
path = "../../sdk/aws-smithy-runtime"
          49  +
features = ["client", "test-util"]
          50  +
version = "1.8.6"
          51  +
          52  +
[dev-dependencies.aws-smithy-runtime-api]
          53  +
path = "../../sdk/aws-smithy-runtime-api"
          54  +
version = "1.8.6"
          55  +
          56  +
[dev-dependencies.aws-smithy-types]
          57  +
path = "../../sdk/aws-smithy-types"
          58  +
version = "1.3.2"
          59  +
          60  +
[dev-dependencies.tokio]
          61  +
version = "1.23.1"
          62  +
features = ["full", "test-util"]

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/env.rs

@@ -0,1 +0,44 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_config::{environment::EnvironmentVariableCredentialsProvider, Region};
           7  +
use aws_runtime::user_agent::test_util::{
           8  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
           9  +
};
          10  +
use aws_sdk_s3::{Client, Config};
          11  +
use aws_smithy_http_client::test_util::capture_request;
          12  +
use aws_types::os_shim_internal::Env;
          13  +
          14  +
#[tokio::test]
          15  +
async fn env_ua_feature() {
          16  +
    let (http_client, request) = capture_request(None);
          17  +
          18  +
    let provider = EnvironmentVariableCredentialsProvider::new_with_env(Env::from_slice(&[
          19  +
        ("AWS_ACCESS_KEY_ID", "access"),
          20  +
        ("AWS_SECRET_ACCESS_KEY", " "),
          21  +
        ("SECRET_ACCESS_KEY", "secret"),
          22  +
        ("AWS_SESSION_TOKEN", "token"),
          23  +
    ]));
          24  +
          25  +
    let config = Config::builder()
          26  +
        .with_test_defaults()
          27  +
        .region(Region::from_static("fake"))
          28  +
        .http_client(http_client.clone())
          29  +
        .credentials_provider(provider)
          30  +
        .build();
          31  +
          32  +
    let client = Client::from_conf(config);
          33  +
          34  +
    let _ = client
          35  +
        .head_bucket()
          36  +
        .bucket("fake")
          37  +
        .send()
          38  +
        .await
          39  +
        .expect("XXXXXXXXXXX");
          40  +
          41  +
    let request = request.expect_request();
          42  +
    let ua = get_sdk_metric_str_from_request(&request);
          43  +
    assert_ua_contains_metric_values(ua, &["g"]);
          44  +
}

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/http.rs

@@ -0,1 +0,87 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use std::{collections::HashMap, ffi::OsString};
           7  +
           8  +
use aws_config::{provider_config::ProviderConfig, Region};
           9  +
use aws_runtime::user_agent::test_util::{
          10  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
          11  +
};
          12  +
use aws_sdk_s3::{Client, Config};
          13  +
use aws_smithy_async::rt::sleep::TokioSleep;
          14  +
use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient};
          15  +
use aws_smithy_types::body::SdkBody;
          16  +
use aws_types::os_shim_internal::{Env, Fs};
          17  +
use http::header::AUTHORIZATION;
          18  +
          19  +
#[tokio::test]
          20  +
async fn http_ua_feature() {
          21  +
    let (http_client, request) = capture_request(None);
          22  +
          23  +
    let env = Env::from_slice(&[
          24  +
        (
          25  +
            "AWS_CONTAINER_CREDENTIALS_FULL_URI",
          26  +
            "http://169.254.170.23/v1/credentials",
          27  +
        ),
          28  +
        (
          29  +
            "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",
          30  +
            "/var/run/secrets/pods.eks.amazonaws.com/serviceaccount/eks-pod-identity-token",
          31  +
        ),
          32  +
    ]);
          33  +
    let fs = Fs::from_raw_map(HashMap::from([(
          34  +
        OsString::from(
          35  +
            "/var/run/secrets/pods.eks.amazonaws.com/serviceaccount/eks-pod-identity-token",
          36  +
        ),
          37  +
        "Basic password".into(),
          38  +
    )]));
          39  +
          40  +
    let cred_request = http::Request::builder()
          41  +
        .header(AUTHORIZATION, "Basic password")
          42  +
        .uri("http://169.254.170.23/v1/credentials")
          43  +
        .body(SdkBody::empty())
          44  +
        .unwrap();
          45  +
    let cred_response = http::Response::builder()
          46  +
        .status(200)
          47  +
        .body(SdkBody::from(
          48  +
            r#" {
          49  +
                       "AccessKeyId" : "AKID",
          50  +
                       "SecretAccessKey" : "SECRET",
          51  +
                       "Token" : "TOKEN....=",
          52  +
                       "AccountId" : "AID",
          53  +
                       "Expiration" : "2009-02-13T23:31:30Z"
          54  +
                     }"#,
          55  +
        ))
          56  +
        .unwrap();
          57  +
          58  +
    let creds_client = StaticReplayClient::new(vec![ReplayEvent::new(cred_request, cred_response)]);
          59  +
    let provider_config = ProviderConfig::empty()
          60  +
        .with_env(env)
          61  +
        .with_fs(fs)
          62  +
        .with_http_client(creds_client)
          63  +
        .with_sleep_impl(TokioSleep::new());
          64  +
    let provider = aws_config::ecs::Builder::default()
          65  +
        .configure(&provider_config)
          66  +
        .build();
          67  +
          68  +
    let config = Config::builder()
          69  +
        .with_test_defaults()
          70  +
        .region(Region::from_static("fake"))
          71  +
        .http_client(http_client.clone())
          72  +
        .credentials_provider(provider)
          73  +
        .build();
          74  +
          75  +
    let client = Client::from_conf(config);
          76  +
          77  +
    let _ = client
          78  +
        .head_bucket()
          79  +
        .bucket("fake")
          80  +
        .send()
          81  +
        .await
          82  +
        .expect("XXXXXXXXXXX");
          83  +
          84  +
    let request = request.expect_request();
          85  +
    let ua = get_sdk_metric_str_from_request(&request);
          86  +
    assert_ua_contains_metric_values(ua, &["z"]);
          87  +
}

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/imds.rs

@@ -0,1 +0,75 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_config::{
           7  +
    imds::{
           8  +
        client::test_util::{
           9  +
            imds_request, imds_response, make_imds_client, token_request, token_response,
          10  +
        },
          11  +
        credentials::ImdsCredentialsProvider,
          12  +
    },
          13  +
    provider_config::ProviderConfig,
          14  +
    Region,
          15  +
};
          16  +
use aws_runtime::user_agent::test_util::{
          17  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
          18  +
};
          19  +
use aws_sdk_s3::{Client, Config};
          20  +
use aws_smithy_http_client::test_util::capture_request;
          21  +
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
          22  +
          23  +
const TOKEN_A: &str = "AQAEAFTNrA4eEGx0AQgJ1arIq_Cc-t4tWt3fB0Hd8RKhXlKc5ccvhg==";
          24  +
          25  +
#[tokio::test]
          26  +
async fn imds_ua_feature() {
          27  +
    let (http_client, request) = capture_request(None);
          28  +
          29  +
    let imds_http_client = StaticReplayClient::new(vec![
          30  +
            ReplayEvent::new(
          31  +
                token_request("http://169.254.169.254", 21600),
          32  +
                token_response(21600, TOKEN_A),
          33  +
            ),
          34  +
            ReplayEvent::new(
          35  +
                imds_request("http://169.254.169.254/latest/meta-data/iam/security-credentials/", TOKEN_A),
          36  +
                imds_response(r#"profile-name"#),
          37  +
            ),
          38  +
            ReplayEvent::new(
          39  +
                imds_request("http://169.254.169.254/latest/meta-data/iam/security-credentials/profile-name", TOKEN_A),
          40  +
                imds_response("{\n  \"Code\" : \"Success\",\n  \"LastUpdated\" : \"2021-09-20T21:42:26Z\",\n  \"Type\" : \"AWS-HMAC\",\n  \"AccessKeyId\" : \"ASIARTEST\",\n  \"SecretAccessKey\" : \"testsecret\",\n  \"Token\" : \"testtoken\",\n  \"Expiration\" : \"2021-09-21T04:16:53Z\"\n}"),
          41  +
            ),
          42  +
            ReplayEvent::new(
          43  +
                imds_request("http://169.254.169.254/latest/meta-data/iam/security-credentials/", TOKEN_A),
          44  +
                imds_response(r#"different-profile"#),
          45  +
            ),
          46  +
            ReplayEvent::new(
          47  +
                imds_request("http://169.254.169.254/latest/meta-data/iam/security-credentials/different-profile", TOKEN_A),
          48  +
                imds_response("{\n  \"Code\" : \"Success\",\n  \"LastUpdated\" : \"2021-09-20T21:42:26Z\",\n  \"Type\" : \"AWS-HMAC\",\n  \"AccessKeyId\" : \"ASIARTEST2\",\n  \"SecretAccessKey\" : \"testsecret\",\n  \"Token\" : \"testtoken\",\n  \"Expiration\" : \"2021-09-21T04:16:53Z\"\n}"),
          49  +
            ),
          50  +
        ]);
          51  +
    let imds_client = ImdsCredentialsProvider::builder()
          52  +
        .imds_client(make_imds_client(&imds_http_client))
          53  +
        .configure(&ProviderConfig::no_configuration())
          54  +
        .build();
          55  +
          56  +
    let config = Config::builder()
          57  +
        .with_test_defaults()
          58  +
        .region(Region::from_static("fake"))
          59  +
        .http_client(http_client.clone())
          60  +
        .credentials_provider(imds_client)
          61  +
        .build();
          62  +
          63  +
    let client = Client::from_conf(config);
          64  +
          65  +
    let _ = client
          66  +
        .head_bucket()
          67  +
        .bucket("fake")
          68  +
        .send()
          69  +
        .await
          70  +
        .expect("XXXXXXXXXXX");
          71  +
          72  +
    let request = request.expect_request();
          73  +
    let ua = get_sdk_metric_str_from_request(&request);
          74  +
    assert_ua_contains_metric_values(ua, &["0"]);
          75  +
}

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/process.rs

@@ -0,1 +0,40 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_config::credential_process::CredentialProcessProvider;
           7  +
use aws_config::Region;
           8  +
use aws_runtime::user_agent::test_util::{
           9  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
          10  +
};
          11  +
use aws_sdk_s3::{Client, Config};
          12  +
use aws_smithy_http_client::test_util::capture_request;
          13  +
          14  +
#[tokio::test]
          15  +
async fn process_ua_feature() {
          16  +
    let (http_client, request) = capture_request(None);
          17  +
          18  +
    let provider = CredentialProcessProvider::new(String::from(
          19  +
        r#"echo '{ "Version": 1, "AccessKeyId": "ASIARTESTID", "SecretAccessKey": "TESTSECRETKEY", "SessionToken": "TESTSESSIONTOKEN", "AccountId": "123456789001", "Expiration": "2022-05-02T18:36:00+00:00" }'"#,
          20  +
    ));
          21  +
    let config = Config::builder()
          22  +
        .with_test_defaults()
          23  +
        .region(Region::from_static("fake"))
          24  +
        .http_client(http_client.clone())
          25  +
        .credentials_provider(provider)
          26  +
        .build();
          27  +
          28  +
    let client = Client::from_conf(config);
          29  +
          30  +
    let _ = client
          31  +
        .head_bucket()
          32  +
        .bucket("fake")
          33  +
        .send()
          34  +
        .await
          35  +
        .expect("XXXXXXXXXXX");
          36  +
          37  +
    let request = request.expect_request();
          38  +
    let ua = get_sdk_metric_str_from_request(&request);
          39  +
    assert_ua_contains_metric_values(ua, &["w"]);
          40  +
}

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/profile.rs

@@ -0,1 +0,129 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use std::collections::HashMap;
           7  +
           8  +
use aws_config::{provider_config::ProviderConfig, Region};
           9  +
use aws_runtime::user_agent::test_util::{
          10  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
          11  +
};
          12  +
use aws_sdk_s3::{
          13  +
    config::{
          14  +
        http::{HttpRequest, HttpResponse},
          15  +
        HttpClient, RuntimeComponents,
          16  +
    },
          17  +
    Client, Config,
          18  +
};
          19  +
use aws_smithy_http_client::test_util::capture_request;
          20  +
use aws_smithy_runtime_api::client::http::{
          21  +
    HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
          22  +
};
          23  +
use aws_smithy_types::body::SdkBody;
          24  +
use aws_types::os_shim_internal::{Env, Fs};
          25  +
          26  +
#[tokio::test]
          27  +
async fn profile_and_sso_ua_features() {
          28  +
    let (http_client, request) = capture_request(None);
          29  +
          30  +
    #[derive(Debug)]
          31  +
    struct ClientInner {
          32  +
        expected_token: &'static str,
          33  +
    }
          34  +
    impl HttpConnector for ClientInner {
          35  +
        fn call(&self, request: HttpRequest) -> HttpConnectorFuture {
          36  +
            assert_eq!(
          37  +
                self.expected_token,
          38  +
                request.headers().get("x-amz-sso_bearer_token").unwrap()
          39  +
            );
          40  +
            HttpConnectorFuture::ready(Ok(HttpResponse::new(
          41  +
                    200.try_into().unwrap(),
          42  +
                    SdkBody::from("{\"roleCredentials\":{\"accessKeyId\":\"ASIARTESTID\",\"secretAccessKey\":\"TESTSECRETKEY\",\"sessionToken\":\"TESTSESSIONTOKEN\",\"expiration\": 1651516560000}}"),
          43  +
                )))
          44  +
        }
          45  +
    }
          46  +
    #[derive(Debug)]
          47  +
    struct CredsClient {
          48  +
        inner: SharedHttpConnector,
          49  +
    }
          50  +
    impl CredsClient {
          51  +
        fn new(expected_token: &'static str) -> Self {
          52  +
            Self {
          53  +
                inner: SharedHttpConnector::new(ClientInner { expected_token }),
          54  +
            }
          55  +
        }
          56  +
    }
          57  +
    impl HttpClient for CredsClient {
          58  +
        fn http_connector(
          59  +
            &self,
          60  +
            _settings: &HttpConnectorSettings,
          61  +
            _components: &RuntimeComponents,
          62  +
        ) -> SharedHttpConnector {
          63  +
            self.inner.clone()
          64  +
        }
          65  +
    }
          66  +
          67  +
    let fs = Fs::from_map({
          68  +
        let mut map = HashMap::new();
          69  +
        map.insert(
          70  +
            "/home/.aws/config".to_string(),
          71  +
            br#"
          72  +
[profile default]
          73  +
sso_session = dev
          74  +
sso_account_id = 012345678901
          75  +
sso_role_name = SampleRole
          76  +
region = us-east-1
          77  +
          78  +
[sso-session dev]
          79  +
sso_region = us-east-1
          80  +
sso_start_url = https://d-abc123.awsapps.com/start
          81  +
                "#
          82  +
            .to_vec(),
          83  +
        );
          84  +
        map.insert(
          85  +
            "/home/.aws/sso/cache/34c6fceca75e456f25e7e99531e2425c6c1de443.json".to_string(),
          86  +
            br#"
          87  +
                {
          88  +
                    "accessToken": "secret-access-token",
          89  +
                    "expiresAt": "2199-11-14T04:05:45Z",
          90  +
                    "refreshToken": "secret-refresh-token",
          91  +
                    "clientId": "ABCDEFG323242423121312312312312312",
          92  +
                    "clientSecret": "ABCDE123",
          93  +
                    "registrationExpiresAt": "2199-03-06T19:53:17Z",
          94  +
                    "region": "us-east-1",
          95  +
                    "startUrl": "https://d-abc123.awsapps.com/start"
          96  +
                }
          97  +
                "#
          98  +
            .to_vec(),
          99  +
        );
         100  +
        map
         101  +
    });
         102  +
    let provider_config = ProviderConfig::empty()
         103  +
        .with_fs(fs.clone())
         104  +
        .with_env(Env::from_slice(&[("HOME", "/home")]))
         105  +
        .with_http_client(CredsClient::new("secret-access-token"));
         106  +
    let provider = aws_config::profile::credentials::Builder::default()
         107  +
        .configure(&provider_config)
         108  +
        .build();
         109  +
         110  +
    let config = Config::builder()
         111  +
        .with_test_defaults()
         112  +
        .region(Region::from_static("fake"))
         113  +
        .http_client(http_client.clone())
         114  +
        .credentials_provider(provider)
         115  +
        .build();
         116  +
         117  +
    let client = Client::from_conf(config);
         118  +
         119  +
    let _ = client
         120  +
        .head_bucket()
         121  +
        .bucket("fake")
         122  +
        .send()
         123  +
        .await
         124  +
        .expect("XXXXXXXXXXX");
         125  +
         126  +
    let request = request.expect_request();
         127  +
    let ua = get_sdk_metric_str_from_request(&request);
         128  +
    assert_ua_contains_metric_values(ua, &["n", "s"]);
         129  +
}

tmp-codegen-diff/aws-sdk/tests/credential_features/tests/sts.rs

@@ -0,1 +0,79 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use std::time::{Duration, UNIX_EPOCH};
           7  +
           8  +
use aws_config::{sts::AssumeRoleProvider, BehaviorVersion, Region};
           9  +
use aws_credential_types::Credentials;
          10  +
use aws_runtime::user_agent::test_util::{
          11  +
    assert_ua_contains_metric_values, get_sdk_metric_str_from_request,
          12  +
};
          13  +
use aws_sdk_s3::{config::SharedAsyncSleep, Client, Config};
          14  +
use aws_smithy_async::test_util::instant_time_and_sleep;
          15  +
use aws_smithy_http_client::test_util::capture_request;
          16  +
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
          17  +
use aws_smithy_types::body::SdkBody;
          18  +
use aws_types::SdkConfig;
          19  +
          20  +
#[tokio::test]
          21  +
async fn sts_assume_role_ua_feature() {
          22  +
    let (http_client, request) = capture_request(None);
          23  +
          24  +
    let creds_client = StaticReplayClient::new(vec![
          25  +
            ReplayEvent::new(http::Request::new(SdkBody::from("request body")),
          26  +
            http::Response::builder().status(200).body(SdkBody::from(
          27  +
                "<AssumeRoleResponse xmlns=\"https://sts.amazonaws.com/doc/2011-06-15/\">\n  <AssumeRoleResult>\n    <AssumedRoleUser>\n      <AssumedRoleId>AROAR42TAWARILN3MNKUT:assume-role-from-profile-1632246085998</AssumedRoleId>\n      <Arn>arn:aws:sts::130633740322:assumed-role/assume-provider-test/assume-role-from-profile-1632246085998</Arn>\n    </AssumedRoleUser>\n    <Credentials>\n      <AccessKeyId>ASIARCORRECT</AccessKeyId>\n      <SecretAccessKey>secretkeycorrect</SecretAccessKey>\n      <SessionToken>tokencorrect</SessionToken>\n      <Expiration>2009-02-13T23:31:30Z</Expiration>\n    </Credentials>\n  </AssumeRoleResult>\n  <ResponseMetadata>\n    <RequestId>d9d47248-fd55-4686-ad7c-0fb7cd1cddd7</RequestId>\n  </ResponseMetadata>\n</AssumeRoleResponse>\n"
          28  +
            )).unwrap()),
          29  +
            ReplayEvent::new(http::Request::new(SdkBody::from("request body")),
          30  +
            http::Response::builder().status(200).body(SdkBody::from(
          31  +
                "<AssumeRoleResponse xmlns=\"https://sts.amazonaws.com/doc/2011-06-15/\">\n  <AssumeRoleResult>\n    <AssumedRoleUser>\n      <AssumedRoleId>AROAR42TAWARILN3MNKUT:assume-role-from-profile-1632246085998</AssumedRoleId>\n      <Arn>arn:aws:sts::130633740322:assumed-role/assume-provider-test/assume-role-from-profile-1632246085998</Arn>\n    </AssumedRoleUser>\n    <Credentials>\n      <AccessKeyId>ASIARCORRECT</AccessKeyId>\n      <SecretAccessKey>TESTSECRET</SecretAccessKey>\n      <SessionToken>tokencorrect</SessionToken>\n      <Expiration>2009-02-13T23:33:30Z</Expiration>\n    </Credentials>\n  </AssumeRoleResult>\n  <ResponseMetadata>\n    <RequestId>c2e971c2-702d-4124-9b1f-1670febbea18</RequestId>\n  </ResponseMetadata>\n</AssumeRoleResponse>\n"
          32  +
            )).unwrap()),
          33  +
        ]);
          34  +
          35  +
    let (testing_time_source, sleep) = instant_time_and_sleep(
          36  +
        UNIX_EPOCH + Duration::from_secs(1234567890), // 1234567890 since UNIX_EPOCH is 2009-02-13T23:31:30Z from the responses above
          37  +
    );
          38  +
          39  +
    let sts_config = SdkConfig::builder()
          40  +
        .sleep_impl(SharedAsyncSleep::new(sleep))
          41  +
        .time_source(testing_time_source.clone())
          42  +
        .http_client(creds_client)
          43  +
        .behavior_version(BehaviorVersion::latest())
          44  +
        .build();
          45  +
          46  +
    let credentials = Credentials::new(
          47  +
        "test",
          48  +
        "test",
          49  +
        None,
          50  +
        Some(UNIX_EPOCH + Duration::from_secs(1234567890 + 1)),
          51  +
        "test",
          52  +
    );
          53  +
          54  +
    let provider = AssumeRoleProvider::builder("myrole")
          55  +
        .configure(&sts_config)
          56  +
        .region(Region::new("us-east-1"))
          57  +
        .build_from_provider(credentials)
          58  +
        .await;
          59  +
          60  +
    let config = Config::builder()
          61  +
        .with_test_defaults()
          62  +
        .region(Region::from_static("fake"))
          63  +
        .http_client(http_client.clone())
          64  +
        .credentials_provider(provider)
          65  +
        .build();
          66  +
          67  +
    let client = Client::from_conf(config);
          68  +
          69  +
    let _ = client
          70  +
        .head_bucket()
          71  +
        .bucket("fake")
          72  +
        .send()
          73  +
        .await
          74  +
        .expect("XXXXXXXXXXX");
          75  +
          76  +
    let request = request.expect_request();
          77  +
    let ua = get_sdk_metric_str_from_request(&request);
          78  +
    assert_ua_contains_metric_values(ua, &["i"]);
          79  +
}

tmp-codegen-diff/aws-sdk/tests/no-default-features/Cargo.toml

@@ -1,1 +48,48 @@
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
publish = false
   11     11   
   12     12   
[dev-dependencies]
   13     13   
futures = "0.3.25"
   14     14   
   15     15   
[dev-dependencies.aws-config]
   16     16   
path = "../../sdk/aws-config"
   17     17   
default-features = false
   18         -
version = "1.8.3"
          18  +
version = "1.8.4"
   19     19   
   20     20   
[dev-dependencies.aws-sdk-s3]
   21     21   
path = "../../sdk/s3"
   22     22   
default-features = false
   23     23   
version = "0.0.0-local"
   24     24   
   25     25   
[dev-dependencies.aws-smithy-async]
   26     26   
path = "../../sdk/aws-smithy-async"
   27     27   
version = "1.2.5"
   28     28   

tmp-codegen-diff/aws-sdk/tests/telemetry/Cargo.toml

@@ -1,1 +51,51 @@
   11     11   
[dev-dependencies]
   12     12   
http = "0.2.0"
   13     13   
serial_test = "3.1.1"
   14     14   
tracing = "0.1.40"
   15     15   
tracing-subscriber = "0.3.18"
   16     16   
tracing-fluent-assertions = "0.3.0"
   17     17   
   18     18   
[dev-dependencies.aws-config]
   19     19   
path = "../../sdk/aws-config"
   20     20   
features = ["test-util", "behavior-version-latest"]
   21         -
version = "1.8.3"
          21  +
version = "1.8.4"
   22     22   
   23     23   
[dev-dependencies.aws-sdk-dynamodb]
   24     24   
path = "../../sdk/dynamodb"
   25     25   
features = ["test-util", "behavior-version-latest"]
   26     26   
version = "0.0.0-local"
   27     27   
   28     28   
[dev-dependencies.aws-sdk-s3]
   29     29   
path = "../../sdk/s3"
   30     30   
features = ["test-util", "behavior-version-latest"]
   31     31   
version = "0.0.0-local"