Unverified Commit 55da46cd authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Fix `native-tls` feature in `aws-config` (#803)



* Fix `native-tls` feature in `aws-config`

* Update changelog

Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 9028c847
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@ vNext (Month Day, Year)
**Breaking Changes**
- `<operation>.make_operation(&config)` is now an `async` function for all operations. Code should be updated to call `.await`. This will only impact users using the low-level API. (smithy-rs#797)

**New this week**

- Fix `native-tls` feature in `aws-config` (aws-sdk-rust#265, smithy-rs#803)

v0.0.22-alpha (October 20th, 2021)
==================================

+4 −3
Original line number Diff line number Diff line
@@ -10,13 +10,14 @@ repository = "https://github.com/awslabs/smithy-rs"

[features]
default-provider = ["profile", "imds", "meta", "sts", "environment", "http-provider"]
profile = ["sts", "web-identity-token", "meta", "environment", "imds"]
profile = ["sts", "web-identity-token", "meta", "environment", "imds", "http-provider"]
meta = ["tokio/sync"]
imds = ["profile", "aws-smithy-http", "aws-smithy-http-tower", "aws-smithy-json", "tower", "aws-http", "meta"]
environment = ["meta"]
sts = ["aws-sdk-sts", "aws-hyper"]
web-identity-token = ["sts", "profile"]
http-provider = []
http-provider = ["aws-hyper", "aws-smithy-json", "aws-smithy-http", "tower", "tokio/sync"]
tcp-connector = ["tokio/net", "tower"]

# SSO is not supported
sso = []
@@ -28,7 +29,7 @@ rt-tokio = ["aws-smithy-async/rt-tokio"]
# Tokio based DNS-resolver for ECS validation
dns = ["tokio/rt"]

default = ["default-provider", "rustls", "rt-tokio", "dns"]
default = ["default-provider", "rustls", "rt-tokio", "dns", "tcp-connector"]

[dependencies]
aws-sdk-sts = { path = "../../sdk/build/aws-sdk/sts", optional = true }
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ pub mod retry_config {
    ///
    /// # Example
    ///
    /// ```rust
    /// ```no_run
    /// # use std::error::Error;
    /// # #[tokio::main]
    /// # async fn main() -> Result<(), Box<dyn Error>> {
+24 −12
Original line number Diff line number Diff line
@@ -77,11 +77,16 @@ pub mod ecs;

pub mod provider_config;

#[cfg(any(feature = "meta", feature = "default-provider"))]
mod cache;

#[cfg(feature = "imds")]
pub mod imds;

#[cfg(any(feature = "http-provider", feature = "imds"))]
mod json_credentials;

#[cfg(feature = "http-provider")]
mod http_provider;

/// Create an environment loader for AWS Configuration
@@ -243,15 +248,7 @@ mod connector {
        connector.expect("A connector was not available. Either set a custom connector or enable the `rustls` and `native-tls` crate features.")
    }

    #[cfg(feature = "rustls")]
    pub(crate) fn default_connector(
        settings: &HttpSettings,
        sleep: Option<Arc<dyn AsyncSleep>>,
    ) -> Option<DynConnector> {
        let hyper = base(settings, sleep).build(aws_smithy_client::conns::https());
        Some(DynConnector::new(hyper))
    }

    #[cfg(any(feature = "rustls", feature = "native-tls"))]
    fn base(
        settings: &HttpSettings,
        sleep: Option<Arc<dyn AsyncSleep>>,
@@ -264,14 +261,29 @@ mod connector {
        hyper
    }

    #[cfg(feature = "rustls")]
    pub(crate) fn default_connector(
        settings: &HttpSettings,
        sleep: Option<Arc<dyn AsyncSleep>>,
    ) -> Option<DynConnector> {
        let hyper = base(settings, sleep).build(aws_smithy_client::conns::https());
        Some(DynConnector::new(hyper))
    }

    #[cfg(all(not(feature = "rustls"), feature = "native-tls"))]
    pub fn default_connector() -> Option<DynConnector> {
        base(settings, sleep).build(aws_smithy_client::conns::native_tls());
    pub(crate) fn default_connector(
        settings: &HttpSettings,
        sleep: Option<Arc<dyn AsyncSleep>>,
    ) -> Option<DynConnector> {
        let hyper = base(settings, sleep).build(aws_smithy_client::conns::native_tls());
        Some(DynConnector::new(hyper))
    }

    #[cfg(not(any(feature = "rustls", feature = "native-tls")))]
    pub fn default_connector() -> Option<DynConnector> {
    pub(crate) fn default_connector(
        _settings: &HttpSettings,
        _sleep: Option<Arc<dyn AsyncSleep>>,
    ) -> Option<DynConnector> {
        None
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -11,5 +11,7 @@ pub use chain::CredentialsProviderChain;
mod credential_fn;
pub use credential_fn::provide_credentials_fn;

#[cfg(any(feature = "meta", feature = "default-provider"))]
pub mod lazy_caching;
#[cfg(any(feature = "meta", feature = "default-provider"))]
pub use lazy_caching::LazyCachingCredentialsProvider;
Loading