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

Remove deprecations from rust-runtime #3222

Merged
merged 8 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
22 changes: 21 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,24 @@
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"
# author = "rcoh"

[[smithy-rs]]
message = """
Types/functions that were deprecated in previous releases were removed. Unfortunately, some of these deprecations
were ignored by the Rust compiler (we found out later that `#[deprecated]` on `pub use` doesn't work). See
the [deprecations removal list](https://github.com/smithy-lang/smithy-rs/discussions/3223) for more details.
"""
references = ["smithy-rs#3222"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "jdisanti"

[[aws-sdk-rust]]
message = """
Types/functions that were deprecated in previous releases were removed. Unfortunately, some of these deprecations
were ignored by the Rust compiler (we found out later that `#[deprecated]` on `pub use` doesn't work). See
the [deprecations removal list](https://github.com/smithy-lang/smithy-rs/discussions/3223) for more details.
"""
references = ["smithy-rs#3222"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"
46 changes: 0 additions & 46 deletions aws/rust-runtime/aws-config/src/environment/app_name.rs

This file was deleted.

3 changes: 0 additions & 3 deletions aws/rust-runtime/aws-config/src/environment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

//! Providers that load configuration from environment variables

/// Load app name from the environment
pub mod app_name;

use std::error::Error;
use std::fmt::{Display, Formatter};

Expand Down
43 changes: 0 additions & 43 deletions aws/rust-runtime/aws-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,6 @@ mod loader {
self
}

/// Deprecated. Don't use.
#[deprecated(
note = "HTTP connector configuration changed. See https://github.com/smithy-lang/smithy-rs/discussions/3022 for upgrade guidance."
)]
pub fn http_connector(self, http_client: impl HttpClient + 'static) -> Self {
self.http_client(http_client)
}

/// Override the [`HttpClient`](aws_smithy_runtime_api::client::http::HttpClient) for this [`ConfigLoader`].
///
/// The HTTP client will be used for both AWS services and credentials providers.
Expand Down Expand Up @@ -396,14 +388,6 @@ mod loader {
self
}

/// The credentials cache has been replaced. Use the identity_cache() method instead. See its rustdoc for an example.
#[deprecated(
note = "The credentials cache has been replaced. Use the identity_cache() method instead for equivalent functionality. See its rustdoc for an example."
)]
pub fn credentials_cache(self) -> Self {
self
}

/// Override the identity cache used to build [`SdkConfig`](aws_types::SdkConfig).
///
/// The identity cache caches AWS credentials and SSO tokens. By default, a lazy cache is used
Expand Down Expand Up @@ -611,33 +595,6 @@ mod loader {
self
}

/// Set configuration for all sub-loaders (credentials, region etc.)
///
/// Update the `ProviderConfig` used for all nested loaders. This can be used to override
/// the HTTPs connector used by providers or to stub in an in memory `Env` or `Fs` for testing.
///
/// # Examples
/// ```no_run
/// # #[cfg(feature = "hyper-client")]
/// # async fn create_config() {
/// use aws_config::provider_config::ProviderConfig;
/// let custom_https_connector = hyper_rustls::HttpsConnectorBuilder::new()
/// .with_webpki_roots()
/// .https_only()
/// .enable_http1()
/// .build();
/// let provider_config = ProviderConfig::default().with_tcp_connector(custom_https_connector);
/// let shared_config = aws_config::defaults(BehaviorVersion::latest()).configure(provider_config).load().await;
/// # }
/// ```
#[deprecated(
note = "Use setters on this builder instead. configure is very hard to use correctly."
)]
pub fn configure(mut self, provider_config: ProviderConfig) -> Self {
self.provider_config = Some(provider_config);
self
}

/// Load the default configuration chain
///
/// If fields have been overridden during builder construction, the override values will be used.
Expand Down
106 changes: 0 additions & 106 deletions aws/rust-runtime/aws-config/src/profile/app_name.rs

This file was deleted.

1 change: 0 additions & 1 deletion aws/rust-runtime/aws-config/src/profile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub use parser::ProfileParseError;
#[doc(inline)]
pub use parser::{load, Profile, ProfileFileLoadError, ProfileSet, Property};

pub mod app_name;
pub mod credentials;
pub mod profile_file;
pub mod region;
Expand Down
8 changes: 0 additions & 8 deletions aws/rust-runtime/aws-config/src/provider_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,6 @@ impl ProviderConfig {
}
}

/// Deprecated. Don't use.
#[deprecated(
note = "HTTP connector configuration changed. See https://github.com/smithy-lang/smithy-rs/discussions/3022 for upgrade guidance."
)]
pub fn with_tcp_connector(self, http_client: impl HttpClient + 'static) -> Self {
self.with_http_client(http_client)
}

