Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DynConnector and HttpConnector with HttpClient #3011

Merged
merged 28 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0af7920
Replace `DynConnector` and `HttpConnector` with `HttpClient`
jdisanti Sep 26, 2023
d2eef3f
Fix several CI issues
jdisanti Oct 2, 2023
bcdb26c
Merge remote-tracking branch 'origin/main' into jdisanti-connector-sw…
jdisanti Oct 2, 2023
d2a6d1c
Fix S3 wire mock tests
jdisanti Oct 2, 2023
3029d92
Fix doc issues
jdisanti Oct 2, 2023
0524199
Fix time assertion in DynamoDB test
jdisanti Oct 3, 2023
4ee26bb
More CI fixes
jdisanti Oct 3, 2023
70e5cda
Improve doc comment links
jdisanti Oct 3, 2023
e257ac9
Simplify arguments to `ImdsCommonRuntimePlugin`
jdisanti Oct 3, 2023
9981efd
Rename `EventClient`
jdisanti Oct 3, 2023
b6b428f
New-type DNS resolution error
jdisanti Oct 4, 2023
4e1021c
Add doc comments around usage of `IntoShared` arguments
jdisanti Oct 4, 2023
d5f8332
Fix more CI things
jdisanti Oct 4, 2023
2c009d5
Fix external type checks
jdisanti Oct 4, 2023
c2fa187
Merge remote-tracking branch 'origin/main' into jdisanti-connector-sw…
jdisanti Oct 4, 2023
1b0e0bd
Retain old http_connector methods as hints for upgrade guidance
jdisanti Oct 4, 2023
671e9c8
Retain old with_tcp_connector method as a hint for upgrade guidance
jdisanti Oct 4, 2023
e487a47
Other feedback
jdisanti Oct 4, 2023
370d0ff
Add changelog entries
jdisanti Oct 4, 2023
9386c25
Remove `IntoShared` argument wrappers
jdisanti Oct 5, 2023
1d80edf
Add `BoxFuture` type to `aws_smithy_async::future`
jdisanti Oct 5, 2023
66e63b8
Misc feedback
jdisanti Oct 5, 2023
02fdd3f
Merge remote-tracking branch 'origin/main' into jdisanti-connector-sw…
jdisanti Oct 5, 2023
355bf24
Fix external types checks
jdisanti Oct 5, 2023
365dee6
Several minor fixes
jdisanti Oct 5, 2023
558117d
Merge remote-tracking branch 'origin/main' into jdisanti-connector-sw…
jdisanti Oct 5, 2023
819adbc
Fix broken test
jdisanti Oct 6, 2023
0dfc109
Merge remote-tracking branch 'origin/main' into jdisanti-connector-sw…
jdisanti Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"

[[smithy-rs]]
message = "HTTP connector configuration has changed significantly. See the [upgrade guidance](https://github.com/awslabs/smithy-rs/discussions/3022) for details."
references = ["smithy-rs#3011"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "jdisanti"

[[aws-sdk-rust]]
message = "HTTP connector configuration has changed significantly. See the [upgrade guidance](https://github.com/awslabs/smithy-rs/discussions/3022) for details."
references = ["smithy-rs#3011"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
message = "It's now possible to nest runtime components with the `RuntimePlugin` trait. A `current_components` argument was added to the `runtime_components` method so that components configured from previous runtime plugins can be referenced in the current runtime plugin. Ordering of runtime plugins was also introduced via a new `RuntimePlugin::order` method."
references = ["smithy-rs#2909"]
Expand Down
15 changes: 5 additions & 10 deletions aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

[features]
client-hyper = ["aws-smithy-client/client-hyper", "aws-smithy-runtime/connector-hyper"]
rustls = ["aws-smithy-client/rustls", "client-hyper"]
native-tls = []
client-hyper = ["aws-smithy-runtime/connector-hyper-0-14-x"]
rustls = ["aws-smithy-runtime/tls-rustls", "client-hyper"]
allow-compilation = [] # our tests use `cargo test --all-features` and native-tls breaks CI
rt-tokio = ["aws-smithy-async/rt-tokio", "tokio/rt"]
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/rt"]
credentials-sso = ["dep:aws-sdk-sso", "dep:ring", "dep:hex", "dep:zeroize"]

default = ["client-hyper", "rustls", "rt-tokio", "credentials-sso"]
Expand All @@ -23,9 +22,7 @@ aws-credential-types = { path = "../../sdk/build/aws-sdk/sdk/aws-credential-type
aws-http = { path = "../../sdk/build/aws-sdk/sdk/aws-http" }
aws-sdk-sts = { path = "../../sdk/build/aws-sdk/sdk/sts", default-features = false }
aws-smithy-async = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-async" }
aws-smithy-client = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-client", default-features = false }
aws-smithy-http = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http" }
aws-smithy-http-tower = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http-tower" }
aws-smithy-json = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-json" }
aws-smithy-runtime = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] }
aws-smithy-runtime-api = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["client"] }
Expand All @@ -42,7 +39,6 @@ fastrand = "2.0.0"

bytes = "1.1.0"
http = "0.2.4"
tower = { version = "0.4.8" }

# implementation detail of SSO credential caching
aws-sdk-sso = { path = "../../sdk/build/aws-sdk/sdk/sso", default-features = false, optional = true }
Expand All @@ -51,7 +47,7 @@ hex = { version = "0.4.3", optional = true }
zeroize = { version = "1", optional = true }

[dev-dependencies]
aws-smithy-runtime = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] }
aws-smithy-runtime = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x", "test-util"] }
futures-util = { version = "0.3.16", default-features = false }
tracing-test = "0.2.1"
tracing-subscriber = { version = "0.3.16", features = ["fmt", "json"] }
Expand All @@ -66,11 +62,10 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"

