AWS SDK

AWS SDK

rev. b312272346d50bcdc13e1914e37467d343d63934

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks-experimental/Cargo.toml

@@ -1,1 +33,33 @@
   16     16   
targets = ["x86_64-unknown-linux-gnu"]
   17     17   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   18     18   
rustdoc-args = ["--cfg", "docsrs"]
   19     19   
[dependencies.aws-smithy-types]
   20     20   
path = "../aws-smithy-types"
   21     21   
version = "1.2.0"
   22     22   
   23     23   
[dependencies.aws-smithy-runtime-api]
   24     24   
path = "../aws-smithy-runtime-api"
   25     25   
features = ["client", "http-02x"]
   26         -
version = "1.7.0"
          26  +
version = "1.6.3"
   27     27   
[dev-dependencies.aws-sdk-s3]
   28     28   
version = "1"
   29     29   
features = ["test-util"]
   30     30   
   31     31   
[dev-dependencies.tokio]
   32     32   
version = "1"
   33     33   
features = ["full"]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-protocol-test/Cargo.toml

@@ -1,1 +0,28 @@
   18     18   
http = "0.2.1"
   19     19   
pretty_assertions = "1.3"
   20     20   
regex-lite = "0.1.5"
   21     21   
roxmltree = "0.14.1"
   22     22   
serde_json = "1"
   23     23   
thiserror = "1.0.40"
   24     24   
   25     25   
[dependencies.aws-smithy-runtime-api]
   26     26   
path = "../aws-smithy-runtime-api"
   27     27   
features = ["client"]
   28         -
version = "1.7.0"
          28  +
version = "1.6.3"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/Cargo.toml

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-runtime-api"
    4         -
version = "1.7.0"
           4  +
version = "1.6.3"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "Smithy runtime types."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/src/client.rs

@@ -68,68 +128,126 @@
   88     88   
                this.inner.poll(cx)
   89     89   
            }
   90     90   
        }
   91     91   
    };
   92     92   
}
   93     93   
   94     94   
pub mod auth;
   95     95   
   96     96   
pub mod connection;
   97     97   
   98         -
pub mod connector_metadata;
   99         -
  100     98   
pub mod dns;
  101     99   
  102    100   
pub mod endpoint;
  103    101   
  104    102   
pub mod http;
  105    103   
  106    104   
/// Smithy identity used by auth and signing.
  107    105   
pub mod identity;
  108    106   
  109    107   
pub mod interceptors;

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/src/client/connector_metadata.rs

@@ -1,0 +50,0 @@
    1         -
/*
    2         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3         -
 * SPDX-License-Identifier: Apache-2.0
    4         -
 */
    5         -
    6         -
//! New-type for a configurable app name.
    7         -
    8         -
use std::borrow::Cow;
    9         -
use std::fmt;
   10         -
   11         -
/// The name of the crate that provides the HTTP connectors and its version.
   12         -
///
   13         -
/// This should be set by the connector's runtime plugin. Note that this is for
   14         -
/// the **connector** returned by an HTTP client, not the HTTP client itself.
   15         -
#[derive(Clone, Debug, PartialEq, Eq)]
   16         -
pub struct ConnectorMetadata {
   17         -
    name: Cow<'static, str>,
   18         -
    version: Option<Cow<'static, str>>,
   19         -
}
   20         -
   21         -
impl ConnectorMetadata {
   22         -
    /// Create a new [`ConnectorMetadata`].
   23         -
    pub fn new(name: impl Into<Cow<'static, str>>, version: Option<Cow<'static, str>>) -> Self {
   24         -
        Self {
   25         -
            name: name.into(),
   26         -
            version,
   27         -
        }
   28         -
    }
   29         -
   30         -
    /// Return the name of the crate backing a connector.
   31         -
    pub fn name(&self) -> Cow<'static, str> {
   32         -
        self.name.clone()
   33         -
    }
   34         -
   35         -
    /// Return the version of the crate backing a connector.
   36         -
    pub fn version(&self) -> Option<Cow<'static, str>> {
   37         -
        self.version.clone()
   38         -
    }
   39         -
}
   40         -
   41         -