/// Override the HTTP client for this configuration
pub fn with_http_client(self, http_client: impl HttpClient + 'static) -> Self {
ProviderConfig {
Expand Down
15 changes: 2 additions & 13 deletions aws/rust-runtime/aws-inlineable/src/s3_request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

use aws_smithy_runtime_api::client::result::SdkError;
use aws_smithy_runtime_api::http::{Headers, Response};
use aws_smithy_types::error::metadata::{
Builder as ErrorMetadataBuilder, ErrorMetadata, ProvideErrorMetadata,
};
#[allow(deprecated)]
use aws_smithy_types::error::Unhandled;
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};

const EXTENDED_REQUEST_ID: &str = "s3_extended_request_id";

Expand Down Expand Up @@ -37,13 +33,6 @@ impl RequestIdExt for ErrorMetadata {
}
}

#[allow(deprecated)]
impl RequestIdExt for Unhandled {
fn extended_request_id(&self) -> Option<&str> {
self.meta().extended_request_id()
}
}

impl<B> RequestIdExt for Response<B> {
fn extended_request_id(&self) -> Option<&str> {
self.headers().extended_request_id()
Expand Down Expand Up @@ -92,7 +81,7 @@ mod test {
fn handle_missing_header() {
let resp =
Response::try_from(http::Response::builder().status(400).body("").unwrap()).unwrap();
let mut builder = aws_smithy_types::Error::builder().message("123");
let mut builder = ErrorMetadata::builder().message("123");
builder = apply_extended_request_id(builder, resp.headers());
assert_eq!(builder.build().extended_request_id(), None);
}
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-runtime/src/retries/classifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ mod test {
#[test]
fn classify_generic() {
let policy = AwsErrorCodeClassifier::<ErrorMetadata>::new();
let err = aws_smithy_types::Error::builder().code("SlowDown").build();
let err = ErrorMetadata::builder().code("SlowDown").build();
let test_response = http::Response::new("OK").map(SdkBody::from);

let mut ctx = InterceptorContext::new(Input::doesnt_matter());
Expand All @@ -180,7 +180,7 @@ mod test {
#[test]
fn test_retry_after_header() {
let policy = AwsErrorCodeClassifier::<ErrorMetadata>::new();
let err = aws_smithy_types::Error::builder().code("SlowDown").build();
let err = ErrorMetadata::builder().code("SlowDown").build();
let res = http::Response::builder()
.header("x-amz-retry-after", "5000")
.body("retry later")
Expand Down
14 changes: 0 additions & 14 deletions aws/rust-runtime/aws-types/src/config.rs

This file was deleted.

14 changes: 1 addition & 13 deletions aws/rust-runtime/aws-types/src/request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
use aws_smithy_runtime_api::client::result::SdkError;
use aws_smithy_runtime_api::http::Headers;
use aws_smithy_runtime_api::http::Response;
use aws_smithy_types::error::metadata::{
Builder as ErrorMetadataBuilder, ErrorMetadata, ProvideErrorMetadata,
};

#[allow(deprecated)]
use aws_smithy_types::error::Unhandled;
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};

/// Constant for the [`ErrorMetadata`] extra field that contains the request ID
const AWS_REQUEST_ID: &str = "aws_request_id";
Expand All @@ -40,13 +35,6 @@ impl RequestId for ErrorMetadata {
}
}

#[allow(deprecated)]
impl RequestId for Unhandled {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}

impl<B> RequestId for Response<B> {
fn request_id(&self) -> Option<&str> {
self.headers().request_id()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use aws_sdk_dynamodb::operation::query::QueryOutput;
use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
use aws_smithy_runtime_api::client::ser_de::{ResponseDeserializer, SharedResponseDeserializer};
use aws_smithy_runtime_api::client::ser_de::{DeserializeResponse, SharedResponseDeserializer};
use aws_smithy_types::body::SdkBody;
use criterion::{criterion_group, criterion_main, Criterion};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use aws_sdk_dynamodb::operation::put_item::{PutItem, PutItemInput};
use aws_sdk_dynamodb::types::AttributeValue;
use aws_smithy_runtime_api::client::interceptors::context::Input;
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
use aws_smithy_runtime_api::client::ser_de::{RequestSerializer, SharedRequestSerializer};
use aws_smithy_runtime_api::client::ser_de::{SerializeRequest, SharedRequestSerializer};
use aws_smithy_types::config_bag::ConfigBag;
use criterion::{criterion_group, criterion_main, Criterion};

Expand Down
Loading
Loading