Skip to content

Commit

Permalink
Move checksum configs to aws_smithy_types
Browse files Browse the repository at this point in the history
Update codegen to point to new checksum config
  • Loading branch information
landonxjames committed Sep 22, 2024
1 parent 883e5c4 commit 3175d0c
Show file tree
Hide file tree
Showing 22 changed files with 189 additions and 230 deletions.
3 changes: 1 addition & 2 deletions aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 2 additions & 61 deletions aws/rust-runtime/aws-config/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ 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"] }
aws-smithy-types = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-types" }
aws-smithy-checksums = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-checksums" }
aws-types = { path = "../../sdk/build/aws-sdk/sdk/aws-types" }
bytes = "1.1.0"
http = "0.2.4"
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-config/external-types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ allowed_external_types = [
"aws_smithy_async::rt::sleep::SharedAsyncSleep",
"aws_smithy_async::time::SharedTimeSource",
"aws_smithy_async::time::TimeSource",
"aws_smithy_checksums::RequestChecksumCalculation",
"aws_smithy_checksums::ResponseChecksumValidation",
"aws_smithy_runtime::client::identity::cache::IdentityCache",
"aws_smithy_runtime::client::identity::cache::lazy::LazyCacheBuilder",
"aws_smithy_runtime_api::box_error::BoxError",
Expand All @@ -36,6 +34,8 @@ allowed_external_types = [
"aws_smithy_runtime_api::client::result::SdkError",
"aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig",
"aws_smithy_types::body::SdkBody",
"aws_smithy_types::checksum_config::RequestChecksumCalculation",
"aws_smithy_types::checksum_config::ResponseChecksumValidation",
"aws_smithy_types::retry",
"aws_smithy_types::retry::*",
"aws_smithy_types::timeout",
Expand Down
5 changes: 3 additions & 2 deletions aws/rust-runtime/aws-config/src/default_provider/checksums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ mod test {
#[allow(deprecated)]
use crate::profile::profile_file::{ProfileFileKind, ProfileFiles};
use crate::provider_config::ProviderConfig;
use aws_smithy_checksums::ResponseChecksumValidation;
use aws_smithy_types::checksum_config::{
RequestChecksumCalculation, ResponseChecksumValidation,
};
use aws_types::os_shim_internal::{Env, Fs};
use aws_types::sdk_config::RequestChecksumCalculation;
use tracing_test::traced_test;

#[tokio::test]
Expand Down
4 changes: 3 additions & 1 deletion aws/rust-runtime/aws-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ mod loader {
use aws_credential_types::Credentials;
use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep};
use aws_smithy_async::time::{SharedTimeSource, TimeSource};
use aws_smithy_checksums::{RequestChecksumCalculation, ResponseChecksumValidation};
use aws_smithy_runtime::client::identity::IdentityCache;
use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
use aws_smithy_runtime_api::client::http::HttpClient;
use aws_smithy_runtime_api::client::identity::{ResolveCachedIdentity, SharedIdentityCache};
use aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::checksum_config::{
RequestChecksumCalculation, ResponseChecksumValidation,
};
use aws_smithy_types::retry::RetryConfig;
use aws_smithy_types::timeout::TimeoutConfig;
use aws_types::app_name::AppName;
Expand Down
3 changes: 2 additions & 1 deletion aws/rust-runtime/aws-inlineable/src/http_request_checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use aws_runtime::content_encoding::{AwsChunkedBody, AwsChunkedBodyOptions};
use aws_runtime::{auth::SigV4OperationSigningConfig, content_encoding::header_value::AWS_CHUNKED};
use aws_sigv4::http_request::SignableBody;
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_checksums::{body::calculate, http::HttpChecksum};
use aws_smithy_checksums::{ChecksumAlgorithm, RequestChecksumCalculation};
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeSerializationInterceptorContextRef, BeforeTransmitInterceptorContextMut, Input,
Expand All @@ -20,6 +20,7 @@ use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::checksum_config::RequestChecksumCalculation;
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
use aws_smithy_types::error::operation::BuildError;
use http::HeaderValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

//! Interceptor for handling Smithy `@httpChecksum` response checksumming

use aws_smithy_checksums::{ChecksumAlgorithm, ResponseChecksumValidation};
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeDeserializationInterceptorContextMut, BeforeSerializationInterceptorContextMut, Input,
Expand All @@ -16,6 +16,7 @@ use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::http::Headers;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::checksum_config::ResponseChecksumValidation;
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
use std::{fmt, mem};

Expand Down
1 change: 0 additions & 1 deletion aws/rust-runtime/aws-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", optional = true }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-checksums = {path = "../../../rust-runtime/aws-smithy-checksums"}
tracing = "0.1"
# cargo does not support optional test dependencies, so to completely disable rustls
# we need to add the webpki-roots feature here.
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-types/external-types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ allowed_external_types = [
"aws_smithy_async::rt::sleep::SharedAsyncSleep",
"aws_smithy_async::time::SharedTimeSource",
"aws_smithy_async::time::TimeSource",
"aws_smithy_checksums::ResponseChecksumValidation",
"aws_smithy_checksums::RequestChecksumCalculation",
"aws_smithy_runtime_api::client::behavior_version::BehaviorVersion",
"aws_smithy_runtime_api::client::http::HttpClient",
"aws_smithy_runtime_api::client::http::SharedHttpClient",
"aws_smithy_runtime_api::client::identity::ResolveCachedIdentity",
"aws_smithy_runtime_api::client::identity::SharedIdentityCache",
"aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig",
"aws_smithy_runtime_api::http::headers::Headers",
"aws_smithy_types::checksum_config::ResponseChecksumValidation",
"aws_smithy_types::checksum_config::RequestChecksumCalculation",
"aws_smithy_types::config_bag::storable::Storable",
"aws_smithy_types::config_bag::storable::StoreReplace",
"aws_smithy_types::config_bag::storable::Storer",
Expand Down
8 changes: 5 additions & 3 deletions aws/rust-runtime/aws-types/src/sdk_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ pub use aws_credential_types::provider::SharedCredentialsProvider;
use aws_smithy_async::rt::sleep::AsyncSleep;
pub use aws_smithy_async::rt::sleep::SharedAsyncSleep;
pub use aws_smithy_async::time::{SharedTimeSource, TimeSource};
pub use aws_smithy_checksums::{RequestChecksumCalculation, ResponseChecksumValidation};
use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
use aws_smithy_runtime_api::client::http::HttpClient;
pub use aws_smithy_runtime_api::client::http::SharedHttpClient;
use aws_smithy_runtime_api::client::identity::{ResolveCachedIdentity, SharedIdentityCache};
pub use aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
use aws_smithy_runtime_api::shared::IntoShared;
pub use aws_smithy_types::checksum_config::{
RequestChecksumCalculation, ResponseChecksumValidation,
};
pub use aws_smithy_types::retry::RetryConfig;
pub use aws_smithy_types::timeout::TimeoutConfig;
use std::collections::HashMap;
Expand Down Expand Up @@ -183,7 +185,7 @@ impl Builder {
/// # Examples
/// ```
/// use aws_types::SdkConfig;
/// use aws_smithy_checksums::RequestChecksumCalculation;
/// use aws_smithy_types::checksum_config::RequestChecksumCalculation;
/// let config = SdkConfig::builder().request_checksum_calculation(RequestChecksumCalculation::WhenSupported).build();
/// ```
pub fn request_checksum_calculation(
Expand All @@ -207,7 +209,7 @@ impl Builder {
/// # Examples
/// ```
/// use aws_types::SdkConfig;
/// use aws_smithy_checksums::ResponseChecksumValidation;
/// use aws_smithy_types::checksum_config::ResponseChecksumValidation;
/// let config = SdkConfig::builder().response_checksum_validation(ResponseChecksumValidation::WhenSupported).build();
/// ```
pub fn response_checksum_validation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ class HttpRequestChecksumConfigCustomization(private val codegenContext: ClientC
*preludeScope,
"RequestChecksumCalculation" to
configReexport(
RuntimeType.smithyChecksums(rc)
.resolve("RequestChecksumCalculation"),
RuntimeType.smithyTypes(rc)
.resolve("checksum_config::RequestChecksumCalculation"),
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class HttpRequestChecksumMutationInterceptorGenerator : ClientCodegenDecorator {
"Error" to interceptors.resolve("context::Error"),
"RuntimeComponents" to RuntimeType.runtimeComponents(rc),
"RequestChecksumCalculation" to
CargoDependency.smithyChecksums(rc).toType()
.resolve("RequestChecksumCalculation"),
CargoDependency.smithyTypes(rc).toType()
.resolve("checksum_config::RequestChecksumCalculation"),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ class HttpResponseChecksumConfigCustomization(private val codegenContext: Client
*preludeScope,
"ResponseChecksumValidation" to
configReexport(
RuntimeType.smithyChecksums(rc)
.resolve("ResponseChecksumValidation"),
RuntimeType.smithyTypes(rc)
.resolve("checksum_config::ResponseChecksumValidation"),
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class HttpResponseChecksumMutationInterceptorGenerator : ClientCodegenDecorator
"Error" to interceptors.resolve("context::Error"),
"RuntimeComponents" to RuntimeType.runtimeComponents(rc),
"ResponseChecksumValidation" to
CargoDependency.smithyChecksums(rc).toType()
.resolve("ResponseChecksumValidation"),
CargoDependency.smithyTypes(rc).toType()
.resolve("checksum_config::ResponseChecksumValidation"),
)
}

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-checksums/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-smithy-checksums"
version = "0.60.13"
version = "0.62.0"
authors = [
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
"Zelda Hessler <zhessler@amazon.com>",
Expand Down
2 changes: 0 additions & 2 deletions rust-runtime/aws-smithy-checksums/external-types.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
allowed_external_types = [
"aws_smithy_types::body::SdkBody",
"aws_smithy_types::config_bag::storable::StoreReplace",
"aws_smithy_types::config_bag::storable::Storable",
"bytes::bytes::Bytes",
"http::header::map::HeaderMap",
"http::header::name::HeaderName",
Expand Down
Loading

0 comments on commit 3175d0c

Please sign in to comment.