impl fmt::Display for ConnectorMetadata {
   42         -
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   43         -
        write!(f, "http#{}", self.name)?;
   44         -
        if let Some(version) = self.version.as_deref() {
   45         -
            write!(f, "-{}", version)?;
   46         -
        }
   47         -
   48         -
        Ok(())
   49         -
    }
   50         -
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/src/client/http.rs

@@ -24,24 +84,83 @@
   44     44   
//! - Timeouts
   45     45   
//!
   46     46   
//! Some of these aren't implemented yet, but they will appear in the [`HttpConnectorSettings`] struct
   47     47   
//! once they are.
   48     48   
//!
   49     49   
//! [`hyper`]: https://crates.io/crates/hyper
   50     50   
//! [`tower`]: https://crates.io/crates/tower
   51     51   
//! [`aws-smithy-runtime`]: https://crates.io/crates/aws-smithy-runtime
   52     52   
   53     53   
use crate::box_error::BoxError;
   54         -
use crate::client::connector_metadata::ConnectorMetadata;
   55     54   
use crate::client::orchestrator::{HttpRequest, HttpResponse};
   56     55   
use crate::client::result::ConnectorError;
   57     56   
use crate::client::runtime_components::sealed::ValidateConfig;
   58     57   
use crate::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder};
   59     58   
use crate::impl_shared_conversions;
   60     59   
use aws_smithy_types::config_bag::ConfigBag;
   61     60   
use std::fmt;
   62     61   
use std::sync::Arc;
   63     62   
use std::time::Duration;
   64     63   
@@ -139,138 +253,239 @@
  159    158   
  160    159   
    #[doc = include_str!("../../rustdoc/validate_final_config.md")]
  161    160   
    fn validate_final_config(
  162    161   
        &self,
  163    162   
        runtime_components: &RuntimeComponents,
  164    163   
        cfg: &ConfigBag,
  165    164   
    ) -> Result<(), BoxError> {
  166    165   
        let _ = (runtime_components, cfg);
  167    166   
        Ok(())
  168    167   
    }
  169         -
  170         -
    /// Provide metadata about the crate that this HttpClient uses to make connectors.
  171         -
    ///
  172         -
    /// If this is implemented and returns metadata, interceptors may inspect it
  173         -
    /// for the purpose of inserting that data into the user agent string when
  174         -
    /// making a request with this client.
  175         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  176         -
        None
  177         -
    }
  178    168   
}
  179    169   
  180    170   
/// Shared HTTP client for use across multiple clients and requests.
  181    171   
#[derive(Clone, Debug)]
  182    172   
pub struct SharedHttpClient {
  183    173   
    selector: Arc<dyn HttpClient>,
  184    174   
}
  185    175   
  186    176   
impl SharedHttpClient {
  187    177   
    /// Creates a new `SharedHttpClient`
  188    178   
    pub fn new(selector: impl HttpClient + 'static) -> Self {
  189    179   
        Self {
  190    180   
            selector: Arc::new(selector),
  191    181   
        }
  192    182   
    }
  193    183   
}
  194    184   
  195    185   
impl HttpClient for SharedHttpClient {
  196    186   
    fn http_connector(
  197    187   
        &self,
  198    188   
        settings: &HttpConnectorSettings,
  199    189   
        components: &RuntimeComponents,
  200    190   
    ) -> SharedHttpConnector {
  201    191   
        self.selector.http_connector(settings, components)
  202    192   
    }
  203         -
  204         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  205         -
        self.selector.connector_metadata()
  206         -
    }
  207    193   
}
  208    194   
  209    195   
