Unverified Commit 6e16e2ba authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

remove aws-hyper (#959)

* Replace generated code references to AwsMiddleware from hyper with inline dependency

* remove usages of aws-hyper

* RIP aws-hyper

* rename AwsMiddleware to default Middleware

* Delete unused aws-hyper deps

* Update changelog

* Update RFC

* Add deprecation note to aws-hyper
parent f9e5d64a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -157,3 +157,9 @@ message = "Fixed a bug where certain characters caused a panic during URI encodi
meta = { "breaking" = false, "tada" = false, "bug" = true }
references = ["smithy-rs#953", "aws-sdk-rust#331"]
author = "rcoh"

[[aws-sdk-rust]]
message = "`aws-hyper::AwsMiddleware` is now generated into generated service clients directly. If you used `aws_hyper::Middleware`, use <service>::middleware::DefaultMiddleware` instead."
meta = { "breaking" = false, "tada" = false, "bug" = false }
references = ["smithy-rs#959", "smithy-rs#934"]
author = "rcoh"
+2 −5
Original line number Diff line number Diff line
@@ -14,9 +14,9 @@ profile = ["sts", "web-identity-token", "meta", "environment", "imds", "http-pro
meta = ["tokio/sync"]
imds = ["profile", "aws-smithy-http/rt-tokio", "aws-smithy-http-tower", "aws-smithy-json", "tower", "aws-http", "meta"]
environment = ["meta"]
sts = ["aws-sdk-sts", "aws-hyper"]
sts = ["aws-sdk-sts"]
web-identity-token = ["sts", "profile"]
http-provider = ["aws-hyper", "aws-smithy-json", "aws-smithy-http/rt-tokio", "tower", "tokio/sync"]
http-provider = ["aws-smithy-json", "aws-smithy-http/rt-tokio", "tower", "tokio/sync"]
tcp-connector = ["tokio/net", "tower"]

# SSO is not supported
@@ -40,9 +40,6 @@ aws-types = { path = "../../sdk/build/aws-sdk/sdk/aws-types" }
tokio = { version = "1", features = ["sync"], optional = true }
tracing = { version = "0.1" }

# TODO: remove when middleware stacks are moved inside of clients directly
aws-hyper = { path = "../../sdk/build/aws-sdk/sdk/aws-hyper", optional = true }

# imds
aws-http = { path = "../../sdk/build/aws-sdk/sdk/aws-http", optional = true }
aws-smithy-http = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http", optional = true }
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ use crate::profile::credentials::ProfileFileError;
use crate::provider_config::ProviderConfig;
use crate::sts;
use crate::web_identity_token::{StaticConfiguration, WebIdentityTokenCredentialsProvider};
use aws_hyper::AwsMiddleware;
use aws_sdk_sts::middleware::DefaultMiddleware;
use aws_smithy_client::erase::DynConnector;
use aws_types::credentials::{self, CredentialsError, ProvideCredentials};
use aws_types::os_shim_internal::Fs;
@@ -30,7 +30,7 @@ pub struct AssumeRoleProvider {

#[derive(Debug)]
pub struct ClientConfiguration {
    pub(crate) core_client: aws_smithy_client::Client<DynConnector, AwsMiddleware>,
    pub(crate) core_client: aws_smithy_client::Client<DynConnector, DefaultMiddleware>,
    pub(crate) region: Option<Region>,
}

+3 −3
Original line number Diff line number Diff line
@@ -10,12 +10,12 @@ mod assume_role;
use crate::connector::expect_connector;
use crate::provider_config::{HttpSettings, ProviderConfig};
pub use assume_role::{AssumeRoleProvider, AssumeRoleProviderBuilder};
use aws_hyper::AwsMiddleware;
use aws_sdk_sts::middleware::DefaultMiddleware;
use aws_smithy_client::erase::DynConnector;

impl ProviderConfig {
    pub(crate) fn sdk_client(&self) -> aws_smithy_client::Client<DynConnector, AwsMiddleware> {
        aws_smithy_client::Builder::<(), AwsMiddleware>::new()
    pub(crate) fn sdk_client(&self) -> aws_smithy_client::Client<DynConnector, DefaultMiddleware> {
        aws_smithy_client::Builder::<(), DefaultMiddleware>::new()
            .connector(expect_connector(self.connector(&HttpSettings::default())))
            .sleep_impl(self.sleep())
            .build()
+3 −3
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@

//! Assume credentials for a role through the AWS Security Token Service (STS).

use aws_hyper::AwsMiddleware;
use aws_sdk_sts::error::AssumeRoleErrorKind;
use aws_sdk_sts::middleware::DefaultMiddleware;
use aws_sdk_sts::operation::AssumeRole;
use aws_types::credentials::{
    self, future, CredentialsError, ProvideCredentials, SharedCredentialsProvider,
@@ -41,7 +41,7 @@ use tracing::Instrument;
/// ```
#[derive(Debug)]
pub struct AssumeRoleProvider {
    sts: aws_smithy_client::Client<DynConnector, AwsMiddleware>,
    sts: aws_smithy_client::Client<DynConnector, DefaultMiddleware>,
    conf: aws_sdk_sts::Config,
    op: aws_sdk_sts::input::AssumeRoleInput,
}
@@ -141,7 +141,7 @@ impl AssumeRoleProviderBuilder {
        });
        let client = aws_smithy_client::Builder::new()
            .connector(conn)
            .middleware(AwsMiddleware::new())
            .middleware(DefaultMiddleware::new())
            .sleep_impl(default_async_sleep())
            .build();

Loading