Skip to content

Commit 5864ef3

Browse files
DavidSoutherford-at-aws
authored andcommitted
Rust: Update for SDK HttpConnector changes. (#5483)
* Rust: Update for SDK HttpConnector changes. * Fix wasm connector * Update from TestConnector to StaticReplayClient * Remove deprecated aws-smithy-client * Final refactor fo run_all.sh
1 parent afe90c7 commit 5864ef3

File tree

27 files changed

+107
-216
lines changed

27 files changed

+107
-216
lines changed

rust_dev_preview/cross_service/photo_asset_management/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "
1919
aws-sdk-rekognition = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2020
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2121
aws-sdk-sns = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
22-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
23-
"test-util",
24-
] }
2522
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
23+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2624
aws-smithy-types-convert ={ git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["convert-chrono"] }
2725
aws_lambda_events = { version = "0.10.0", features = ["s3", "apigw"], default-features = false }
2826
bytes = "1.4.0"
@@ -35,6 +33,7 @@ lambda_runtime = "0.8.0"
3533
miniz_oxide = "0.7.1"
3634
pin-project = "1.0.12"
3735
pipe = "0.4.0"
36+
sdk-examples-test-utils = { path = "../../test-utils" }
3837
serde = { version = "1.0.159", features = ["derive"] }
3938
serde_json = "1.0.95"
4039
streaming-zip = "0.5.0"

rust_dev_preview/cross_service/photo_asset_management/src/handlers/labels.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ pub async fn handler(
104104

105105
#[cfg(test)]
106106
mod test {
107+
use sdk_examples_test_utils::single_shot_client;
107108
use serde_json::json;
108109

109-
use crate::single_shot_client;
110-
111110
use super::{get_labels, Labels};
112111

113112
#[tokio::test]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pub mod chunked_uploader;
22
pub mod common;
33
pub mod handlers;
4-
pub mod test_utils;
54
pub mod uploader;

rust_dev_preview/cross_service/photo_asset_management/src/test_utils/macros.rs

Lines changed: 0 additions & 103 deletions
This file was deleted.

rust_dev_preview/cross_service/photo_asset_management/src/test_utils/mod.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

rust_dev_preview/cross_service/rest_ses/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"
1818
aws-sdk-cloudwatchlogs = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1919
aws-sdk-rdsdata = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2020
aws-sdk-ses = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
21+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2122
chrono = { version = "0.4.22", default-features = false, features = [
2223
"clock",
2324
"serde",
@@ -44,7 +45,7 @@ uuid = { version = "1.2.1", features = ["v4", "serde"] }
4445
xlsxwriter = "0.6.0"
4546

4647
[dev-dependencies]
47-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["test-util"] }
48+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
4849
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
4950
fake = { version = "2.5.0", features = ["uuid"] }
5051
once_cell = "1.15.0"

rust_dev_preview/cross_service/rest_ses/src/client.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,20 @@ impl RdsClient {
6464

6565
#[cfg(test)]
6666
mod rds_client_for_test {
67-
use aws_smithy_http::body::SdkBody;
67+
use aws_smithy_runtime::client::http::test_util::ReplayEvent;
6868
use secrecy::Secret;
6969

7070
use super::RdsClient;
7171
impl RdsClient {
72-
pub fn for_test(
73-
pairs: Vec<(
74-
http::request::Request<SdkBody>,
75-
http::response::Response<SdkBody>,
76-
)>,
77-
) -> Self {
72+
pub fn for_test(pairs: Vec<ReplayEvent>) -> Self {
7873
RdsClient {
7974
client: aws_sdk_rdsdata::Client::from_conf(
8075
sdk_examples_test_utils::client_config!(aws_sdk_rdsdata)
81-
.http_connector(aws_smithy_client::test_connection::TestConnection::new(
82-
pairs,
83-
))
76+
.http_client(
77+
aws_smithy_runtime::client::http::test_util::StaticReplayClient::new(
78+
pairs,
79+
),
80+
)
8481
.build(),
8582
),
8683
secret_arn: Secret::from("secret".to_string()),

rust_dev_preview/examples/cognitoidentity/src/bin/describe-identity-pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ async fn describe_pool(client: &Client, id: &str) -> Result<(), Error> {
6464
println!(" value: {}", value);
6565
}
6666

67-
let open_id_arns = response.open_id_connect_provider_ar_ns();
67+
let open_id_arns = response.open_id_connect_provider_arns();
6868
println!(" Open ID provider ARNs:");
6969
for arn in open_id_arns {
7070
println!(" {}", arn);
7171
}
7272

73-
let saml_arns = response.saml_provider_ar_ns();
73+
let saml_arns = response.saml_provider_arns();
7474
println!(" SAML provider ARNs:");
7575
for arn in saml_arns {
7676
println!(" {}", arn);

rust_dev_preview/examples/custom-root-certificates/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ description = "An example demonstrating setting a custom root certificate with r
88

99
[dependencies]
1010
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
11-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1211
# bringing our own HTTPs so no need for the default features
1312
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", default-features = false }
1413
tokio = { version = "1.21.2", features = ["full"] }

rust_dev_preview/examples/dynamodb/Cargo.toml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,24 @@ edition = "2021"
1212

1313
[dependencies]
1414
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
15-
aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1615
aws-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
17-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
18-
"client-hyper",
19-
"rustls",
20-
"rt-tokio",
21-
] }
22-
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
23-
"rt-tokio",
24-
] }
16+
aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
17+
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [ "rt-tokio", ] }
18+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["test-util"] }
2519
aws-smithy-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2620
axum = "0.5.16"
27-
http = "0.2.5"
21+
clap = { version = "~4.2", features = ["derive"] }
2822
futures = "0.3"
23+
http = "0.2.5"
2924
log = "0.4.17"
3025
rand = "0.8.3"
3126
sdk-examples-test-utils = { path = "../../test-utils" }
3227
serde = {version = "1.0", features = ["derive"]}
33-
serde_json = "1"
3428
serde_dynamo = { version = "4", features = ["aws-sdk-dynamodb+0_22"] }
35-
clap = { version = "~4.2", features = ["derive"] }
36-
tracing = "0.1"
29+
serde_json = "1"
3730
thiserror = "1.0"
3831
tokio = { version = "1.20.1", features = ["full"] }
3932
tokio-stream = "0.1.8"
4033
tower-http = { version = "0.3.0", features = ["cors"] }
41-
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
34+
tracing = "0.1"
35+
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }

0 commit comments

Comments
 (0)