impl ValidateConfig for SharedHttpClient {
  210    196   
    fn validate_base_client_config(
  211    197   
        &self,
  212         -
        runtime_components: &RuntimeComponentsBuilder,
  213         -
        cfg: &ConfigBag,
  214         -
    ) -> Result<(), BoxError> {
         198  +
        runtime_components: &super::runtime_components::RuntimeComponentsBuilder,
         199  +
        cfg: &aws_smithy_types::config_bag::ConfigBag,
         200  +
    ) -> Result<(), crate::box_error::BoxError> {
  215    201   
        self.selector
  216    202   
            .validate_base_client_config(runtime_components, cfg)
  217    203   
    }
  218    204   
  219    205   
    fn validate_final_config(
  220    206   
        &self,
  221    207   
        runtime_components: &RuntimeComponents,
  222         -
        cfg: &ConfigBag,
  223         -
    ) -> Result<(), BoxError> {
         208  +
        cfg: &aws_smithy_types::config_bag::ConfigBag,
         209  +
    ) -> Result<(), crate::box_error::BoxError> {
  224    210   
        self.selector.validate_final_config(runtime_components, cfg)
  225    211   
    }
  226    212   
}
  227    213   
  228    214   
impl_shared_conversions!(convert SharedHttpClient from HttpClient using SharedHttpClient::new);
  229    215   
  230    216   
/// Builder for [`HttpConnectorSettings`].
  231    217   
#[non_exhaustive]
  232    218   
#[derive(Default, Debug)]
  233    219   
pub struct HttpConnectorSettingsBuilder {

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/Cargo.toml

@@ -1,1 +84,84 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-runtime"
    4         -
version = "1.6.0"
           4  +
version = "1.5.7"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "The new smithy runtime crate"
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
   16     16   
[package.metadata.smithy-rs-release-tooling]
   17     17   
stable = true
   18     18   
[package.metadata.cargo-udeps.ignore]
   19     19   
normal = ["aws-smithy-http"]
   20     20   
   21     21   
[features]
   22     22   
client = ["aws-smithy-runtime-api/client", "aws-smithy-types/http-body-1-x"]
   23     23   
http-auth = ["aws-smithy-runtime-api/http-auth"]
   24     24   
connector-hyper-0-14-x = ["dep:hyper-0-14", "hyper-0-14?/client", "hyper-0-14?/http2", "hyper-0-14?/http1", "hyper-0-14?/tcp", "hyper-0-14?/stream", "dep:h2"]
   25     25   
tls-rustls = ["dep:hyper-rustls", "dep:rustls", "connector-hyper-0-14-x"]
   26     26   
rt-tokio = ["tokio/rt"]
   27     27   
test-util = ["aws-smithy-runtime-api/test-util", "dep:aws-smithy-protocol-test", "dep:tracing-subscriber", "dep:serde", "dep:serde_json", "dep:indexmap"]
   28     28   
wire-mock = ["test-util", "connector-hyper-0-14-x", "hyper-0-14?/server"]
   29     29   
   30     30   
[dependencies]
   31     31   
bytes = "1"
   32     32   
fastrand = "2.0.0"
   33     33   
httparse = "=1.8.0"
   34     34   
once_cell = "1.18.0"
   35     35   
pin-project-lite = "0.2.7"
   36     36   
pin-utils = "0.1.0"
   37     37   
tracing = "0.1.37"
   38     38   
   39     39   
[dependencies.aws-smithy-async]
   40     40   
path = "../aws-smithy-async"
   41     41   
version = "1.2.1"
   42     42   
   43     43   
[dependencies.aws-smithy-http]
   44     44   
path = "../aws-smithy-http"
   45     45   
version = "0.60.8"
   46     46   
   47     47   
[dependencies.aws-smithy-protocol-test]
   48     48   
path = "../aws-smithy-protocol-test"
   49     49   
optional = true
   50     50   
version = "0.60.7"
   51     51   
   52     52   
[dependencies.aws-smithy-runtime-api]
   53     53   
path = "../aws-smithy-runtime-api"
   54         -
version = "1.7.0"
          54  +
version = "1.6.3"
   55     55   
   56     56   
[dependencies.aws-smithy-types]
   57     57   
path = "../aws-smithy-types"
   58     58   
features = ["http-body-0-4-x"]
   59     59   
version = "1.2.0"
   60     60   
   61     61   
[dependencies.h2]
   62     62   
version = "0.3"
   63     63   
default-features = false
   64     64   
optional = true
@@ -101,101 +153,153 @@
  121    121   
tracing-test = "0.2.1"
  122    122   
  123    123   
[dev-dependencies.aws-smithy-async]
  124    124   
path = "../aws-smithy-async"
  125    125   
features = ["rt-tokio", "test-util"]
  126    126   
version = "1.2.1"
  127    127   
  128    128   
[dev-dependencies.aws-smithy-runtime-api]
  129    129   
path = "../aws-smithy-runtime-api"
  130    130   
features = ["test-util"]
  131         -
version = "1.7.0"
         131  +
version = "1.6.3"
  132    132   
  133    133   
[dev-dependencies.aws-smithy-types]
  134    134   
path = "../aws-smithy-types"
  135    135   
features = ["test-util"]
  136    136   
version = "1.2.0"
  137    137   
  138    138   
[dev-dependencies.tokio]
  139    139   
version = "1.25"
  140    140   
features = ["macros", "rt", "rt-multi-thread", "test-util", "full"]
  141    141   

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/hyper_014.rs

@@ -1,1 +61,59 @@
    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 crate::client::http::connection_poisoning::CaptureSmithyConnection;
    7      7   
use crate::client::http::hyper_014::timeout_middleware::HttpTimeoutError;
    8      8   
use aws_smithy_async::future::timeout::TimedOutError;
    9      9   
use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep};
   10     10   