aws-credential-types = { path = "../../sdk/build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] }
aws-smithy-client = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-client", features = ["test-util", "rt-tokio", "client-hyper"] }

# used for a usage example
hyper-rustls = { version = "0.24", features = ["webpki-tokio", "http2", "http1"] }
aws-smithy-async = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-async", features = ["test-util"] }
aws-smithy-async = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-async", features = ["rt-tokio", "test-util"] }

[package.metadata.docs.rs]
all-features = true
Expand Down
12 changes: 6 additions & 6 deletions aws/rust-runtime/aws-config/external-types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ allowed_external_types = [
"aws_credential_types::provider::SharedCredentialsProvider",
"aws_sdk_sts::types::_policy_descriptor_type::PolicyDescriptorType",
"aws_smithy_async::rt::sleep::AsyncSleep",
"aws_smithy_async::rt::sleep::SharedAsyncSleep",
"aws_smithy_async::time::SharedTimeSource",
"aws_smithy_async::time::TimeSource",
"aws_smithy_client::bounds::SmithyConnector",
"aws_smithy_client::conns::default_connector::default_connector",
"aws_smithy_client::erase::DynConnector",
"aws_smithy_client::erase::boxclone::BoxCloneService",
"aws_smithy_client::http_connector::ConnectorSettings",
"aws_smithy_client::http_connector::HttpConnector",
"aws_smithy_http::body::SdkBody",
"aws_smithy_http::endpoint",
"aws_smithy_http::endpoint::error::InvalidEndpointError",
"aws_smithy_http::result::SdkError",
"aws_smithy_runtime_api::client::dns::DnsResolver",
"aws_smithy_runtime_api::client::dns::SharedDnsResolver",
"aws_smithy_runtime_api::client::http::HttpClient",
"aws_smithy_runtime_api::client::http::SharedHttpClient",
"aws_smithy_types::retry",
"aws_smithy_types::retry::*",
"aws_smithy_types::timeout",
Expand Down
32 changes: 0 additions & 32 deletions aws/rust-runtime/aws-config/src/connector.rs

This file was deleted.

10 changes: 5 additions & 5 deletions aws/rust-runtime/aws-config/src/default_provider/app_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod tests {
use super::*;
use crate::profile::profile_file::{ProfileFileKind, ProfileFiles};
use crate::provider_config::ProviderConfig;
use crate::test_case::{no_traffic_connector, InstantSleep};
use crate::test_case::{no_traffic_client, InstantSleep};
use aws_types::os_shim_internal::{Env, Fs};

#[tokio::test]
Expand All @@ -105,7 +105,7 @@ mod tests {
&ProviderConfig::no_configuration()
.with_fs(fs)
.with_env(env)
.with_http_connector(no_traffic_connector()),
.with_http_client(no_traffic_client()),
)
.app_name()
.await;
Expand All @@ -120,7 +120,7 @@ mod tests {
let conf = crate::from_env()
.sleep_impl(InstantSleep)
.fs(fs)
.http_connector(no_traffic_connector())
.http_client(no_traffic_client())
.profile_name("custom")
.profile_files(
ProfileFiles::builder()
Expand All @@ -141,7 +141,7 @@ mod tests {
&ProviderConfig::empty()
.with_fs(fs)
.with_env(env)
.with_http_connector(no_traffic_connector()),
.with_http_client(no_traffic_client()),
)
.app_name()
.await;
Expand All @@ -158,7 +158,7 @@ mod tests {
&ProviderConfig::empty()
.with_fs(fs)
.with_env(env)
.with_http_connector(no_traffic_connector()),
.with_http_client(no_traffic_client()),
)
.app_name()
.await;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod test {
/// make_test!(live: test_name)
/// ```
macro_rules! make_test {
($name: ident $(#[$m:meta])*) => {
jdisanti marked this conversation as resolved.
Show resolved Hide resolved
($name:ident $(#[$m:meta])*) => {
make_test!($name, execute, $(#[$m])*);
};
(update: $name:ident) => {
Expand All @@ -235,13 +235,13 @@ mod test {
(live: $name:ident) => {
make_test!($name, execute_from_live_traffic);
};
($name: ident, $func: ident, $(#[$m:meta])*) => {
($name:ident, $func:ident, $(#[$m:meta])*) => {
make_test!($name, $func, std::convert::identity $(, #[$m])*);
};
($name: ident, builder: $provider_config_builder: expr) => {
($name:ident, builder: $provider_config_builder:expr) => {
make_test!($name, execute, $provider_config_builder);
};
($name: ident, $func: ident, $provider_config_builder: expr $(, #[$m:meta])*) => {
($name:ident, $func:ident, $provider_config_builder:expr $(, #[$m:meta])*) => {
$(#[$m])*
#[tokio::test]
async fn $name() {
Expand Down Expand Up @@ -335,14 +335,14 @@ mod test {
use crate::provider_config::ProviderConfig;
use aws_credential_types::provider::error::CredentialsError;
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_client::erase::boxclone::BoxCloneService;
use aws_smithy_client::never::NeverConnected;
use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
use aws_smithy_runtime::client::http::test_util::NeverTcpConnector;

tokio::time::pause();
let conf = ProviderConfig::no_configuration()
.with_tcp_connector(BoxCloneService::new(NeverConnected::new()))
jdisanti marked this conversation as resolved.
Show resolved Hide resolved
.with_http_client(HyperClientBuilder::new().build(NeverTcpConnector::new()))
.with_time_source(StaticTimeSource::new(UNIX_EPOCH))
.with_sleep(TokioSleep::new());
.with_sleep_impl(TokioSleep::new());
let provider = DefaultCredentialsChain::builder()
.configure(conf)
.build()
Expand Down
Loading
Loading