use aws_smithy_runtime_api::box_error::BoxError;
   11     11   
use aws_smithy_runtime_api::client::connection::ConnectionMetadata;
   12         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
   13     12   
use aws_smithy_runtime_api::client::http::{
   14     13   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient,
   15     14   
    SharedHttpConnector,
   16     15   
};
   17     16   
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse};
   18     17   
use aws_smithy_runtime_api::client::result::ConnectorError;
   19     18   
use aws_smithy_runtime_api::client::runtime_components::{
   20     19   
    RuntimeComponents, RuntimeComponentsBuilder,
   21     20   
};
   22     21   
use aws_smithy_runtime_api::shared::IntoShared;
   23     22   
use aws_smithy_types::body::SdkBody;
   24     23   
use aws_smithy_types::config_bag::ConfigBag;
   25     24   
use aws_smithy_types::error::display::DisplayErrorContext;
   26     25   
use aws_smithy_types::retry::ErrorKind;
   27     26   
use h2::Reason;
   28     27   
use http::{Extensions, Uri};
   29     28   
use hyper_0_14::client::connect::{capture_connection, CaptureConnection, Connection, HttpInfo};
   30     29   
use hyper_0_14::service::Service;
   31         -
use std::borrow::Cow;
   32     30   
use std::collections::HashMap;
   33     31   
use std::error::Error;
   34     32   
use std::fmt;
   35     33   
use std::fmt::Debug;
   36     34   
use std::sync::RwLock;
   37     35   
use std::time::Duration;
   38     36   
use tokio::io::{AsyncRead, AsyncWrite};
   39     37   
   40     38   
#[cfg(feature = "tls-rustls")]
   41     39   
mod default_connector {
@@ -463,461 +526,520 @@
  483    481   
                    }
  484    482   
                }
  485    483   
                let connector = SharedHttpConnector::new(builder.build(tcp_connector));
  486    484   
                cache.insert(key.clone(), connector);
  487    485   
            }
  488    486   
            connector = cache.get(&key).cloned();
  489    487   
        }
  490    488   
  491    489   
        connector.expect("cache populated above")
  492    490   
    }
  493         -
  494         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  495         -
        Some(ConnectorMetadata::new("hyper", Some(Cow::Borrowed("0.x"))))
  496         -
    }
  497    491   
}
  498    492   
  499    493   
/// Builder for a hyper-backed [`HttpClient`] implementation.
  500    494   
///
  501    495   
/// This builder can be used to customize the underlying TCP connector used, as well as
  502    496   
/// hyper client configuration.
  503    497   
///
  504    498   
/// # Examples
  505    499   
///
  506    500   
/// Construct a Hyper client with the default TLS implementation (rustls).

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/capture_request.rs

@@ -1,1 +84,79 @@
    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         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
    7      6   
use aws_smithy_runtime_api::client::http::{
    8      7   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
    9      8   
};
   10      9   
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
   11     10   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   12     11   
use aws_smithy_runtime_api::shared::IntoShared;
   13     12   
use aws_smithy_types::body::SdkBody;
   14     13   
use std::fmt::Debug;
   15     14   
use std::sync::{Arc, Mutex};
   16     15   
use tokio::sync::oneshot;
   17     16   
   18     17   
#[derive(Debug)]
   19     18   
struct Inner {
   20     19   
    response: Option<http::Response<SdkBody>>,
   21     20   
    sender: Option<oneshot::Sender<HttpRequest>>,
   22     21   
}
   23     22   
   24     23   
/// Test Connection to capture a single request
   25     24   
#[derive(Debug, Clone)]
   26     25   
pub struct CaptureRequestHandler(Arc<Mutex<Inner>>);
   27     26   
   28     27   
impl HttpConnector for CaptureRequestHandler {
   29     28   
    fn call(&self, request: HttpRequest) -> HttpConnectorFuture {
   30     29   
        let mut inner = self.0.lock().unwrap();
   31     30   
        if let Err(_e) = inner.sender.take().expect("already sent").send(request) {
   32     31   
            tracing::trace!("The receiver was already dropped");
   33     32   
        }
   34     33   
        HttpConnectorFuture::ready(Ok(inner
   35     34   
            .response
   36     35   
            .take()
   37     36   
            .expect("could not handle second request")
   38     37   
            .try_into()
   39     38   
            .unwrap()))
   40     39   
    }
   41     40   
}
   42     41   
   43     42   
impl HttpClient for CaptureRequestHandler {
   44     43   
    fn http_connector(
   45     44   
        &self,
   46     45   
        _: &HttpConnectorSettings,
   47     46   
        _: &RuntimeComponents,
   48     47   
    ) -> SharedHttpConnector {
   49     48   
        self.clone().into_shared()
   50     49   
    }
   51         -
   52         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
   53         -
        Some(ConnectorMetadata::new("capture-request-handler", None))
   54         -
    }
   55     50   
}
   56     51   
   57     52   
/// Receiver for [`CaptureRequestHandler`].
   58     53   
#[derive(Debug)]
   59     54   
pub struct CaptureRequestReceiver {
   60     55   
    receiver: oneshot::Receiver<HttpRequest>,
   61     56   
}
   62     57   
   63     58   
impl CaptureRequestReceiver {
   64     59   
    /// Expect that a request was sent. Returns the captured request.

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs

@@ -1,1 +40,39 @@
    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 super::{
    7      7   
    Action, BodyData, ConnectionId, Direction, Error, Event, NetworkTraffic, Request, Response,
    8      8   
    Version,
    9      9   
};
   10         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
   11     10   
use aws_smithy_runtime_api::client::http::{
   12     11   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
   13     12   
};
   14     13   
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
   15     14   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   16     15   
use aws_smithy_runtime_api::shared::IntoShared;
   17     16   
use aws_smithy_types::body::SdkBody;
   18     17   
use http_body_0_4::Body;
   19     18   
use std::path::Path;
   20     19   
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -227,226 +261,256 @@
  247    246   
}
  248    247   
  249    248   
impl HttpClient for RecordingClient {
  250    249   
    fn http_connector(
  251    250   
        &self,
  252    251   
        _: &HttpConnectorSettings,
  253    252   
        _: &RuntimeComponents,
  254    253   
    ) -> SharedHttpConnector {
  255    254   
        self.clone().into_shared()
  256    255   
    }
  257         -
  258         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  259         -
        Some(ConnectorMetadata::new("recording-client", None))
  260         -
    }
  261    256   
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs

@@ -1,1 +38,37 @@
    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 super::{Action, ConnectionId, Direction, Event, NetworkTraffic};
    7      7   
use aws_smithy_protocol_test::MediaType;
    8         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
    9      8   
use aws_smithy_runtime_api::client::http::{
   10      9   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
   11     10   
};
   12     11   
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse};
   13     12   
use aws_smithy_runtime_api::client::result::ConnectorError;
   14     13   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   15     14   
use aws_smithy_runtime_api::shared::IntoShared;
   16     15   
use aws_smithy_types::body::SdkBody;
   17     16   
use aws_smithy_types::error::display::DisplayErrorContext;
   18     17   
use bytes::{Bytes, BytesMut};
@@ -343,342 +377,372 @@
  363    362   
}
  364    363   
  365    364   
impl HttpClient for ReplayingClient {
  366    365   
    fn http_connector(
  367    366   
        &self,
  368    367   
        _: &HttpConnectorSettings,
  369    368   
        _: &RuntimeComponents,
  370    369   
    ) -> SharedHttpConnector {
  371    370   
        self.clone().into_shared()
  372    371   
    }
  373         -
  374         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  375         -
        Some(ConnectorMetadata::new("replaying-client", None))
  376         -
    }
  377    372   
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/infallible.rs

@@ -1,1 +36,35 @@
    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         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
    7      6   
use aws_smithy_runtime_api::client::http::{
    8      7   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient,
    9      8   
    SharedHttpConnector,
   10      9   
};
   11     10   
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse};
   12     11   
use aws_smithy_runtime_api::client::result::ConnectorError;
   13     12   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   14     13   
use aws_smithy_runtime_api::shared::IntoShared;
   15     14   
use aws_smithy_types::body::SdkBody;
   16     15   
use std::fmt;
@@ -49,48 +83,78 @@
   69     68   
}
   70     69   
   71     70   
impl HttpClient for InfallibleClientFn {
   72     71   
    fn http_connector(
   73     72   
        &self,
   74     73   
        _: &HttpConnectorSettings,
   75     74   
        _: &RuntimeComponents,
   76     75   
    ) -> SharedHttpConnector {
   77     76   
        self.clone().into_shared()
   78     77   
    }
   79         -
   80         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
   81         -
        Some(ConnectorMetadata::new("infallible-client", None))
   82         -
    }
   83     78   
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/never.rs

@@ -1,1 +90,85 @@
    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   
//! Test connectors that never return data
    7      7   
    8      8   
use aws_smithy_async::future::never::Never;
    9         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
   10      9   
use aws_smithy_runtime_api::client::http::{
   11     10   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
   12     11   
};
   13     12   
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
   14     13   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   15     14   
use aws_smithy_runtime_api::shared::IntoShared;
   16     15   
use std::sync::atomic::{AtomicUsize, Ordering};
   17     16   
use std::sync::Arc;
   18     17   
   19     18   
/// A client that will never respond.
   20     19   
///
   21     20   
/// Returned futures will return `Pending` forever
   22     21   
#[derive(Clone, Debug, Default)]
   23     22   
pub struct NeverClient {
   24     23   
    invocations: Arc<AtomicUsize>,
   25     24   
}
   26     25   
   27     26   
impl NeverClient {
   28     27   
    /// Create a new never connector.
   29     28   
    pub fn new() -> Self {
   30     29   
        Default::default()
   31     30   
    }
   32     31   
   33     32   
    /// Returns the number of invocations made to this connector.
   34     33   
    pub fn num_calls(&self) -> usize {
   35     34   
        self.invocations.load(Ordering::SeqCst)
   36     35   
    }
   37     36   
}
   38     37   
   39     38   
impl HttpConnector for NeverClient {
   40     39   
    fn call(&self, _request: HttpRequest) -> HttpConnectorFuture {
   41     40   
        self.invocations.fetch_add(1, Ordering::SeqCst);
   42     41   
        HttpConnectorFuture::new(async move {
   43     42   
            Never::new().await;
   44     43   
            unreachable!()
   45     44   
        })
   46     45   
    }
   47     46   
}
   48     47   
   49     48   
impl HttpClient for NeverClient {
   50     49   
    fn http_connector(
   51     50   
        &self,
   52     51   
        _: &HttpConnectorSettings,
   53     52   
        _: &RuntimeComponents,
   54     53   
    ) -> SharedHttpConnector {
   55     54   
        self.clone().into_shared()
   56     55   
    }
   57         -
   58         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
   59         -
        Some(ConnectorMetadata::new("never-client", None))
   60         -
    }
   61     56   
}
   62     57   
   63     58   
/// A TCP connector that never connects.
   64     59   
// In the future, this can be available for multiple hyper version feature flags, with the impls gated between individual features
   65     60   
#[cfg(feature = "connector-hyper-0-14-x")]
   66     61   
#[derive(Clone, Debug, Default)]
   67     62   
pub struct NeverTcpConnector;
   68     63   
   69     64   
#[cfg(feature = "connector-hyper-0-14-x")]
   70     65   
impl NeverTcpConnector {

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/http/test_util/replay.rs

@@ -1,1 +37,36 @@
    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_smithy_protocol_test::{assert_ok, validate_body, MediaType};
    7         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
    8      7   
use aws_smithy_runtime_api::client::http::{
    9      8   
    HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
   10      9   
};
   11     10   
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse};
   12     11   
use aws_smithy_runtime_api::client::result::ConnectorError;
   13     12   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   14     13   
use aws_smithy_runtime_api::shared::IntoShared;
   15     14   
use http::header::CONTENT_TYPE;
   16     15   
use std::ops::Deref;
   17     16   
use std::sync::{Arc, Mutex, MutexGuard};
@@ -233,232 +287,282 @@
  253    252   
}
  254    253   
  255    254   
impl HttpClient for StaticReplayClient {
  256    255   
    fn http_connector(
  257    256   
        &self,
  258    257   
        _: &HttpConnectorSettings,
  259    258   
        _: &RuntimeComponents,
  260    259   
    ) -> SharedHttpConnector {
  261    260   
        self.clone().into_shared()
  262    261   
    }
  263         -
  264         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
  265         -
        Some(ConnectorMetadata::new("static-replay-client", None))
  266         -
    }
  267    262   
}
  268    263   
  269    264   
#[cfg(test)]
  270    265   
mod test {
  271    266   
    use crate::client::http::test_util::{ReplayEvent, StaticReplayClient};
  272    267   
    use aws_smithy_types::body::SdkBody;
  273    268   
  274    269   
    #[test]
  275    270   
    fn create_from_either_http_type() {
  276    271   
        let _client = StaticReplayClient::new(vec![ReplayEvent::new(

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-wasm/Cargo.toml

@@ -1,1 +33,33 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-wasm"
    4         -
version = "0.1.3"
           4  +
version = "0.1.2"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Eduardo Rodrigues <16357187+eduardomourar@users.noreply.github.com>"]
    6      6   
description = "Smithy WebAssembly configuration for smithy-rs."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/awslabs/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
   16     16   
[dependencies]
   17     17   
bytes = "1"
   18     18   
http = "1.0.0"
   19     19   
tracing = "0.1.40"
   20     20   
wasi = "0.12.1"
   21     21   
   22     22   
[dependencies.aws-smithy-runtime-api]
   23     23   
path = "../aws-smithy-runtime-api"
   24     24   
features = ["http-1x"]
   25         -
version = "1.7.0"
          25  +
version = "1.6.3"
   26     26   
   27     27   
[dependencies.aws-smithy-http]
   28     28   
path = "../aws-smithy-http"
   29     29   
version = "0.60.8"
   30     30   
   31     31   
[dependencies.aws-smithy-types]
   32     32   
path = "../aws-smithy-types"
   33     33   
version = "1.2.0"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-wasm/src/wasi.rs

@@ -1,1 +99,94 @@
    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   
//! WASI HTTP Adapter
    7      7   
use aws_smithy_http::header::ParseError;
    8         -
use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata;
    9      8   
use aws_smithy_runtime_api::{
   10      9   
    client::{
   11     10   
        http::{
   12     11   
            HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings,
   13     12   
            SharedHttpClient, SharedHttpConnector,
   14     13   
        },
   15     14   
        orchestrator::HttpRequest,
   16     15   
        result::ConnectorError,
   17     16   
        runtime_components::RuntimeComponents,
   18     17   
    },
   19     18   
    http::Response,
   20     19   
    shared::IntoShared,
   21     20   
};
   22     21   
use aws_smithy_types::body::SdkBody;
   23     22   
use bytes::{Bytes, BytesMut};
   24     23   
use wasi::http::{
   25     24   
    outgoing_handler,
   26     25   
    types::{self as wasi_http, OutgoingBody, RequestOptions},
   27     26   
};
   28     27   
   29     28   
/// Builder for [`WasiHttpClient`]. Currently empty, but allows for future
   30     29   
/// config options to be added in a backwards compatible manner.
   31     30   
#[derive(Default, Debug)]
   32     31   
#[non_exhaustive]
   33     32   
pub struct WasiHttpClientBuilder {}
   34     33   
   35     34   
impl WasiHttpClientBuilder {
   36     35   
    /// Creates a new builder.
   37     36   
    pub fn new() -> Self {
   38     37   
        Default::default()
   39     38   
    }
   40     39   
   41     40   
    /// Builds the [`WasiHttpClient`].
   42     41   
    pub fn build(self) -> SharedHttpClient {
   43     42   
        let client = WasiHttpClient {};
   44     43   
        client.into_shared()
   45     44   
    }
   46     45   
}
   47     46   
   48     47   
/// An HTTP client that can be used during instantiation of the client SDK in
   49     48   
/// order to route the HTTP requests through the WebAssembly host. The host must
   50     49   
/// support the WASI HTTP proposal as defined in the Preview 2 specification.
   51     50   
#[derive(Debug, Clone)]
   52     51   
#[non_exhaustive]
   53     52   
pub struct WasiHttpClient {}
   54     53   
   55     54   
impl HttpClient for WasiHttpClient {
   56     55   
    fn http_connector(
   57     56   
        &self,
   58     57   
        settings: &HttpConnectorSettings,
   59     58   
        _components: &RuntimeComponents,
   60     59   
    ) -> SharedHttpConnector {
   61     60   
        let options = WasiRequestOptions::from(settings);
   62     61   
        let connector = WasiHttpConnector { options };
   63     62   
   64     63   
        connector.into_shared()
   65     64   
    }
   66         -
   67         -
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
   68         -
        Some(ConnectorMetadata::new("wasi-http-client", None))
   69         -
    }
   70     65   
}
   71     66   
   72     67   
/// HTTP connector used in WASI environment
   73     68   
#[derive(Debug, Clone)]
   74     69   
struct WasiHttpConnector {
   75     70   
    options: WasiRequestOptions,
   76     71   
}
   77     72   
   78     73   
impl HttpConnector for WasiHttpConnector {
   79     74   
    fn call(&self, request: HttpRequest) -> HttpConnectorFuture {