New this release:
- (client) Bump crc-fast version to 1.6.0
- (client) Validate
Regionis a valid host label when constructing endpoints.
Breaking Changes:
-
⚠️ 🎉 (server, smithy-rs#4356) Parse EventStream signed-frames for servers marked with@sigv4.This is a breaking change, because events from SigV4 services are wrapped in a SignedEvent frame.
-
⚠️ (all, smithy-rs#4367) Upgrade MSRV to Rust 1.88.0.
New this release:
-
🐛🎉 (server, smithy-rs#4352, smithy-rs#4345) Update smithy-rs servers to support sending
initial-responseevents over event streams.Prior to this change, event streams that had initial responses were unsupported. This change also adds a new codegen setting,
alwaysSendEventStreamInitialResponse.When this setting is set to
true, the generated server will unconditionally sendinitial-responseobjects, even when empty. This is required for compatibility with smithy-java as well as a few other clients.This setting defaults to false currently because smithy-rs based clients do not currently support this behavior.
"codegen": { "alwaysSendEventStreamInitialResponse": true // default false }
-
🎉 (all, @arielby) Include the protocol name in
package.metadata.smithy.protocolinCargo.tomlto allow easily figuring out which protocol was used to generate a crate. -
🐛🎉 (client, smithy-rs#4349, @arielby) Make Hyper idle pool timeout configurable, and fix the bug where pool timeouts would not work if the client was built directly.
-
🎉 (server, smithy-rs#4317, @jasgin) Adds validators and codegen support for the custom traits custom traits
@validationException,@validationMessage,@validationFieldList,@validationFieldName, and@validationFieldMessagefor defining a custom validation exception to use instead ofsmithy.framework#ValidationException. -
🐛 (client, smithy-rs#4346) Fix bug where httpQueryParams were silently dropped when no other query parameters were modeled.
-
🐛 (server, smithy-rs#4344, smithy-rs#4325) Fix bug where servers did not attempt to parse an
initial-request.initial-requestsmay be sent by clients both when they would contain valid data and when they are empty. -
🐛 (client, smithy-rs#4352, smithy-rs#4353) Update clients to allow
initial-responseevents to be accepted on event streams, even when know modeled initial response exists.This is required for spec compliance, backwards compatibility, and compatibility with non-smithy-rs based servers that MAY unconditionally send
initial-responsemessages. -
🐛 (client, smithy-rs#4265, smithy-rs#4189) Adds new
with_test_defaults_v2()for all clients supporting region configuration which appliesus-east-1as default region if not set by user. This allowsaws-smithy-mocksto work for non AWS SDK generated clients. Also clarifytest-utilfeature requirement when usingaws-smithy-mocks.
Contributors Thank you for your contributions! ❤
- @arielby (smithy-rs#4349)
- @jasgin (smithy-rs#4317)
New this release:
- 🎉 (server, smithy-rs#4321, @jasgin) Adds the custom traits
@validationException,@validationMessage,@validationFieldList,@validationFieldName, and@validationFieldMessagefor defining custom validation exceptions.
Contributors Thank you for your contributions! ❤
- @jasgin (smithy-rs#4321)
New this release:
-
🐛 (server) Fix bug where servers rejected
application/vnd.amazon.evenstreamACCEPT header for RPCv2CborThis change allows this header while also allowing
application/cborfor backwards compatibility.
New this release:
- 🎉 (client, smithy-rs#4299, @greenwoodcm) Added a new
then_compute_outputtoaws-smithy-mocksrule builder that allows using the input type when computing a mocked response, e.g.// Return a computed output based on the input let compute_rule = mock!(Client::get_object) .then_compute_output(|req| { let key = req.key().unwrap_or("unknown"); GetObjectOutput::builder() .body(ByteStream::from_static(format!("content for {}", key).as_bytes())) .build() });
- 🐛 (client, smithy-rs#4226, @haydenbaker) Fixed problematic assertion on HttpApiKeyAuthTrait
scheme, which was causing client-codegen to fail when the correct settings for api-key based auth were set.
Contributors Thank you for your contributions! ❤
- @greenwoodcm (smithy-rs#4299)
- @haydenbaker (smithy-rs#4226)
New this release:
- 🐛 (client, smithy-rs#4274) The
HickoryDnsResolverandTokioDnsResolverwere notClonemaking it impossible to use them in the http_client builder'sbuild_with_resolvermethod.
New this release:
- 🎉 (client, smithy-rs#4274) Add a new crate,
aws-smithy-dnsthat contains aHickoryDnsResolver. This wraps ahickory_resolver::Resolverand provides some minimal configuration options (timeouts, retries, etc.) Instructions for overriding the DNS resolver on your HTTP client can be found in our documentation at https://docs.aws.amazon.com/sdk-for-rust/latest/dg/http.html#overrideDns - 🐛 (client, smithy-rs#4282) Set the
pool_timerfor the default Hyper client. This is required to allow thepool_idle_timeoutto work. Now idle connections will be released by the pool after 90 seconds. - (client, smithy-rs#4263) Make
TokenBucketandClientRateLimiterconfigurable throughRetryPartition.
New this release:
- 🎉 (client, aws-sdk-rust#169) Add support for proxy environment variables (
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY). Service clients will now automatically respect these proxy environment variables on the latestBehaviorVersion. Older behavior versions do not automatically detect these environment variables and will require manually building aaws_smithy_http_client::Connector` with a proxy config explicitly set to use this feature. - 🎉 (client, @WillChilds-Klein) Enable rustls post-quantum by default.
- (client) fix
aws-smithy-eventstreamfeaturederive-arbitraryonarbitrary>= 1.4.2
Contributors Thank you for your contributions! ❤
- @WillChilds-Klein
New this release:
- 🐛 (client) pin crc-fast to <1.4 to workaround SIGILL
New this release:
-
🎉 (client, smithy-rs#4208) Add the ability to insert
hints.mostly-unused = truein Cargo.toml. Enable this hint for the below crates:- aws-sdk-cloudformation
- aws-sdk-dynamodb
- aws-sdk-ec2
- aws-sdk-s3
- aws-sdk-sns
- aws-sdk-sqs
- aws-sdk-ssm
- aws-sdk-sts
See more information about this hint at https://blog.rust-lang.org/inside-rust/2025/07/15/call-for-testing-hint-mostly-unused/
-
🎉 (client, smithy-rs#4208, @joshtriplett) Enable
hints.mostly-unused = trueforaws-sdk-lambda(taking a release build from 57s to 40s) andaws-sdk-rds(taking a release build from 1m34s to 49s).
Contributors Thank you for your contributions! ❤
- @joshtriplett (smithy-rs#4208)
New this release:
- 🎉 (all, @Dorenavant) Add EnumSection to allow decorators to modify enum member attributes
- 🐛 (client, smithy-rs#4227) Fix canonical request sort order
Contributors Thank you for your contributions! ❤
- @Dorenavant
New this release:
- 🐛 (client, smithy-rs#4232) Add fallback equality on no auth
AuthSchemeIdfor backward compatibility, treatingAuthSchemeId::from("no_auth")(legacy) andAuthSchemeId::from("noAuth")(updated) as equivalent.
New this release:
- 🎉 (client, smithy-rs#4203) Add support for configuring auth schemes manually using an auth scheme preference list.
The preference list allows customers to reprioritize the order of auth schemes originally
determined by the auth scheme resolver.
Customers can configure the auth scheme preference at the following locations, listed in order of precedence:
- Service Client Configuration
use aws_runtime::auth::sigv4; use aws_smithy_runtime_api::client::auth::AuthSchemeId; use aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID; let config = aws_sdk_s3::Config::builder() .auth_scheme_preference([AuthSchemeId::from("scheme1"), sigv4::SCHEME_ID, HTTP_BEARER_AUTH_SCHEME_ID]) // ... .build();
- Environment Variable
AWS_AUTH_SCHEME_PREFERENCE=scheme1, sigv4, httpBearerAuth- Configuration File
With this configuration, the auth scheme resolver will prefer to select them in the specified order, if they are supported.auth_scheme_preference=scheme1, sigv4, httpBearerAuth
New this release:
- (all, smithy-rs#4212) Event streams now allocate a right-sized buffer avoiding repeated reallocations during serialization
New this release:
- (client) re-use checksums on retry attempts for enhanced durability
New this release:
- (client, smithy-rs#4076, smithy-rs#4198) Allows customers to configure the auth schemes and auth scheme resolver. For more information see the GitHub discussion.
New this release:
- 🐛 (client) Fix hyper 1.x connection refused errors not marked as retryable
- (client, smithy-rs#4186) Make Rpc V2 CBOR a compatible protocol for
awsQueryusingawsQueryCompatibletrait
Breaking Changes:
- 🐛
⚠️ (server) Fixed SmithyRpcV2CBOR Router to properly respect case in service names, preventing routing failures for services with mixed-case service shape ID.
New this release:
- 🐛 (client, smithy-rs#4165) Fix default supported protocols incorrectly ordered in
ClientProtocolLoader.
New this release:
- 🐛 (client, aws-sdk-rust#1272) Fix h2 GoAway errors not being retried by hyper legacy client
New this release:
-
🎉 (client, smithy-rs#4135) Introduce a new
repeatedly()function toaws-smithy-mockssequence builder to build mock rules that behave as an infinite sequence.let rule = mock!(aws_sdk_s3::Client::get_object) .sequence() .http_status(503, None) .times(2) // repeat the last output twice before moving onto the next response in the sequence .output(|| GetObjectOutput::builder() .body(ByteStream::from_static(b"success")) .build() ) .repeatedly() // repeat the last output forever .build();
-
🐛 (client, aws-sdk-rust#1291) Removing the
optimize_crc32_autofeature flag from thecrc-fastdependency of theaws-smithy-checksumscrate since it was causing build issues for some customers. -
🐛 (client, smithy-rs#4137) Fix bug with enum codegen
When the first enum generated has the
@sensitivetrait the opaque type underlying theUnknownVariantinherits that sensitivity. This means that it does not deriveDebug. Since the module is only generated once this causes a problem for non-sensitive enums that rely on the type derivingDebugso that they can also deriveDebug. We manually addDebugto the module so it will always be there since theUnknownVariantis not modeled and cannot be@sensitive. -
🐛 (client, smithy-rs#4135) fix simple rules behavior with
RuleMode::MatchAny
New this release:
- 🐛 (all, smithy-rs#4132) Smithy unions that contain members named "unknown" will now codegen correctly
- (all, smithy-rs#4105, @FalkWoldmann) Replace once_cell with std equivalents
Contributors Thank you for your contributions! ❤
- @FalkWoldmann (smithy-rs#4105)
Breaking Changes:
⚠️ (all, smithy-rs#4120) Update MSRV to 1.82.0
New this release:
-
🐛🎉 (client, smithy-rs#4074, smithy-rs#3926) Promote
aws-smithy-mocks-experimentaltoaws-smithy-mocks. This crate is now a recommended tool for testing generated SDK clients. This release includes several fixes as well as a new sequence builder API that can be used to test more complex scenarios such as retries.use aws_sdk_s3::operation::get_object::GetObjectOutput; use aws_sdk_s3::config::retry::RetryConfig; use aws_smithy_types::byte_stream::ByteStream; use aws_smithy_mocks::{mock, mock_client, RuleMode}; #[tokio::test] async fn test_retry_behavior() { // Create a rule that returns 503 twice, then succeeds let retry_rule = mock!(aws_sdk_s3::Client::get_object) .sequence() .http_status(503, None) .times(2) // Return 503 HTTP status twice .output(|| GetObjectOutput::builder() // Finally return a successful output .body(ByteStream::from_static(b"success")) .build()) .build(); // Create a mocked client with the rule let s3 = mock_client!( aws_sdk_s3, RuleMode::Sequential, [&retry_rule], |client_builder| { client_builder.retry_config(RetryConfig::standard().with_max_attempts(3)) } ); // This should succeed after two retries let result = s3 .get_object() .bucket("test-bucket") .key("test-key") .send() .await .expect("success after retries"); // Verify the response let data = result.body.collect().await.expect("successful read").to_vec(); assert_eq!(data, b"success"); // Verify all responses were used assert_eq!(retry_rule.num_calls(), 3); }
-
🐛 (all, smithy-rs#4117) Fix a bug where fields that were initially annotated with the
requiredtrait and later updated to use theaddedDefaulttrait were not serialized when their values matched the default, even when the values were explicitly set. With this fix, fields withaddedDefaultare now always serialized.
Breaking Changes:
⚠️ (client, smithy-rs#3776) AuthSchemeId no longer implements theCopytrait. This type has primarily been used by the Smithy code generator, so this change is not expected to affect users of SDKs.
New this release:
- (all, smithy-rs#4050, @FalkWoldmann) Replace the
once_cellcrate with thestdcounterpart in Smithy runtime crates. - (client) remove redundant span attributes and improve log output format
Contributors Thank you for your contributions! ❤
- @FalkWoldmann (smithy-rs#4050)
New this release:
- 🐛 (client, smithy-rs#4054) Fix traversal of operations bound to resources in several places including logic to determine if an event stream exists
- (client, smithy-rs#4052) Update spans to better align with spec.
New this release:
- (client, aws-sdk-rust#977, smithy-rs#1925, smithy-rs#3710) Updates the default HTTP client to be based on the 1.x version of hyper and updates the default TLS provider to rustls with aws-lc. For more information see the GitHub discussion.
New this release:
- 🎉 (client, smithy-rs#121) Adds support for event stream operations with non-REST protocols such as RPC v2 CBOR.
New this release:
- 🐛 (server) Fixed code generation failure that occurred when using
Resultas a shape name in Smithy models with constrained members by properly handling naming conflicts with Rust's built-in Result type - 🐛 (server) Previously, models would fail to generate when both the list and at least one of its members was directly constrained with documentation comments
New this release:
-
🐛🎉 (client, smithy-rs#3845) S3 client behavior is updated to always calculate a checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). The default checksum algorithm is CRC32. Checksum behavior can be configured using
when_supportedandwhen_requiredoptions - in shared config using request_checksum_calculation, or as env variable using AWS_REQUEST_CHECKSUM_CALCULATION.The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using
when_supportedandwhen_requiredoptions - in shared config using response_checksum_validation, or as env variable using AWS_RESPONSE_CHECKSUM_VALIDATION. -
🐛🎉 (client, smithy-rs#3967) Updates client generation to conform with Smithy's updates to the httpChecksum trait.
-
🐛 (client, aws-sdk-rust#1234) Fix token bucket not being set for standard and adaptive retry modes
New this release:
- 🐛 (server, smithy-rs#3890) Fix bug in
serdedecorator that generated non-compiling code on some models
Breaking Changes:
-
🐛
⚠️ (server, smithy-rs#3880) Unnamed enums now validate assigned values and will raise aConstraintViolationif an unknown variant is set.The following is an example of an unnamed enum:
@enum([ { value: "MONDAY" }, { value: "TUESDAY" } ]) string UnnamedDayOfWeek
New this release:
- 🐛 (client, smithy-rs#3871, aws-sdk-rust#1202) Fix minimum throughput detection for downloads to avoid incorrectly raising an error while the user is consuming data at a slow but steady pace.
New this release:
- 🐛 (client, smithy-rs#3852) Fix AWS SDK generation examples in README in the
aws/sdkdirectory.
Breaking Changes:
⚠️ (server) The generated crates no longer have theaws-lambdafeature flag enabled by default. This prevents the aws-lambda feature from being automatically enabled in aws-smithy-http-server when the SDK is not intended for AWS Lambda.
New this release:
-
🎉 (server) All relevant types from aws-smithy-http-server are now re-exported within the generated crates. This removes the need to explicitly depend on aws-smithy-http-server in service handler code and prevents compilation errors caused by version mismatches.
-
🎉 (all, smithy-rs#3573) Support for the rpcv2Cbor protocol has been added, allowing services to serialize RPC payloads as CBOR (Concise Binary Object Representation), improving performance and efficiency in data transmission.
New this release:
- 🐛 (client, smithy-rs#3820) Fixed a bug with the content length of compressed payloads that caused such requests to hang.
Breaking Changes:
- 🐛
⚠️ (server, smithy-rs#3813) Operations with event stream member shapes must includeValidationExceptionin the errors list. This is necessary because the member shape is a required field, and the builder for the operation input or output returns astd::result::Resultwith the error set tocrate::model::ValidationExceptionField.
New this release:
-
🎉 (server, smithy-rs#3803) Setting the
addValidationExceptionToConstrainedOperationscodegen flag addsaws.smithy.framework#ValidationExceptionto operations with constrained inputs that do not already have this exception added.Sample
smithy-build-template.json:{ "...", "plugins": { "rust-server-codegen": { "service": "ServiceToGenerateSDKFor", "module": "amzn-sample-server-sdk", "codegen": { "addValidationExceptionToConstrainedOperations": true, } } } } -
🐛 (all, smithy-rs#3805) Fix bug in
DateTime::from_secs_f64where certain floating point values could lead to a panic.
Breaking Changes:
⚠️ (all, smithy-rs#3800) Upgrade MSRV to Rust 1.78.0.
New this release:
- 🐛 (client, smithy-rs#3798) Fix the execution order of modify_before_serialization and read_before_serialization in the orchestrator. The
modify_before_serializationmethod now executes before theread_before_serializationmethod. This adjustment may result in changes in behavior depending on how you customize interceptors. - (client, smithy-rs#1925) Backport connection poisoning to hyper 1.x support
- 🐛 (client, aws-sdk-rust#821, smithy-rs#3797) Fix the Length::UpTo usage in FsBuilder, ensuring that the specified length does not exceed the remaining file length.
- 🐛 (client, aws-sdk-rust#820) Re-export
ByteStream'sLengthandFsBuilder. By making these types available directly within a client crate, customers can useByteStream::read_fromwithout needing to import them separately from theaws-smithy-typescrate.
New this release:
- 🐛 (client, smithy-rs#3767) Fix client error correction to properly parse structure members that target a
Unioncontaining that structure recursively. - 🐛 (client, smithy-rs#3765, smithy-rs#3757) Fix incorrect redaction of
@sensitivetypes in maps and lists. - (client, smithy-rs#3779) Improve error messaging when HTTP headers aren't valid UTF-8
New this release:
- (client, smithy-rs#3742) Support
stringArraytype in endpoints params - (client, smithy-rs#3755) Add support for
operationContextParamsEndpoints trait - (client, smithy-rs#3591)
aws_smithy_runtime_api::client::orchestrator::HttpRequestandaws_smithy_runtime_api::client::orchestrator::HttpResponseare now re-exported in generated clients so that using these types does not require directly depending onaws-smithy-runtime-api.
Breaking Changes:
-
⚠️ (server, smithy-rs#3746)FromParts<Protocol>::Rejectionmust implementstd::fmt::Display.Handlers can accept user-defined types if they implement FromParts with a
Rejectiontype that implementsstd::fmt::Display(preferablystd::error::Error) to enable error logging when parameter construction from request parts fails.
New this release:
- (client, smithy-rs#3742) Support
stringArraytype in endpoints params - 🐛 (client, smithy-rs#3744) Fix bug where stalled stream protection would panic with an underflow if the first event was logged too soon.
New this release:
- 🐛 (server, smithy-rs#3643) A feature,
aws-lambda, has been added to generated SDKs to re-export types required for Lambda deployment. - 🐛 (server, smithy-rs#3471, smithy-rs#3724, @djedward) Content-Type header validation now ignores parameter portion of media types.
Contributors Thank you for your contributions! ❤
- @djedward (smithy-rs#3471, smithy-rs#3724)
Breaking Changes:
-
🐛
⚠️ (server, smithy-rs#3690) Fix requestContent-Typeheader checkingTwo bugs related to how servers were checking the
Content-Typeheader in incoming requests have been fixed:Content-Typeheader checking was incorrectly succeeding when noContent-Typeheader was present but one was expected.- When a shape was @httpPayload
-bound,Content-Type` header checking occurred even when no payload was being sent. In this case it is not necessary to check the header, since there is no content.
This is a breaking change in that servers are now stricter at enforcing the expected
Content-Typeheader is being sent by the client in general, and laxer when the shape is bound with@httpPayload.
New this release:
- (all, smithy-rs#1925, smithy-rs#3673) Add support for v1
http_body::Bodytoaws_smithy_types::byte_stream::bytestream_util::PathBody. - (all, smithy-rs#3637, @khuey) Add conversions from smithy StatusCode to http StatusCode.
- 🐛 (client, smithy-rs#3675, @dastrom) Enable aws-smithy-runtime to compile in rustc 1.72.1
Contributors Thank you for your contributions! ❤
- @dastrom (smithy-rs#3675)
- @khuey (smithy-rs#3637)
New this release:
- (client, smithy-rs#3664) Reduce verbosity of various debug logs
New this release:
- 🐛 (client, smithy-rs#3656, smithy-rs#3657) Fix the Content-Length enforcement so it is only applied to GET requests.
Breaking Changes:
⚠️ 🎉 (all, smithy-rs#3653) Update MSRV to1.76.0
New this release:
-
🎉 (client, smithy-rs#2891) Compression is now supported for operations modeled with the
@requestCompressiontrait. -
🐛 (client, aws-sdk-rust#1133) Fix panics that occurred when
Durationfor exponential backoff could not be created from too big a float. -
🐛 (all, smithy-rs#3491, aws-sdk-rust#1079) Clients now enforce that the Content-Length sent by the server matches the length of the returned response body. In most cases, Hyper will enforce this behavior, however, in extremely rare circumstances where the Tokio runtime is dropped in between subsequent requests, this scenario can occur.
-
🐛 (all, aws-sdk-rust#1141, aws-sdk-rust#1146, aws-sdk-rust#1148) Fixes stalled upload stream protection to not apply to empty request bodies and to stop checking for violations once the request body has been read.
Breaking Changes:
⚠️ 🎉 (all, smithy-rs#3527) Stalled stream protection on uploads is now enabled by default behindBehaviorVersion::v2024_03_28(). If you're usingBehaviorVersion::latest(), you will get this change automatically by runningcargo update.
New this release:
- (all, smithy-rs#3161, @mnissenb) Implement Debug for DateTime
Contributors Thank you for your contributions! ❤
- @mnissenb (smithy-rs#3161)
New this release:
-
🎉 (client, smithy-rs#119, smithy-rs#3595, smithy-rs#3593, smithy-rs#3585, smithy-rs#3571, smithy-rs#3569) Added support for waiters. Services that model waiters now have a
Waiterstrait that adds some methods prefixed withwait_untilto the existing clients.For example, if there was a waiter modeled for "thing" that takes a "thing ID", using that waiter would look as follows:
use my_generated_client::client::Waiters; let result = client.wait_until_thing() .thing_id("someId") .wait(Duration::from_secs(120)) .await;
-
🐛 (all, smithy-rs#3603) Fix event stream
:content-typemessage headers for struct messages. Note: this was the:content-typeheader on individual event message frames that was incorrect, not the HTTPcontent-typeheader for the initial request.
New this release:
- 🎉 (server, smithy-rs#3430) Implement
std::error::ErrorforConstraintViolation - (all, smithy-rs#3553) Upgraded MSRV to Rust 1.75
New this release:
-
🎉 (all, smithy-rs#3485) Stalled stream protection now supports request upload streams. It is currently off by default, but will be enabled by default in a future release. To enable it now, you can do the following:
let config = my_service::Config::builder() .stalled_stream_protection(StalledStreamProtectionConfig::enabled().build()) // ... .build();
-
🐛 (all, smithy-rs#3427)
SharedIdentityResolvernow respects an existing cache partition when theResolveIdentityimplementation provides one already. -
🐛 (all, smithy-rs#3485) Stalled stream protection on downloads will now only trigger if the upstream source is too slow. Previously, stalled stream protection could be erroneously triggered if the user was slowly consuming the stream slower than the minimum speed limit.
-
🐛 (all, smithy-rs#2546) Unions with unit target member shape are now fully supported
Breaking Changes:
- 🐛
⚠️ (client, aws-sdk-rust#1111, smithy-rs#3513, @Ten0) MakeBehaviorVersionbe future-proof by disallowing it to be constructed via theBehaviorVersion {}syntax.
New this release:
-
🎉 (all, smithy-rs#3539) Add FIPS support to our Hyper 1.0-based client. Customers can enable this mode by enabling the
crypto-aws-lc-fipsonaws-smithy-experimental. To construct a client using the new client, consult this example.Please note that support for Hyper 1.0 remains experimental.
-
(all, smithy-rs#3389) All requests are now retryable, even if they are deserialized successfully. Previously, this was not allowed.
-
(all, smithy-rs#3539) Fix bug in Hyper 1.0 support where https URLs returned an error
Contributors Thank you for your contributions! ❤
- @Ten0 (aws-sdk-rust#1111, smithy-rs#3513)
New this release:
- (all, smithy-rs#3476, @landonxjames) Increased minimum version of wasi crate dependency in aws-smithy-wasm to 0.12.1.
Contributors Thank you for your contributions! ❤
- @landonxjames (smithy-rs#3476)
New this release:
- 🎉 (all, smithy-rs#2087, smithy-rs#2520, smithy-rs#3409, aws-sdk-rust#59, @landonxjames, @eduardomourar) Added aws-smithy-wasm crate to enable SDK use in WASI compliant environments
- 🎉 (client, smithy-rs#2087, smithy-rs#2520, smithy-rs#3409, @landonxjames, @eduardomourar) Added aws-smithy-wasm crate to enable SDK use in WASI compliant environments
- 🎉 (all, smithy-rs#3365, aws-sdk-rust#1046, @cayman-amzn)
SdkBodynow implements the 1.0 version of thehttp_body::Bodytrait. - (all, smithy-rs#3470) Upgrade Smithy to 1.45.
- (client, smithy-rs#3465, smithy-rs#3477) The
ResolveIdentitytrait is now aware of itsIdentityCachelocation. - (client, smithy-rs#3465, smithy-rs#3477)
RuntimeComponentscan now be converted back to aRuntimeComponentsBuilder, using.to_builder().
Contributors Thank you for your contributions! ❤
- @cayman-amzn (aws-sdk-rust#1046, smithy-rs#3365)
- @eduardomourar (aws-sdk-rust#59, smithy-rs#2087, smithy-rs#2520, smithy-rs#3409)
- @landonxjames (aws-sdk-rust#59, smithy-rs#2087, smithy-rs#2520, smithy-rs#3409)
New this release:
- (all, smithy-rs#3410) The MSRV has been increase to 1.74.1
Breaking Changes:
-
🐛
⚠️ (client, smithy-rs#3405, smithy-rs#3400, smithy-rs#3258) Fix bug where timeout settings where not merged properly. This will add a default connect timeout of 3.1s seconds for most clients.
New this release:
-
(all, aws-sdk-rust#977, smithy-rs#3365, smithy-rs#3373) Add
try_into_http1xandtry_from_http1xto Request and Response container types. -
(client, smithy-rs#3336, smithy-rs#3391, @iampkmone) Added impl
Displayto Enums. -
🐛 (all, smithy-rs#3322) Retry classifiers will now be sorted by priority. This change only affects requests that are retried. Some requests that were previously been classified as transient errors may now be classified as throttling errors.
If you were
- configuring multiple custom retry classifiers
- that would disagree on how to classify a response
- that have differing priorities
you may see a behavior change in that classification for the same response is now dependent on the classifier priority instead of the order in which the classifier was added.
-
🐛 (client, smithy-rs#3402) Cap the maximum jitter fraction for identity cache refresh buffer time to 0.5. It was previously 1.0, and if the fraction was randomly set to 1.0, it was equivalent to disregarding the buffer time for cache refresh.
Contributors Thank you for your contributions! ❤
- @iampkmone (smithy-rs#3336, smithy-rs#3391)
New this release:
- (client, smithy-rs#3318)
EndpointPrefixandapply_endpointmoved from aws-smithy-http to aws-smithy-runtime-api so that is in a stable (1.x) crate. A deprecated type alias was left in place with a note showing the new location. - (client, smithy-rs#3325) The
Metadatastorable was moved from aws_smithy_http into aws_smithy_runtime_api. A deprecated type alias was left in place with a note showing where the new location is.
New this release:
-
🎉 (all, smithy-rs#3300, aws-sdk-rust#977) Add support for constructing [
SdkBody] and [ByteStream] fromhttp-body1.0 bodies. Note that this is initial support and works via a backwards compatibility shim to http-body 0.4. Hyper 1.0 is not supported. -
🎉 (all, smithy-rs#3333, aws-sdk-rust#998, aws-sdk-rust#1010) Add
as_service_err()toSdkErrorto allow checking the type of an error is without taking ownership. -
(client, smithy-rs#3299, @Ploppz) Add
PaginationStreamExtextension trait toaws-smithy-types-convertbehind theconvert-streamsfeature. This makes it possible to treat a paginator as afutures_core::Stream, allowing customers to use stream combinators likemapandfilter.Example:
use aws_smithy_types_convert::stream::PaginationStreamExt let stream = s3_client.list_objects_v2().bucket("...").into_paginator().send().into_stream_03x();
-
🐛 (client, smithy-rs#3252, smithy-rs#3312, @milesziemer) Serialize 0/false in query parameters, and ignore actual default value during serialization instead of just 0/false. See changelog discussion for details.
-
(all, smithy-rs#3292)
requireEndpointResolver: falseis no longer required to remove the need for an endpoint resolver. Instead,"awsSdkBuilder"(default false), now removes that requirement.
Contributors Thank you for your contributions! ❤
- @Ploppz (smithy-rs#3299)
- @milesziemer (smithy-rs#3252, smithy-rs#3312)
New this release:
- 🐛 (client, smithy-rs#3305)
crate::event_receiver::EventReceiveris now re-exported ascrate::primitives::event_stream::EventReceiverwhen a service supports event stream operations.
New this release:
- 🎉 (all, smithy-rs#3121, smithy-rs#3295) All generated docs now include docsrs labels when features are required
- 🐛 (client, smithy-rs#3262) Loading native TLS trusted certs for the default HTTP client now only occurs if the default HTTP client is not overridden in config.
- (client, smithy-rs#3277) Improve the error messages for when auth fails to select an auth scheme for a request.
- (client, smithy-rs#3282) Fix documentation and examples on HyperConnector and HyperClientBuilder.
- (client, aws-sdk-rust#990, @declanvk) Expose local socket address from ConnectionMetadata.
- (all, smithy-rs#3294)
NumberTryIntoimplementations now succesfully convert fromf64to numeric types when no precision is lost. This fixes some deserialization issues where numbers like25.0were sent whenBytefields were expected.
Contributors Thank you for your contributions! ❤
- @declanvk (aws-sdk-rust#990)
New this release:
- (client, smithy-rs#3278)
RuntimeComponentsBuilder::push_identity_resolveris now deprecated since it does not replace the existing identity resolver of a given auth scheme ID. UseRuntimeComponentsBuilder::set_identity_resolverinstead.
New this release:
- (client, aws-sdk-rust#738, aws-sdk-rust#858) Retry additional classes of H2 errors (H2 GoAway & H2 ResetStream)
Internal changes only with this release
Breaking Changes:
-
⚠️ 🎉 (client, smithy-rs#3202) Add configurable stalled-stream protection for downloads.When making HTTP calls, it's possible for a connection to 'stall out' and emit no more data due to server-side issues. In the event this happens, it's desirable for the stream to error out as quickly as possible. While timeouts can protect you from this issue, they aren't adaptive to the amount of data being sent and so must be configured specifically for each use case. When enabled, stalled-stream protection will ensure that bad streams error out quickly, regardless of the amount of data being downloaded.
Protection is enabled by default for all clients but can be configured or disabled. See this discussion for more details.
-
⚠️ (client, smithy-rs#3222) 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]onpub usedoesn't work). See the deprecations removal list for more details. -
⚠️ (all, smithy-rs#3236) Conversions for HTTP request in aws-smithy-runtime-api are now feature gated behind thehttp-02xfeature
New this release:
- 🎉 (all, smithy-rs#3183, @HakanVardarr) Add
Displayimpl forDateTime. - 🐛 (client, smithy-rs#3229, aws-sdk-rust#960) Prevent multiplication overflow in backoff computation
- (client, smithy-rs#3226) Types/functions that were previously
#[doc(hidden)]inaws-smithy-async,aws-smithy-runtime-api,aws-smithy-runtime,aws-smithy-types, and the SDK crates are now visible. For those that are not intended to be used directly, they are called out in their docs as such.
Contributors Thank you for your contributions! ❤
- @HakanVardarr (smithy-rs#3183)
Breaking Changes:
⚠️ (client, smithy-rs#3205) SignableRequest::apply_to_request in aws_sigv4 has been renamedapply_to_request_http0x
Breaking Changes:
-
⚠️ (all, smithy-rs#3138, smithy-rs#3148) Upgrade guidance for HTTP Request/Response changes. HTTP request types moved, and a new HTTP response type was added. -
⚠️ (all, smithy-rs#3139)Message,Header,HeaderValue, andStrByteshave been moved toaws-smithy-typesfromaws-smithy-eventstream.Message::read_fromandMessage::write_toremain inaws-smithy-eventstreambut they are converted to free functions with the namesread_message_fromandwrite_message_torespectively. -
⚠️ (client, smithy-rs#3100, smithy-rs#3114) An operation output that supports receiving events from stream now provides a new-type wrappingaws_smithy_http::event_stream::receiver::Receiver. The new-type supports the.recv()method whose signature is the same asaws_smithy_http::event_stream::receiver::Receiver::recv. -
⚠️ (all, smithy-rs#3151) Clients now require aBehaviorVersionto be provided. For must customers,latestis the best choice. This will be enabled automatically if you enable thebehavior-version-latestcargo feature onaws-configor on an SDK crate. For customers that wish to pin to a specific behavior major version, it can be set inaws-configor when constructing the service client.async fn example() { // when creating a client let client = my_service::Client::from_conf(my_service::Config::builder().behavior_version(..).<other params>.build()); }
-
⚠️ (client, smithy-rs#3189) Remove deprecated error kind type aliases. -
⚠️ (client, smithy-rs#3191) Unhandled errors have been made opaque to ensure code is written in a future-proof manner. Where previously, you might have:match service_error.err() { GetStorageError::StorageAccessNotAuthorized(_) => { /* ... */ } GetStorageError::Unhandled(unhandled) if unhandled.code() == Some("SomeUnmodeledErrorCode") { // unhandled error handling } _ => { /* ... */ } }
It should now look as follows:
match service_error.err() { GetStorageError::StorageAccessNotAuthorized(_) => { /* ... */ } err if err.code() == Some("SomeUnmodeledErrorCode") { // unhandled error handling } _ => { /* ... */ } }
The
Unhandledvariant should never be referenced directly.
New this release:
- 🎉 (client, aws-sdk-rust#780, smithy-rs#3189) Add
ProvideErrorMetadataimpl for serviceErrortype. - 🐛 (client, smithy-rs#3182, @codypenta) Fix rendering of @error structs when fields have default values
Contributors Thank you for your contributions! ❤
- @codypenta (smithy-rs#3182)
New this release:
- (client, smithy-rs#3112, smithy-rs#3116) Upgrade
ringto 0.17.5.
Breaking Changes:
-
⚠️ 🎉 (client, smithy-rs#2417, smithy-rs#3018) Retry classifiers are now configurable at the service and operation levels. Users may also define their own custom retry classifiers.For more information, see the guide.
-
⚠️ (client, smithy-rs#3011) HTTP connector configuration has changed significantly. See the upgrade guidance for details. -
⚠️ (client, smithy-rs#3038) TheenableNewSmithyRuntime: middlewareopt-out flag in smithy-build.json has been removed and no longer opts out of the client orchestrator implementation. Middleware is no longer supported. If you haven't already upgraded to the orchestrator, see the guide. -
⚠️ (client, smithy-rs#2909) It's now possible to nest runtime components with theRuntimePlugintrait. Acurrent_componentsargument was added to theruntime_componentsmethod 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 newRuntimePlugin::ordermethod. -
⚠️ (all, smithy-rs#2948) Update MSRV to Rust 1.70.0 -
⚠️ (client, smithy-rs#2970)aws_smithy_client::hyper_ext::Adapterwas moved/renamed toaws_smithy_runtime::client::connectors::hyper_connector::HyperConnector. -
⚠️ (client, smithy-rs#2970) Test connectors moved intoaws_smithy_runtime::client::connectors::test_utilbehind thetest-utilfeature. -
⚠️ (client, smithy-rs#2970) DVR's RecordingConnection and ReplayingConnection were renamed to RecordingConnector and ReplayingConnector respectively. -
⚠️ (client, smithy-rs#2970) TestConnection was renamed to EventConnector. -
⚠️ (all, smithy-rs#2973) Removeonce_cellfrom public API. -
⚠️ (all, smithy-rs#2995) Structure members with the typeOption<Vec<T>>now produce an accessor with the type&[T]instead ofOption<&[T]>. This is enabled by default for clients and can be disabled by updating your smithy-build.json with the following setting:{ "codegen": { "flattenCollectionAccessors": false, ... } } -
⚠️ (client, smithy-rs#2978) Thefutures_core::stream::Streamtrait has been removed from public API.FnStreamonly supportsnext,try_next,collect, andtry_collectmethods.TryFlatMap::flat_mapreturnsPaginationStream, which should be preferred toFnStreamat an interface level. Other stream operations that were previously available through the trait or its extension traits can be added later in a backward compatible manner. Finally,fn_streamhas been moved to be a child module ofpagination_stream. -
⚠️ (client, smithy-rs#2983) Thefutures_core::stream::Streamtrait has been removed fromByteStream. The methods mentioned in the doc will continue to be supported. Other stream operations that were previously available through the trait or its extension traits can be added later in a backward compatible manner. -
⚠️ (client, smithy-rs#2997)StaticUriEndpointResolver'suriconstructor now takes aStringinstead of aUri. -
⚠️ (server, smithy-rs#3038)SdkErroris no longer re-exported in generated server crates. -
⚠️ (client, smithy-rs#3039) Thecustomize()method is now sync and infallible. Remove anyawaits and error handling from it to make things compile again. -
🐛
⚠️ (all, smithy-rs#3037, aws-sdk-rust#756) Our algorithm for converting identifiers tosnake_casehas been updated. This may result in a small change for some identifiers, particularly acronyms ending ins, e.g.ACLs. -
⚠️ (client, smithy-rs#3055) The future return types on traitsEndpointResolverandIdentityResolverchanged to new-typesEndpointFutureandIdentityFuturerespectively. -
⚠️ (client, smithy-rs#3032)EndpointPrefix::newno longer returnscrate::operation::error::BuildErrorfor an Err variant, instead returns a more specificInvalidEndpointError. -
⚠️ (client, smithy-rs#3061) Lifetimes have been added to theEndpointResolvertrait. -
⚠️ (client, smithy-rs#3065) Several traits have been renamed from noun form to verb form to be more idiomatic:AuthSchemeOptionResolver->ResolveAuthSchemeOptionsEndpointResolver->ResolveEndpointIdentityResolver->ResolveIdentitySigner->SignRequestSerializer->SerializeRequestResponseDeserializer->DeserializeResponseInterceptor->Intercept
-
⚠️ (client, smithy-rs#3059) This change has detailed upgrade guidance. A summary is below.
TheHttpRequesttype alias now points toaws-smithy-runtime-api::client::http::Request. This is a first-party request type to allow us to gracefully supporthttp = 1.0when it arrives. Most customer code using this method should be unaffected.TryFrom/TryIntoconversions are provided forhttp = 0.2.*. -
⚠️ (client, smithy-rs#2917)RuntimeComponentshave been added as an argument to theIdentityResolver::resolve_identitytrait function. -
⚠️ (client, smithy-rs#3072) Theidempotency_providerfield has been removed from config as a public field. If you need access to this field, it is still available from the context of an interceptor. -
⚠️ (client, smithy-rs#3078) Theconfig::Builder::endpoint_resolvermethod no longer accepts&'static str. Useconfig::Builder::endpoint_urlinstead. -
⚠️ (client, smithy-rs#3043, smithy-rs#3078) This change has detailed upgrade guidance.
The endpoint interfaces fromaws-smithy-httphave been removed. Service-specific endpoint resolver traits have been added. -
⚠️ (all, smithy-rs#3054, smithy-rs#3070)aws_smithy_http::operation::error::{BuildError, SerializationError}have been moved toaws_smithy_types::error::operation::{BuildError, SerializationError}. Type aliases for them are left inaws_smithy_httpfor backwards compatibility but are deprecated. -
⚠️ (all, smithy-rs#3076)aws_smithy_http::body::{BoxBody, Error, SdkBody}have been moved toaws_smithy_types::body::{BoxBody, Error, SdkBody}. Type aliases for them are left inaws_smithy_httpfor backwards compatibility but are deprecated. -
⚠️ (all, smithy-rs#3076, smithy-rs#3091)aws_smithy_http::byte_stream::{AggregatedBytes, ByteStream, error::Error, FsBuilder, Length}have been moved toaws_smithy_types::byte_stream::{AggregatedBytes, ByteStream, error::Error, FsBuilder, Length}. Type aliases for them are left inaws_smithy_httpfor backwards compatibility but are deprecated. -
⚠️ (client, smithy-rs#3077) Behavior Break! Identities for auth are now cached by default. See theConfigbuilder'sidentity_cache()method docs for an example of how to disable this caching. -
⚠️ (all, smithy-rs#3033, smithy-rs#3088, smithy-rs#3101) Publicly exposed types fromhttp-bodyandhypercrates withinaws-smithy-typesare now feature-gated. See the upgrade guidance for details. -
⚠️ (all, smithy-rs#3033, smithy-rs#3088)ByteStream::poll_nextis now feature-gated. You can turn on a cargo featurebyte-stream-poll-nextinaws-smithy-typesto use it. -
⚠️ (client, smithy-rs#3092, smithy-rs#3093) Theconnectionandresultmodules inaws-smithy-httphave been moved toaws-smithy-runtime-api. Type aliases for all affected pub items, except for a trait, are left inaws-smithy-httpfor backwards compatibility but are deprecated. Due to lack of trait aliases, the moved traitCreateUnhandledErrorneeds to be used fromaws-smithy-runtime-api. -
🐛
⚠️ (server, smithy-rs#3095, smithy-rs#3096) Service builder initialization now takes in a${serviceName}Configobject on which plugins and layers should be registered. Thebuilder_with_pluginsandbuilder_without_pluginsmethods on the service builder, as well as thelayermethod on the built service have been deprecated, and will be removed in a future release. See the upgrade guidance for more details.
New this release:
- 🎉 (client, smithy-rs#2916, smithy-rs#1767) Support for Smithy IDLv2 nullability is now enabled by default. You can maintain the old behavior by setting `nullabilityCheckMode: "CLIENT_ZERO_VALUE_V1" in your codegen config. For upgrade guidance and more info, see here.
- 🎉 (server, smithy-rs#3005) Python middleware can set URI. This can be used to route a request to a different handler.
- 🎉 (client, smithy-rs#3071) Clients now have a default async sleep implementation so that one does not need to be specified if you're using Tokio.
- 🐛 (client, smithy-rs#2944, smithy-rs#2951)
CustomizableOperation, created as a result of calling the.customizemethod on a fluent builder, ceased to beSendandSyncin the previous releases. It is nowSendandSyncagain. - 🐛 (client, smithy-rs#2960) Generate a region setter when a model uses SigV4.
- 🐛 (all, smithy-rs#2969, smithy-rs#1896) Fix code generation for union members with the
@httpPayloadtrait. - (client, smithy-rs#2964) Required members with @contextParam are now treated as client-side required.
- 🐛 (client, smithy-rs#2926, smithy-rs#2972) Fix regression with redacting sensitive HTTP response bodies.
- 🐛 (all, smithy-rs#2831, aws-sdk-rust#818) Omit fractional seconds from
http-dateformat. - 🐛 (client, smithy-rs#2985) Source defaults from the default trait instead of implicitly based on type. This has minimal changes in the generated code.
- (client, smithy-rs#2996) Produce better docs when items are marked @required
- 🐛 (client, smithy-rs#3034, smithy-rs#3087) Enable custom auth schemes to work by changing the code generated auth options to be set at the client level at
DEFAULTSpriority.
Breaking Changes:
- 🐛
⚠️ (client, smithy-rs#2931, aws-sdk-rust#875) Fixed re-exportedSdkErrortype. The previous release had the wrong type forSdkErrorwhen generating code for orchestrator mode, which caused projects to fail to compile when upgrading.
New this release:
- (client, smithy-rs#2904)
RuntimeComponentsandRuntimeComponentsBuilderare now re-exported in generated clients so that implementing a custom interceptor or runtime plugin doens't require directly depending onaws-smithy-runtime-api. - 🐛 (client, smithy-rs#2914, aws-sdk-rust#825) Fix incorrect summary docs for builders
- 🐛 (client, smithy-rs#2934, aws-sdk-rust#872) Logging via
#[instrument]in theaws_smithy_runtime::client::orchestratormodule is now emitted at theDEBUGlevel to reduce the amount of logging when emitted at theINFOlevel. - 🐛 (client, smithy-rs#2935) Fix
SDK::Endpointbuilt-in for@endpointRuleSet.
Breaking Changes:
-
⚠🎉 (server, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, smithy-rs#2827, @hlbarber) The middleware system has been reworked as we push for a unified, simple, and consistent API. The following changes have been made in service of this goal:
- A
ServiceShapetrait has been added. - The
Plugintrait has been simplified. - The
HttpMarkerandModelMarkermarker traits have been added to better distinguish when plugins run and what they have access to. - The
Operationstructure has been removed. - A
ScopedPluginhas been added.
The
Plugintrait has now been simplified and theOperationstruct has been removed.Since the 0.52 release the
OperationShapehas existed./// Models the [Smithy Operation shape]. /// /// [Smithy Operation shape]: https://awslabs.github.io/smithy/1.0/spec/core/model.html#operation pub trait OperationShape { /// The ID of the operation. const ID: ShapeId; /// The operation input. type Input; /// The operation output. type Output; /// The operation error. [`Infallible`](std::convert::Infallible) in the case where no error /// exists. type Error; }
This allowed
Pluginauthors to access these associated types and constants. See thePrintPluginas an example.We continue with this approach and introduce the following trait:
/// Models the [Smithy Service shape]. /// /// [Smithy Service shape]: https://smithy.io/2.0/spec/service-types.html pub trait ServiceShape { /// The [`ShapeId`] of the service. const ID: ShapeId; /// The version of the service. const VERSION: Option<&'static str>; /// The [Protocol] applied to this service. /// /// [Protocol]: https://smithy.io/2.0/spec/protocol-traits.html type Protocol; /// An enumeration of all operations contained in this service. type Operations; }
With the changes to
Plugin, described below, middleware authors now have access to this information at compile time.Previously,
trait Plugin<P, Op, S, L> { type Service; type Layer; fn map(&self, input: Operation<S, L>) -> Operation<Self::Service, Self::Layer>; }
modified an
Operation.Now,
trait Plugin<Service, Operation, T> { type Output; fn apply(&self, input: T) -> Self::Output; }
maps a
tower::Serviceto atower::Service. This is equivalent totower::Layerwith two extra type parameters:ServiceandOperation, which implementServiceShapeandOperationShaperespectively.Having both
ServiceandOperationas type parameters also provides an even surface for advanced users to extend the codegenerator in a structured way. See this issue for more context.The following middleware setup
pub struct PrintService<S> { inner: S, name: &'static str, } impl<R, S> Service<R> for PrintService<S> where S: Service<R>, { async fn call(&mut self, req: R) -> Self::Future { println!("Hi {}", self.name); self.inner.call(req) } } pub struct PrintLayer { name: &'static str, } impl<S> Layer<S> for PrintLayer { type Service = PrintService<S>; fn layer(&self, service: S) -> Self::Service { PrintService { inner: service, name: self.name, } } } pub struct PrintPlugin; impl<P, Op, S, L> Plugin<P, Op, S, L> for PrintPlugin where Op: OperationShape, { type Service = S; type Layer = Stack<L, PrintLayer>; fn map(&self, input: Operation<S, L>) -> Operation<Self::Service, Self::Layer> { input.layer(PrintLayer { name: Op::NAME }) } }
now becomes
pub struct PrintService<S> { inner: S, name: &'static str, } impl<R, S> Service<R> for PrintService<S> where S: Service<R>, { async fn call(&mut self, req: R) -> Self::Future { println!("Hi {}", self.name); self.inner.call(req) } } pub struct PrintPlugin; impl<Service, Op, T> Plugin<Service, Operation, T> for PrintPlugin where Op: OperationShape, { type Output = PrintService<S>; fn apply(&self, inner: T) -> Self::Output { PrintService { inner, name: Op::ID.name() } } } impl HttpMarker for PrintPlugin { }
Alternatively, using the new
ServiceShape, implemented onSer:impl<Service, Operation, T> Plugin<Service, Operation, T> for PrintPlugin where Ser: ServiceShape, { type Service = PrintService<S>; fn apply(&self, inner: T) -> Self::Service { PrintService { inner, name: Ser::ID.name() } } }
A single
Plugincan no longer apply atower::Layeron HTTP requests/responses and modelled structures at the same time (see middleware positions C and D. Instead onePluginmust be specified for each and passed to the service builder constructor separately:let app = PokemonService::builder_with_plugins(/* HTTP plugins */, /* model plugins */) /* setters */ .build() .unwrap();
To better distinguish when a plugin runs and what it has access to,
Plugins now have to additionally implement theHttpMarkermarker trait, theModelMarkermarker trait, or both:- A HTTP plugin acts on the HTTP request before it is deserialized, and acts on the HTTP response after it is serialized.
- A model plugin acts on the modeled operation input after it is deserialized, and acts on the modeled operation output or the modeled operation error before it is serialized.
The motivation behind this change is to simplify the job of middleware authors, separate concerns, accomodate common cases better, and to improve composition internally.
Because
Pluginis now closer totower::Layerwe have two canonical converters:use aws_smithy_http_server::plugin::{PluginLayer, LayerPlugin}; // Convert from `Layer` to `Plugin` which applies uniformly across all operations let layer = /* some layer */; let plugin = PluginLayer(layer); // Convert from `Plugin` to `Layer` for some fixed protocol and operation let plugin = /* some plugin */; let layer = LayerPlugin::new::<SomeProtocol, SomeOperation>(plugin);
Since plugins now come in two flavors (those marked with
HttpMarkerand those marked withModelMarker) that shouldn't be mixed in a collection of plugins, the primary way of concatenating plugins,PluginPipelinehas been removed in favor of theHttpPluginsandModelPluginstypes, which eagerly check that whenever a plugin is pushed, it is of the expected type.This worked before, but you wouldn't be able to do apply this collection of plugins anywhere; if you tried to, the compilation error messages would not be very helpful:
use aws_smithy_http_server::plugin::PluginPipeline; let pipeline = PluginPipeline::new().push(http_plugin).push(model_plugin);
Now collections of plugins must contain plugins of the same flavor:
use aws_smithy_http_server::plugin::{HttpPlugins, ModelPlugins}; let http_plugins = HttpPlugins::new() .push(http_plugin) // .push(model_plugin) // This fails to compile with a helpful error message. .push(&http_and_model_plugin); let model_plugins = ModelPlugins::new() .push(model_plugin) .push(&http_and_model_plugin);
In the above example,
&http_and_model_pluginimplements bothHttpMarkerandModelMarker, so we can add it to both collections.The
aws_smithy_http_server::operation::Operationstructure has now been removed. Previously, there existed a{operation_name}_operationsetter on the service builder, which accepted anOperation. This allowed users tolet operation /* : Operation<_, _> */ = GetPokemonSpecies::from_service(/* tower::Service */); let app = PokemonService::builder_without_plugins() .get_pokemon_species_operation(operation) /* other setters */ .build() .unwrap();
to set an operation with a
tower::Service, andlet operation /* : Operation<_, _> */ = GetPokemonSpecies::from_service(/* tower::Service */).layer(/* layer */); let operation /* : Operation<_, _> */ = GetPokemonSpecies::from_handler(/* closure */).layer(/* layer */); let app = PokemonService::builder_without_plugins() .get_pokemon_species_operation(operation) /* other setters */ .build() .unwrap();
to add a
tower::Layer(acting on HTTP requests/responses post-routing) to a single operation.We have seen little adoption of this API and for this reason we have opted instead to introduce a new setter, accepting a
tower::Service, on the service builder:let app = PokemonService::builder_without_plugins() .get_pokemon_species_service(/* tower::Service */) /* other setters */ .build() .unwrap();
Applying a
tower::Layerto a subset of operations is should now be done through thePluginAPI viafilter_by_operation_iduse aws_smithy_http_server::plugin::{PluginLayer, filter_by_operation_name, IdentityPlugin}; let plugin = PluginLayer(/* layer */); let scoped_plugin = filter_by_operation_name(plugin, |id| id == GetPokemonSpecies::ID); let app = PokemonService::builder_with_plugins(scoped_plugin, IdentityPlugin) .get_pokemon_species(/* handler */) /* other setters */ .build() .unwrap();
or the new
ScopedPluginintroduced below.Currently, users can selectively apply a
Pluginvia thefilter_by_operation_idfunctionuse aws_smithy_http_server::plugin::filter_by_operation_id; // Only apply `plugin` to `CheckHealth` and `GetStorage` operation let filtered_plugin = filter_by_operation_id(plugin, |name| name == CheckHealth::ID || name == GetStorage::ID);
In addition to this, we now provide
Scoped, which selectively applies aPluginat compiletime. Users should prefer this tofilter_by_operation_idwhen applicable.use aws_smithy_http_server::plugin::Scoped; use pokemon_service_server_sdk::scoped; scope! { /// Includes only the `CheckHealth` and `GetStorage` operation. struct SomeScope { includes: [CheckHealth, GetStorage] } } let scoped_plugin = Scoped::new::<SomeScope>(plugin);
- A
-
⚠ (all, smithy-rs#2675) Remove native-tls and add a migration guide.
-
⚠ (client, smithy-rs#2671)
Details
Breaking change in how event stream signing works (click to expand more details)
This change will only impact you if you are wiring up their own event stream signing/authentication scheme. If you're using
aws-sig-authto use AWS SigV4 event stream signing, then this change will not impact you.Previously, event stream signing was configured at codegen time by placing a
new_event_stream_signermethod on theConfig. This function was called at serialization time to connect the signer to the streaming body. Now, instead, a specialDeferredSigneris wired up at serialization time that relies on a signing implementation to be sent on a channel by the HTTP request signer. To do this, aDeferredSignerSendermust be pulled out of the property bag, and itssend()method called with the desired event stream signing implementation.See the changes in #2671 for an example of how this was done for SigV4.
-
⚠ (all, smithy-rs#2673) For event stream operations, the
EventStreamSenderin inputs/outputs now requires the passed inStreamimpl to implementSync. -
⚠ (server, smithy-rs#2539) Code generation will abort if the
ignoreUnsupportedConstraintscodegen flag has no effect, that is, if all constraint traits used in your model are well-supported. Please remove the flag in such case. -
⚠ (client, smithy-rs#2728, smithy-rs#2262, aws-sdk-rust#2087) The property bag type for Time is now
SharedTimeSource, notSystemTime. If your code relies on setting request time, useaws_smithy_async::time::SharedTimeSource. -
⚠ (server, smithy-rs#2676, smithy-rs#2685) Bump dependency on
lambda_httpbyaws-smithy-http-serverto 0.8.0. This version ofaws-smithy-http-serveris only guaranteed to be compatible with 0.8.0, or semver-compatible versions of 0.8.0 of thelambda_httpcrate. It will not work with versions prior to 0.8.0 at runtime, making requests to your smithy-rs service unroutable, so please make sure you're running your service in a compatible configuration -
⚠ (server, smithy-rs#2457, @hlbarber) Remove
PollErrorfrom an operationsService::Error.Any
tower::Serviceprovided toOperation::from_serviceno longer requiresService::Error = OperationError<Op::Error, PollError>, instead requiring justService::Error = Op::Error. -
⚠ (client, smithy-rs#2742) A newtype wrapper
SharedAsyncSleephas been introduced and occurrences ofArc<dyn AsyncSleep>that appear in public APIs have been replaced with it. -
⚠ (all, smithy-rs#2893) Update MSRV to Rust 1.69.0
-
⚠ (server, smithy-rs#2678)
ShapeIdis the new structure used to represent a shape, with its absolute name, namespace and name.OperationExtension's members are replaced by theShapeIdand operations' names are now replced by aShapeId.Before you had an operation and an absolute name as its
NAMEmember. You could apply a plugin only to some selected operation:filter_by_operation_name(plugin, |name| name != Op::ID);Your new filter selects on an operation's absolute name, namespace or name.
filter_by_operation_id(plugin, |id| id.name() != Op::ID.name());The above filter is applied to an operation's name, the one you use to specify the operation in the Smithy model.
You can filter all operations in a namespace or absolute name:
filter_by_operation_id(plugin, |id| id.namespace() != "namespace"); filter_by_operation_id(plugin, |id| id.absolute() != "namespace#name"); -
⚠ (client, smithy-rs#2758) The occurrences of
Arc<dyn ResolveEndpoint>have now been replaced withSharedEndpointResolverin public APIs. -
⚠ (server, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, @hlbarber) Remove
filter_by_operation_idandplugin_from_operation_id_fnin favour offilter_by_operationandplugin_from_operation_fn.Previously, we provided
filter_by_operation_idwhich filteredPluginapplication via a predicate over the Shape ID.use aws_smithy_http_server::plugin::filter_by_operation_id; use pokemon_service_server_sdk::operation_shape::CheckHealth; let filtered = filter_by_operation_id(plugin, |name| name != CheckHealth::NAME);
This had the problem that the user is unable to exhaustively match over a
&'static str. To remedy this we have switched tofilter_by_operationwhich is a predicate over an enum containing all operations contained in the service.use aws_smithy_http_server::plugin::filter_by_operation_id; use pokemon_service_server_sdk::service::Operation; let filtered = filter_by_operation(plugin, |op: Operation| op != Operation::CheckHealth);
Similarly,
plugin_from_operation_fnnow allows foruse aws_smithy_http_server::plugin::plugin_from_operation_fn; use pokemon_service_server_sdk::service::Operation; fn map<S>(op: Operation, inner: S) -> PrintService<S> { match op { Operation::CheckHealth => PrintService { name: op.shape_id().name(), inner }, Operation::GetPokemonSpecies => PrintService { name: "hello world", inner }, _ => todo!() } } let plugin = plugin_from_operation_fn(map);
-
⚠ (client, smithy-rs#2783) The naming
make_tokenfor fields and the API ofIdempotencyTokenProviderin service configs and their builders has now been updated toidempotency_token_provider. -
⚠ (client, smithy-rs#2845)
aws_smithy_async::future::rendezvous::Sender::sendno longer exposestokio::sync::mpsc::error::SendErrorfor the error of its return type and instead exposes a new-type wrapper calledaws_smithy_async::future::rendezvous::error::SendError. In addition, theaws_smithy_xmlcrate no longer exposes types fromxmlparser. -
⚠ (client, smithy-rs#2848) The implementation
From<bytes_utils::segmented::SegmentedBuf>foraws_smithy_http::event_stream::RawMessagehas been removed. -
⚠ (server, smithy-rs#2865) The
alb_health_checkmodule has been moved out of thepluginmodule into a newlayermodule. ALB health checks should be enacted before routing, and plugins run after routing, so the module location was misleading. Examples have been corrected to reflect the intended application of the layer. -
⚠ (client, smithy-rs#2873) The
test-utilfeature in aws-smithy-client has been split to include a separatewiremockfeature. This allows test-util to be used without a Hyper server dependency making it usable in webassembly targets. -
⚠ (client) The entire architecture of generated clients has been overhauled. See the upgrade guide to get your code working again.
New this release:
- 🎉 (all, smithy-rs#2647, smithy-rs#2645, smithy-rs#2646, smithy-rs#2616, @thomas-k-cameron) Implement unstable serde support for the
Number,Blob,Document,DateTimeprimitives - 🎉 (client, smithy-rs#2652, @thomas-k-cameron) Add a
send_withfunction on-Inputtypes for sending requests without fluent builders - (client, smithy-rs#2791, @davidsouther) Add accessors to Builders
- (all, smithy-rs#2786, @yotamofek) Avoid intermediate vec allocations in AggregatedBytes::to_vec.
- 🐛 (server, smithy-rs#2733, @thor-bjorgvinsson) Fix bug in AWS JSON 1.x routers where, if a service had more than 14 operations, the router was created without the route for the 15th operation.
- (client, smithy-rs#2728, smithy-rs#2262, aws-sdk-rust#2087) Time is now controlled by the
TimeSourcetrait. This facilitates testing as well as use cases like WASM whereSystemTime::now()is not supported. - 🐛 (client, smithy-rs#2767, @mcmasn-amzn) Fix bug in client generation when using smithy.rules#endpointTests and operation and service shapes are in different namespaces.
- (client, smithy-rs#2854) Public fields in structs are no longer marked as
#[doc(hidden)], and they are now visible. - (server, smithy-rs#2866) RestJson1 server SDKs now serialize only the shape name in operation error responses. Previously (from versions 0.52.0 to 0.55.4), the full shape ID was rendered.
Example server error response by a smithy-rs server version 0.52.0 until 0.55.4:
Example server error response now:
HTTP/1.1 400 Bad Request content-type: application/json x-amzn-errortype: com.example.service#InvalidRequestException ...HTTP/1.1 400 Bad Request content-type: application/json x-amzn-errortype: InvalidRequestException ...
Contributors Thank you for your contributions! ❤
- @davidsouther (smithy-rs#2791)
- @hlbarber (smithy-rs#2457, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, smithy-rs#2827)
- @mcmasn-amzn (smithy-rs#2767)
- @thomas-k-cameron (smithy-rs#2616, smithy-rs#2645, smithy-rs#2646, smithy-rs#2647, smithy-rs#2652)
- @thor-bjorgvinsson (smithy-rs#2733)
- @yotamofek (smithy-rs#2786)
New this release:
- (all, smithy-rs#2612) The
Debugimplementation forPropertyBagnow prints a list of the types it contains. This significantly improves debuggability. - (all, smithy-rs#2653, smithy-rs#2656, @henriiik) Implement
OrdandPartialOrdforDateTime. - 🐛 (client, smithy-rs#2696) Fix compiler errors in generated code when naming shapes after types in the Rust standard library prelude.
Contributors Thank you for your contributions! ❤
- @henriiik (smithy-rs#2653, smithy-rs#2656)
Breaking Changes:
- ⚠ (all, smithy-rs#2611) Update MSRV to Rust 1.67.1
New this release:
- 🎉 (server, smithy-rs#2540) Implement layer for servers to handle ALB health checks.
Take a look at
aws_smithy_http_server::plugin::alb_health_checkto learn about it. - 🎉 (client, smithy-rs#2254, @eduardomourar) Clients now compile for the
wasm32-unknown-unknownandwasm32-wasitargets when no default features are enabled. WebAssembly is not officially supported yet, but this is a great first step towards it! - (server, smithy-rs#2540) Implement
PluginPipeline::http_layerwhich allows you to apply atower::Layerto all operations. - (client, aws-sdk-rust#784, @abusch) Implement std::error::Error#source() properly for the service meta Error enum.
- 🐛 (all, smithy-rs#2496) The outputs for event stream operations now implement the
Syncauto-trait. - 🐛 (all, smithy-rs#2495) Streaming operations now emit the request ID at the
debuglog level like their non-streaming counterparts. - 🐛 (client, smithy-rs#2495) Streaming operations now emit the request ID at the
debuglog level like their non-streaming counterparts. - (client, smithy-rs#2507) The
enableNewCrateOrganizationSchemecodegen flag has been removed. If you opted out of the new crate organization scheme, it must be adopted now in order to upgrade (see the upgrade guidance from March 23rd's release). - (client, smithy-rs#2534)
aws_smithy_types::date_time::Formathas been re-exported in service client crates. - 🐛 (server, smithy-rs#2582, smithy-rs#2585) Fix generation of constrained shapes reaching
@sensitiveshapes - 🐛 (server, smithy-rs#2583, smithy-rs#2584) Fix server code generation bug affecting constrained shapes bound with
@httpPayload - (client, smithy-rs#2603) Add a sensitive method to
ParseHttpResponse. When this returns true, logging of the HTTP response body will be suppressed.
Contributors Thank you for your contributions! ❤
- @abusch (aws-sdk-rust#784)
- @eduardomourar (smithy-rs#2254)
Breaking Changes:
- ⚠🎉 (all, smithy-rs#2467) Update MSRV to 1.66.1
- ⚠ (client, smithy-rs#76, smithy-rs#2129) Generic clients no longer expose a
request_id()function on errors. To get request ID functionality, use the SDK code generator. - ⚠ (client, smithy-rs#76, smithy-rs#2129) The
message()andcode()methods on errors have been moved intoProvideErrorMetadatatrait. This trait will need to be imported to continue calling these. - ⚠ (client, smithy-rs#76, smithy-rs#2129, smithy-rs#2075) The
*Errorand*ErrorKindtypes have been combined to make error matching simpler.Example with S3
**Before:** ```rust let result = client .get_object() .bucket(BUCKET_NAME) .key("some-key") .send() .await; match result { Ok(_output) => { /* Do something with the output */ } Err(err) => match err.into_service_error() { GetObjectError { kind, .. } => match kind { GetObjectErrorKind::InvalidObjectState(value) => println!("invalid object state: {:?}", value), GetObjectErrorKind::NoSuchKey(_) => println!("object didn't exist"), } err @ GetObjectError { .. } if err.code() == Some("SomeUnmodeledError") => {} err @ _ => return Err(err.into()), }, } ``` **After:** ```rust // Needed to access the `.code()` function on the error type: use aws_sdk_s3::types::ProvideErrorMetadata; let result = client .get_object() .bucket(BUCKET_NAME) .key("some-key") .send() .await; match result { Ok(_output) => { /* Do something with the output */ } Err(err) => match err.into_service_error() { GetObjectError::InvalidObjectState(value) => { println!("invalid object state: {:?}", value); } GetObjectError::NoSuchKey(_) => { println!("object didn't exist"); } err if err.code() == Some("SomeUnmodeledError") => {} err @ _ => return Err(err.into()), }, } ``` - ⚠ (client, smithy-rs#76, smithy-rs#2129)
aws_smithy_types::Errorhas been renamed toaws_smithy_types::error::ErrorMetadata. - ⚠ (server, smithy-rs#2436) Remove unnecessary type parameter
BfromUpgradeservice. - 🐛⚠ (server, smithy-rs#2382) Smithy members named
sendwere previously renamed tosend_valueat codegen time. These will now be calledsendin the generated code. - ⚠ (client, smithy-rs#2448) The modules in generated client crates have been reorganized. See the Client Crate Reorganization Upgrade Guidance to see how to fix your code after this change.
- ⚠ (server, smithy-rs#2438) Servers can send the
ServerRequestIdin the response headers. Servers need to create their service using the new layer builderServerRequestIdProviderLayer::new_with_response_header:let app = app .layer(&ServerRequestIdProviderLayer::new_with_response_header(HeaderName::from_static("x-request-id")));
New this release:
-
🐛🎉 (client, aws-sdk-rust#740) Fluent builder methods on the client are now marked as deprecated when the related operation is deprecated.
-
🎉 (all, smithy-rs#2398) Add support for the
awsQueryCompatibletrait. This allows services to continue supporting a custom error code (via theawsQueryErrortrait) when the services migrate their protocol fromawsQuerytoawsJson1_0annotated withawsQueryCompatible.Click to expand for more details...
After the migration, services will include an additional header
x-amzn-query-errorin their responses whose value is in the form of<error code>;<error type>. An example response looks something likeHTTP/1.1 400 x-amzn-query-error: AWS.SimpleQueueService.NonExistentQueue;Sender Date: Wed, 08 Sep 2021 23:46:52 GMT Content-Type: application/x-amz-json-1.0 Content-Length: 163 { "__type": "com.amazonaws.sqs#QueueDoesNotExist", "message": "some user-visible message" }<error code>isAWS.SimpleQueueService.NonExistentQueueand<error type>isSender.If an operation results in an error that causes a service to send back the response above, you can access
<error code>and<error type>as follows:match client.some_operation().send().await { Ok(_) => { /* success */ } Err(sdk_err) => { let err = sdk_err.into_service_error(); assert_eq!( error.meta().code(), Some("AWS.SimpleQueueService.NonExistentQueue"), ); assert_eq!(error.meta().extra("type"), Some("Sender")); } } </details>
-
🎉 (client, smithy-rs#2428, smithy-rs#2208)
SdkErrorvariants can now be constructed for easier unit testing. -
🐛 (server, smithy-rs#2441) Fix
FilterByOperationNameplugin. This previous caused services with this applied to fail to compile due to mismatched bounds. -
(client, smithy-rs#2437, aws-sdk-rust#600) Add more client re-exports. Specifically, it re-exports
aws_smithy_http::body::SdkBody,aws_smithy_http::byte_stream::error::Error, andaws_smithy_http::operation::{Request, Response}. -
🐛 (all, smithy-rs#2226) Fix bug in timestamp format resolution. Prior to this fix, the timestamp format may have been incorrect if set on the target instead of on the member.
-
(all, smithy-rs#2226) Add support for offsets when parsing datetimes. RFC3339 date times now support offsets like
-0200 -
(client, aws-sdk-rust#160, smithy-rs#2445) Reconnect on transient errors.
Note: this behavior is disabled by default for generic clients. It can be enabled with
aws_smithy_client::Builder::reconnect_on_transient_errorsIf a transient error (timeout, 500, 503, 503) is encountered, the connection will be evicted from the pool and will not be reused.
-
(all, smithy-rs#2474) Increase Tokio version to 1.23.1 for all crates. This is to address RUSTSEC-2023-0001
New this release:
- 🐛 (server, smithy-rs#920) Fix bug in
OperationExtensionFuturesFuture::pollimplementation
Breaking Changes:
-
⚠ (server, smithy-rs#2161) Remove deprecated service builder, this includes:
- Remove
aws_smithy_http_server::routing::Routerandaws_smithy_http_server::request::RequestParts. - Move the
aws_smithy_http_server::routers::Routertrait andaws_smithy_http_server::routing::RoutingServiceintoaws_smithy_http_server::routing. - Remove the following from the generated SDK:
operation_registry.rsoperation_handler.rsserver_operation_handler_trait.rs
If migration to the new service builder API has not already been completed a brief summary of required changes can be seen in previous release notes and in API documentation of the root crate.
- Remove
New this release:
- 🐛 (server, smithy-rs#2213)
@sparselist shapes and map shapes with constraint traits and with constrained members are now supported - 🐛 (server, smithy-rs#2200) Event streams no longer generate empty error enums when their operations don’t have modeled errors
- (all, smithy-rs#2223)
aws_smithy_types::date_time::DateTime,aws_smithy_types::Blobnow implement theEqandHashtraits - (server, smithy-rs#2223) Code-generated types for server SDKs now implement the
EqandHashtraits when possible
New this release:
- 🐛 (server, smithy-rs#2201) Fix severe bug where a router fails to deserialize percent-encoded query strings, reporting no operation match when there could be one. If your Smithy model uses an operation with a request URI spec containing query string literals, you are affected. This fix was released in
aws-smithy-http-serverv0.53.1.
Breaking Changes:
- ⚠ (client, smithy-rs#2099) The Rust client codegen plugin is now called
rust-client-codegeninstead ofrust-codegen. Be sure to update yoursmithy-build.jsonfiles to refer to the correct plugin name. - ⚠ (client, smithy-rs#2099) Client codegen plugins need to define a service named
software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator(this is the new file name for the plugin definition inresources/META-INF/services). - ⚠ (server, smithy-rs#2099) Server codegen plugins need to define a service named
software.amazon.smithy.rust.codegen.server.smithy.customize.ServerCodegenDecorator(this is the new file name for the plugin definition inresources/META-INF/services).
New this release:
- 🐛 (server, smithy-rs#2103) In 0.52,
@length-constrained collection shapes whose members are not constrained made the server code generator crash. This has been fixed. - (server, smithy-rs#1879) Servers support the
@defaulttrait: models can specify default values. Default values will be automatically supplied when not manually set. - (server, smithy-rs#2131) The constraint
@lengthon non-streaming blob shapes is supported. - 🐛 (client, smithy-rs#2150) Fix bug where string default values were not supported for endpoint parameters
- 🐛 (all, smithy-rs#2170, aws-sdk-rust#706) Remove the webpki-roots feature from
hyper-rustls - 🐛 (server, smithy-rs#2054) Servers can generate a unique request ID and use it in their handlers.
Breaking Changes:
-
⚠🎉 (all, smithy-rs#1938, @jjantdev) Upgrade Rust MSRV to 1.62.1
-
⚠🎉 (server, smithy-rs#1199, smithy-rs#1342, smithy-rs#1401, smithy-rs#1998, smithy-rs#2005, smithy-rs#2028, smithy-rs#2034, smithy-rs#2036) Constraint traits in server SDKs are beginning to be supported. The following are now supported:
- The
lengthtrait onstringshapes. - The
lengthtrait onmapshapes. - The
lengthtrait onlistshapes. - The
rangetrait onbyteshapes. - The
rangetrait onshortshapes. - The
rangetrait onintegershapes. - The
rangetrait onlongshapes. - The
patterntrait onstringshapes.
Upon receiving a request that violates the modeled constraints, the server SDK will reject it with a message indicating why.
Unsupported (constraint trait, target shape) combinations will now fail at code generation time, whereas previously they were just ignored. This is a breaking change to raise awareness in service owners of their server SDKs behaving differently than what was modeled. To continue generating a server SDK with unsupported constraint traits, set
codegen.ignoreUnsupportedConstraintstotruein yoursmithy-build.json.{ ... "rust-server-codegen": { ... "codegen": { "ignoreUnsupportedConstraints": true } } } - The
-
⚠🎉 (server, smithy-rs#1342, smithy-rs#1119) Server SDKs now generate "constrained types" for constrained shapes. Constrained types are newtypes that encapsulate the modeled constraints. They constitute a widespread pattern to guarantee domain invariants and promote correctness in your business logic. So, for example, the model:
@length(min: 1, max: 69) string NiceString
will now render a
struct NiceString(String). Instantiating aNiceStringis a fallible operation:let data: String = ... ; let nice_string = NiceString::try_from(data).expect("data is not nice");
A failed attempt to instantiate a constrained type will yield a
ConstraintViolationerror type you may want to handle. This type's API is subject to change.Constrained types guarantee, by virtue of the type system, that your service's operation outputs adhere to the modeled constraints. To learn more about the motivation for constrained types and how they work, see the RFC.
If you'd like to opt-out of generating constrained types, you can set
codegen.publicConstrainedTypestofalse. Note that if you do, the generated server SDK will still honor your operation input's modeled constraints upon receiving a request, but will not help you in writing business logic code that adheres to the constraints, and will not prevent you from returning responses containing operation outputs that violate said constraints.{ ... "rust-server-codegen": { ... "codegen": { "publicConstrainedTypes": false } } } -
🐛⚠🎉 (server, smithy-rs#1714, smithy-rs#1342) Structure builders in server SDKs have undergone significant changes.
The API surface has been reduced. It is now simpler and closely follows what you would get when using the
derive_buildercrate:- Builders no longer have
set_*methods taking inOption<T>. You must use the unprefixed method, named exactly after the structure's field name, and taking in a value whose type matches exactly that of the structure's field. - Builders no longer have convenience methods to pass in an element for a field whose type is a vector or a map. You must pass in the entire contents of the collection up front.
- Builders no longer implement
PartialEq.
Bug fixes:
- Builders now always fail to build if a value for a
requiredmember is not provided. Previously, builders were falling back to a default value (e.g.""forStrings) for some shapes. This was a bug.
Additions:
- A structure
Structurewith builderBuildernow implementsTryFrom<Builder> for StructureorFrom<Builder> for Structure, depending on whether the structure is constrained or not, respectively.
To illustrate how to migrate to the new API, consider the example model below.
structure Pokemon { @required name: String, @required description: String, @required evolvesTo: PokemonList } list PokemonList { member: Pokemon }
In the Rust code below, note the references calling out the changes described in the numbered list above.
Before:
let eevee_builder = Pokemon::builder() // (1) `set_description` takes in `Some<String>`. .set_description(Some("Su código genético es muy inestable. Puede evolucionar en diversas razas de Pokémon.".to_owned())) // (2) Convenience method to add one element to the `evolvesTo` list. .evolves_to(vaporeon) .evolves_to(jolteon) .evolves_to(flareon); // (3) Builder types can be compared. assert_ne!(eevee_builder, Pokemon::builder()); // (4) Builds fine even though we didn't provide a value for `name`, which is `required`! let _eevee = eevee_builder.build();
After:
let eevee_builder = Pokemon::builder() // (1) `set_description` no longer exists. Use `description`, which directly takes in `String`. .description("Su código genético es muy inestable. Puede evolucionar en diversas razas de Pokémon.".to_owned()) // (2) Convenience methods removed; provide the entire collection up front. .evolves_to(vec![vaporeon, jolteon, flareon]); // (3) Binary operation `==` cannot be applied to `pokemon::Builder`. // assert_ne!(eevee_builder, Pokemon::builder()); // (4) `required` member `name` was not set. // (5) Builder type can be fallibly converted to the structure using `TryFrom` or `TryInto`. let _error = Pokemon::try_from(eevee_builder).expect_err("name was not provided");
- Builders no longer have
-
⚠🎉 (server, smithy-rs#1620, smithy-rs#1666, smithy-rs#1731, smithy-rs#1736, smithy-rs#1753, smithy-rs#1738, smithy-rs#1782, smithy-rs#1829, smithy-rs#1837, smithy-rs#1891, smithy-rs#1840, smithy-rs#1844, smithy-rs#1858, smithy-rs#1930, smithy-rs#1999, smithy-rs#2003, smithy-rs#2008, smithy-rs#2010, smithy-rs#2019, smithy-rs#2020, smithy-rs#2021, smithy-rs#2038, smithy-rs#2039, smithy-rs#2041) ### Plugins/New Service Builder API
The
Routerstruct has been replaced by a newServicelocated at the root of the generated crate. Its name coincides with the same name as the Smithy service you are generating.use pokemon_service_server_sdk::PokemonService;
The new service builder infrastructure comes with a
Pluginsystem which supports middleware onsmithy-rs. See the mididleware documentation and the API documentation for more details.Usage of the new service builder API:
// Apply a sequence of plugins using `PluginPipeline`. let plugins = PluginPipeline::new() // Apply the `PrintPlugin`. // This is a dummy plugin found in `rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/plugin.rs` .print() // Apply the `InstrumentPlugin` plugin, which applies `tracing` instrumentation. .instrument(); // Construct the service builder using the `plugins` defined above. let app = PokemonService::builder_with_plugins(plugins) // Assign all the handlers. .get_pokemon_species(get_pokemon_species) .get_storage(get_storage) .get_server_statistics(get_server_statistics) .capture_pokemon(capture_pokemon) .do_nothing(do_nothing) .check_health(check_health) // Construct the `PokemonService`. .build() // If handlers are missing a descriptive error will be provided. .expect("failed to build an instance of `PokemonService`");
See the
rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/binfolder for various working examples.Previously, we only supported one
Extensionas an additional argument provided to the handler. This number has been increased to 8 and the argument type has been broadened to any struct which implements theFromPartstrait. The trait is publicly exported and therefore provides customers with the ability to extend the domain of the handlers.As noted, a ubiqutious example of a struct that implements
FromPartsis theExtensionstruct, which extracts state from theExtensionstypemap of ahttp::Request. A new example is theConnectInfostruct which allows handlers to access the connection data. See therust-runtime/aws-smithy-http-server/examples/pokemon-service/src/bin/pokemon-service-connect-info.rsexample.fn get_pokemon_species( input: GetPokemonSpeciesInput, state: Extension<State>, address: ConnectInfo<SocketAddr> ) -> Result<GetPokemonSpeciesOutput, GetPokemonSpeciesError> { todo!() }
In addition to the
ConnectInfoextractor, we also have added lambda extractors which are feature gated withaws-lambda.FromPartsdocumentation has been added.New sections to have been added to the server side of the book.
These include:
This release also introduces extensive documentation at the root of the generated crate. For best results compile documentation with
cargo +nightly doc --open.The existing service builder infrastructure,
OperationRegistryBuilder/OperationRegistry/Router, is now deprecated. Customers should migrate to the newer scheme described above. The deprecated types will be removed in a future release. -
⚠ (client, smithy-rs#1875) Replace bool with enum for a function parameter of
label::fmt_string. -
⚠ (all, smithy-rs#1980) aws_smithy_types_convert::date_time::DateTimeExt::to_chrono_utc returns a Result<>
-
⚠ (client, smithy-rs#1926, smithy-rs#1819) Several breaking changes have been made to errors. See the upgrade guide for more information.
-
🐛⚠ (server, smithy-rs#1714, smithy-rs#1342, smithy-rs#1860) Server SDKs now correctly reject operation inputs that don't set values for
requiredstructure members. Previously, in some scenarios, server SDKs would accept the request and set a default value for the member (e.g.""for aString), even when the member shape did not have Smithy IDL v2'sdefaulttrait attached. Thedefaulttrait is still unsupported. -
⚠ (client, smithy-rs#1945) Generate enums that guide the users to write match expressions in a forward-compatible way. Before this change, users could write a match expression against an enum in a non-forward-compatible way:
match some_enum { SomeEnum::Variant1 => { /* ... */ }, SomeEnum::Variant2 => { /* ... */ }, Unknown(value) if value == "NewVariant" => { /* ... */ }, _ => { /* ... */ }, }
This code can handle a case for "NewVariant" with a version of SDK where the enum does not yet include
SomeEnum::NewVariant, but breaks with another version of SDK where the enum definesSomeEnum::NewVariantbecause the execution will hit a different match arm, i.e. the last one. After this change, users are guided to write the above match expression as follows:match some_enum { SomeEnum::Variant1 => { /* ... */ }, SomeEnum::Variant2 => { /* ... */ }, other @ _ if other.as_str() == "NewVariant" => { /* ... */ }, _ => { /* ... */ }, }
This is forward-compatible because the execution will hit the second last match arm regardless of whether the enum defines
SomeEnum::NewVariantor not. -
⚠ (client, smithy-rs#1984, smithy-rs#1496) Functions on
aws_smithy_http::endpoint::Endpointnow return aResultinstead of panicking. -
⚠ (client, smithy-rs#1984, smithy-rs#1496)
Endpoint::mutablenow takesimpl AsRef<str>instead ofUri. For the old functionality, useEndpoint::mutable_uri. -
⚠ (client, smithy-rs#1984, smithy-rs#1496)
Endpoint::immutablenow takesimpl AsRef<str>instead ofUri. For the old functionality, useEndpoint::immutable_uri. -
⚠ (server, smithy-rs#1982) RestJson1 server SDKs now serialize the full shape ID (including namespace) in operation error responses.
Example server error response before:
HTTP/1.1 400 Bad Request content-type: application/json x-amzn-errortype: InvalidRequestException ...Example server error response now:
HTTP/1.1 400 Bad Request content-type: application/json x-amzn-errortype: com.example.service#InvalidRequestException ... -
⚠ (server, smithy-rs#2035) All types that are exclusively relevant within the context of an AWS Lambda function are now gated behind the
aws-lambdafeature flag.This will reduce the number of dependencies (and improve build times) for users that are running their Smithy services in non-serverless environments (e.g. via
hyper). -
⚠ (all, smithy-rs#1983, smithy-rs#2029) Implementation of the Debug trait for container shapes now redacts what is printed per the sensitive trait.
-
⚠ (client, smithy-rs#2065)
SdkBodycallbacks have been removed. If you were using these, please file an issue so that we can better understand your use-case and provide the support you need. -
⚠ (client, smithy-rs#2063) Added SmithyEndpointStage which can be used to set an endpoint for smithy-native clients
-
⚠ (all, smithy-rs#1989) The Unit type for a Union member is no longer rendered. The serializers and parsers generated now function accordingly in the absence of the inner data associated with the Unit type.
New this release:
- 🎉 (all, smithy-rs#1929) Upgrade Smithy to v1.26
- 🎉 (client, smithy-rs#2044, smithy-rs#371) Fixed and improved the request
tracingspan hierarchy to improve log messages, profiling, and debuggability. - 🐛 (all, smithy-rs#1847) Support Sigv4 signature generation on PowerPC 32 and 64 bit. This architecture cannot compile
ring, so the implementation has been updated to rely onhamc+sha2to achive the same result with broader platform compatibility and higher performance. We also updated the CI which is now running as many tests as possible against i686 and PowerPC 32 and 64 bit. - 🐛 (server, smithy-rs#1910)
aws_smithy_http_server::routing::Routeris exported from the crate root again. This reverts unintentional breakage that was introduced inaws-smithy-http-serverv0.51.0 only. - 🐛 (client, smithy-rs#1903, smithy-rs#1902) Fix bug that can cause panics in paginators
- (client, smithy-rs#1919) Operation metadata is now added to the property bag before sending requests allowing middlewares to behave differently depending on the operation being sent.
- (all, smithy-rs#1907) Fix cargo audit issue on chrono.
- 🐛 (client, smithy-rs#1957) It was previously possible to send requests without setting query parameters modeled as required. Doing this may cause a service to interpret a request incorrectly instead of just sending back a 400 error. Now, when an operation has query parameters that are marked as required, the omission of those query parameters will cause a BuildError, preventing the invalid operation from being sent.
- (all, smithy-rs#1972) Upgrade to Smithy 1.26.2
- (all, smithy-rs#2011, @lsr0) Make generated enum
values()functions callable in const contexts. - (client, smithy-rs#2064, aws-sdk-rust#632) Clients now default max idle connections to 70 (previously unlimited) to reduce the likelihood of hitting max file handles in AWS Lambda.
- (client, smithy-rs#2057, smithy-rs#371) Add more
tracingevents to signing and event streams
Contributors Thank you for your contributions! ❤
- @jjantdev (smithy-rs#1938)
- @lsr0 (smithy-rs#2011)
Breaking Changes:
- ⚠ (all, smithy-rs#1825) Bump MSRV to be 1.62.0.
- ⚠ (server, smithy-rs#1825) Bump pyo3 and pyo3-asyncio from 0.16.x to 0.17.0 for aws-smithy-http-server-python.
- ⚠ (client, smithy-rs#1811) Replace all usages of
AtomicU64withAtomicUsizeto support 32bit targets. - ⚠ (server, smithy-rs#1803) Mark
operationandoperation_handlermodules as private in the generated server crate. Both modules did not contain any public types, therefore there should be no actual breakage when updating. - ⚠ (client, smithy-rs#1740, smithy-rs#256) A large list of breaking changes were made to accomodate default timeouts in the AWS SDK. See the smithy-rs upgrade guide for a full list of breaking changes and how to resolve them.
- ⚠ (server, smithy-rs#1829) Remove
Protocolenum, removing an obstruction to extending smithy to third-party protocols. - ⚠ (server, smithy-rs#1829) Convert the
protocolargument onPyMiddlewares::newconstructor to a type parameter. - ⚠ (server, smithy-rs#1753)
aws_smithy_http_server::routing::Routeris no longer exported from the crate root. This was unintentional breakage that will be reverted in the next release.
New this release:
- (server, smithy-rs#1811) Replace all usages of
AtomicU64withAtomicUsizeto support 32bit targets. - 🐛 (all, smithy-rs#1802) Sensitive fields in errors now respect @sensitive trait and are properly redacted.
- (server, smithy-rs#1727, @GeneralSwiss) Pokémon Service example code now runs clippy during build.
- (server, smithy-rs#1734) Implement support for pure Python request middleware. Improve idiomatic logging support over tracing.
- 🐛 (client, aws-sdk-rust#620, smithy-rs#1748) Paginators now stop on encountering a duplicate token by default rather than panic. This behavior can be customized by toggling the
stop_on_duplicate_tokenproperty on the paginator before callingsend. - 🐛 (all, smithy-rs#1817, @ethyi) Update aws-types zeroize to flexible version to prevent downstream version conflicts.
- (all, smithy-rs#1852, @ogudavid) Enable local maven repo dependency override.
Contributors Thank you for your contributions! ❤
- @GeneralSwiss (smithy-rs#1727)
- @ethyi (smithy-rs#1817)
- @ogudavid (smithy-rs#1852)
Breaking Changes:
- ⚠ (client, smithy-rs#1603, aws-sdk-rust#586)
aws_smithy_types::RetryConfigno longer implementsDefault, and itsnewfunction has been replaced withstandard. - ⚠ (client, smithy-rs#1603, aws-sdk-rust#586) Client creation now panics if retries or timeouts are enabled without an async sleep implementation.
If you're using the Tokio runtime and have the
rt-tokiofeature enabled (which is enabled by default), then you shouldn't notice this change at all. Otherwise, if using something other than Tokio as the async runtime, theAsyncSleeptrait must be implemented, and that implementation given to the config builder via thesleep_implmethod. Alternatively, retry can be explicitly turned off by settingmax_attemptsto 1, which will result in successful client creation without an async sleep implementation. - ⚠ (client, smithy-rs#1603, aws-sdk-rust#586) The
default_async_sleepmethod on theClientbuilder has been removed. The default async sleep is wired up by default if none is provided. - ⚠ (client, smithy-rs#976, smithy-rs#1710) Removed the need to generate operation output and retry aliases in codegen.
- ⚠ (client, smithy-rs#1715, smithy-rs#1717)
ClassifyResponsewas renamed toClassifyRetryand is no longer implemented for the unit type. - ⚠ (client, smithy-rs#1715, smithy-rs#1717) The
with_retry_policyandretry_policyfunctions onaws_smithy_http::operation::Operationhave been renamed towith_retry_classifierandretry_classifierrespectively. Public memberretry_policyonaws_smithy_http::operation::Partshas been renamed toretry_classifier.
New this release:
-
🎉 (client, smithy-rs#1647, smithy-rs#1112) Implemented customizable operations per RFC-0017.
Before this change, modifying operations before sending them required using lower-level APIs:
let input = SomeOperationInput::builder().some_value(5).build()?; let operation = { let op = input.make_operation(&service_config).await?; let (request, response) = op.into_request_response(); let request = request.augment(|req, _props| { req.headers_mut().insert( HeaderName::from_static("x-some-header"), HeaderValue::from_static("some-value") ); Result::<_, Infallible>::Ok(req) })?; Operation::from_parts(request, response) }; let response = smithy_client.call(operation).await?;
Now, users may easily modify operations before sending with the
customizemethod:let response = client.some_operation() .some_value(5) .customize() .await? .mutate_request(|mut req| { req.headers_mut().insert( HeaderName::from_static("x-some-header"), HeaderValue::from_static("some-value") ); }) .send() .await?;
-
(client, smithy-rs#1735, @vojtechkral) Lower log level of two info-level log messages.
-
(all, smithy-rs#1710) Added
writableproperty toRustTypeandRuntimeTypethat returns them inWritableform -
(all, smithy-rs#1680, @ogudavid) Smithy IDL v2 mixins are now supported
-
🐛 (client, smithy-rs#1715, smithy-rs#1717) Generated clients now retry transient errors without replacing the retry policy.
-
🐛 (all, smithy-rs#1725, @sugmanue) Correctly determine nullability of members in IDLv2 models
Contributors Thank you for your contributions! ❤
- @ogudavid (smithy-rs#1680)
- @sugmanue (smithy-rs#1725)
- @vojtechkral (smithy-rs#1735)
Breaking Changes:
-
⚠🎉 (client, smithy-rs#1598) Previously, the config customizations that added functionality related to retry configs, timeout configs, and the async sleep impl were defined in the smithy codegen module but were being loaded in the AWS codegen module. They have now been updated to be loaded during smithy codegen. The affected classes are all defined in the
software.amazon.smithy.rust.codegen.smithy.customizationsmodule of smithy codegen.` This change does not affect the generated code.These classes have been removed:
RetryConfigDecoratorSleepImplDecoratorTimeoutConfigDecorator
These classes have been renamed:
RetryConfigProviderConfigis nowRetryConfigProviderCustomizationPubUseRetryConfigis nowPubUseRetryConfigGeneratorSleepImplProviderConfigis nowSleepImplProviderCustomizationTimeoutConfigProviderConfigis nowTimeoutConfigProviderCustomization
-
⚠🎉 (all, smithy-rs#1635, smithy-rs#1416, @weihanglo) Support granular control of specifying runtime crate versions.
For code generation, the field
runtimeConfig.versionin smithy-build.json has been removed. The new fieldruntimeConfig.versionsis an object whose keys are runtime crate names (e.g.aws-smithy-http), and values are user-specified versions.If you previously set
version = "DEFAULT", the migration path is simple. By settingversionswith an empty object or just not setting it at all, the version number of the code generator will be used as the version for all runtime crates.If you specified a certain version such as
version = "0.47.0", you can migrate to a special reserved keyDEFAULT`. The equivalent JSON config would look like:{ "runtimeConfig": { "versions": { "DEFAULT": "0.47.0" } } }Then all runtime crates are set with version 0.47.0 by default unless overridden by specific crates. For example,
{ "runtimeConfig": { "versions": { "DEFAULT": "0.47.0", "aws-smithy-http": "0.47.1" } } }implies that we're using
aws-smithy-http0.47.1 specifically. For the rest of the crates, it will default to 0.47.0. -
⚠ (all, smithy-rs#1623, @ogudavid) Remove @sensitive trait tests which applied trait to member. The ability to mark members with @sensitive was removed in Smithy 1.22.
-
⚠ (server, smithy-rs#1544) Servers now allow requests' ACCEPT header values to be:
*/*type/*type/subtype
-
🐛⚠ (all, smithy-rs#1274) Lossy converters into integer types for
aws_smithy_types::Numberhave been removed. Lossy converters into floating point types foraws_smithy_types::Numberhave been suffixed with_lossy. If you were directly using the integer lossy converters, we recommend you use the safe converters. Before:fn f1(n: aws_smithy_types::Number) { let foo: f32 = n.to_f32(); // Lossy conversion! let bar: u32 = n.to_u32(); // Lossy conversion! }
After:
fn f1(n: aws_smithy_types::Number) { use std::convert::TryInto; // Unnecessary import if you're using Rust 2021 edition. let foo: f32 = n.try_into().expect("lossy conversion detected"); // Or handle the error instead of panicking. // You can still do lossy conversions, but only into floating point types. let foo: f32 = n.to_f32_lossy(); // To lossily convert into integer types, use an `as` cast directly. let bar: u32 = n as u32; // Lossy conversion! }
-
⚠ (all, smithy-rs#1699) Bump MSRV from 1.58.1 to 1.61.0 per our policy.
New this release:
-
🎉 (all, smithy-rs#1623, @ogudavid) Update Smithy dependency to 1.23.1. Models using version 2.0 of the IDL are now supported.
-
🎉 (server, smithy-rs#1551, @hugobast) There is a canonical and easier way to run smithy-rs on Lambda see example.
-
🐛 (all, smithy-rs#1623, @ogudavid) Fix detecting sensitive members through their target shape having the @sensitive trait applied.
-
(all, smithy-rs#1623, @ogudavid) Fix SetShape matching needing to occur before ListShape since it is now a subclass. Sets were deprecated in Smithy 1.22.
-
(all, smithy-rs#1623, @ogudavid) Fix Union shape test data having an invalid empty union. Break fixed from Smithy 1.21 to Smithy 1.22.
-
(all, smithy-rs#1612, @unexge) Add codegen version to generated package metadata
-
(client, aws-sdk-rust#609) It is now possible to exempt specific operations from XML body root checking. To do this, add the
AllowInvalidXmlRoottrait to the output struct of the operation you want to exempt.
Contributors Thank you for your contributions! ❤
- @hugobast (smithy-rs#1551)
- @ogudavid (smithy-rs#1623)
- @unexge (smithy-rs#1612)
- @weihanglo (smithy-rs#1416, smithy-rs#1635)
Breaking Changes:
- ⚠🎉 (all, smithy-rs#1570, @weihanglo) Support @deprecated trait for aggregate shapes
- ⚠ (all, smithy-rs#1157) Rename EventStreamInput to EventStreamSender
- ⚠ (all, smithy-rs#1157) The type of streaming unions that contain errors is generated without those errors.
Errors in a streaming union
Unionare generated as members of the typeUnionError. Taking Transcribe as an example, theAudioStreamstreaming union generates, in the client, both theAudioStreamtype:and its error type,pub enum AudioStream { AudioEvent(crate::model::AudioEvent), Unknown, }
pub struct AudioStreamError { /// Kind of error that occurred. pub kind: AudioStreamErrorKind, /// Additional metadata about the error, including error code, message, and request ID. pub(crate) meta: aws_smithy_types::Error, }
AudioStreamErrorKindcontains all error variants for the union. Before, the generated code looked as:pub enum AudioStream { AudioEvent(crate::model::AudioEvent), ... all error variants, Unknown, }
- ⚠ (all, smithy-rs#1157)
aws_smithy_http::event_stream::EventStreamSenderandaws_smithy_http::event_stream::Receiverare now generic over<T, E>, whereTis a streaming union andEthe union's errors. This means that event stream errors are now sent asErrof the union's error type. With this example model:Before:@streaming union Event { throttlingError: ThrottlingError } @error("client") structure ThrottlingError {}
After:stream! { yield Ok(Event::ThrottlingError ...) }
An example from the SDK is in transcribe streaming.stream! { yield Err(EventError::ThrottlingError ...) }
New this release:
- 🎉 (all, smithy-rs#1482) Update codegen to generate support for flexible checksums.
- (all, smithy-rs#1520) Add explicit cast during JSON deserialization in case of custom Symbol providers.
- (all, smithy-rs#1578, @lkts) Change detailed logs in CredentialsProviderChain from info to debug
- (all, smithy-rs#1573, smithy-rs#1569) Non-streaming struct members are now marked
#[doc(hidden)]since they will be removed in the future
Contributors Thank you for your contributions! ❤
- @lkts (smithy-rs#1578)
- @weihanglo (smithy-rs#1570)
New this release:
- 🎉 (all, aws-sdk-rust#567) Updated the smithy client's retry behavior to allow for a configurable initial backoff. Previously, the initial backoff
(named
rin the code) was set to 2 seconds. This is not an ideal default for services that expect clients to quickly retry failed request attempts. Now, users can set quicker (or slower) backoffs according to their needs. - (all, smithy-rs#1263) Add checksum calculation and validation wrappers for HTTP bodies.
- (all, smithy-rs#1263)
aws_smithy_http::header::append_merge_header_maps, a function for merging twoHeaderMaps, is now public.
Breaking Changes:
- ⚠ (smithy-rs#932) Replaced use of
pin-projectwith equivalentpin-project-lite. For pinned enum tuple variants and tuple structs, this change requires that we switch to using enum struct variants and regular structs. Most of the structs and enums that were updated had only private fields/variants and so have the same public API. However, this change does affect the public API ofaws_smithy_http_tower::map_request::MapRequestFuture<F, E>. TheInnerandReadyvariants contained a single value. Each have been converted to struct variants and the inner value is now accessible by theinnerfield instead of the0field.
New this release:
- 🎉 (smithy-rs#1411, smithy-rs#1167) Upgrade to Gradle 7. This change is not a breaking change, however, users of smithy-rs will need to switch to JDK 17
- 🐛 (smithy-rs#1505, @kiiadi) Fix issue with codegen on Windows where module names were incorrectly determined from filenames
Contributors Thank you for your contributions! ❤
- @kiiadi (smithy-rs#1505)
New this release:
- (smithy-rs#1460) Fix a potential bug with
ByteStream's implementation offutures_core::stream::Streamand add helpful error messages for users on 32-bit systems that try to stream HTTP bodies larger than 4.29Gb. - 🐛 (smithy-rs#1427, smithy-rs#1465, smithy-rs#1459) Fix RustWriter bugs for
rustTemplateanddocsutility methods - 🐛 (aws-sdk-rust#554) Requests to Route53 that return
ResourceIds often come with a prefix. When passing those IDs directly into another request, the request would fail unless they manually stripped the prefix. Now, when making a request with a prefixed ID, the prefix will be stripped automatically.
New this release:
- 🎉 (smithy-rs#1381, @alonlud) Add ability to sign a request with all headers, or to change which headers are excluded from signing
- 🎉 (smithy-rs#1390) Add method
ByteStream::into_async_read. This makes it easy to convertByteStreams into a struct implementingtokio:io::AsyncRead. Available on crate featurert-tokioonly. - (smithy-rs#1404, @petrosagg) Add ability to specify a different rust crate name than the one derived from the package name
- (smithy-rs#1404, @petrosagg) Switch to RustCrypto's implementation of MD5.
Contributors Thank you for your contributions! ❤
- @alonlud (smithy-rs#1381)
- @petrosagg (smithy-rs#1404)
Breaking Changes:
-
⚠🎉 (aws-sdk-rust#494, aws-sdk-rust#519) The
aws_smithy_http::byte_stream::bytestream_util::FsBuilderhas been updated to allow for easier creation of multi-part requests.FsBuilder::offsetis a new method allowing users to specify an offset to start reading a file from.FsBuilder::file_sizehas been reworked intoFsBuilder::lengthand is now used to specify the amount of data to read.
With these two methods, it's now simple to create a
ByteStreamthat will read a single "chunk" of a file. The example below demonstrates how you could divide a singleFileinto consecutive chunks to create multipleByteStreams.let example_file_path = Path::new("/example.txt"); let example_file_size = tokio::fs::metadata(&example_file_path).await.unwrap().len(); let chunks = 6; let chunk_size = file_size / chunks; let mut byte_streams = Vec::new(); for i in 0..chunks { let length = if i == chunks - 1 { // If we're on the last chunk, the length to read might be less than a whole chunk. // We substract the size of all previous chunks from the total file size to get the // size of the final chunk. file_size - (i * chunk_size) } else { chunk_size }; let byte_stream = ByteStream::read_from() .path(&file_path) .offset(i * chunk_size) .length(length) .build() .await?; byte_streams.push(byte_stream); } for chunk in byte_streams { // Make requests to a service }
New this release:
- (smithy-rs#1352) Log a debug event when a retry is going to be peformed
- (smithy-rs#1332, @82marbag) Update generated crates to Rust 2021
Contributors Thank you for your contributions! ❤
- @82marbag (smithy-rs#1332)
Breaking Changes:
- ⚠ (smithy-rs#1318) Bump MSRV from 1.56.1 to 1.58.1 per our "two versions behind" policy.
New this release:
- (smithy-rs#1307) Add new trait for HTTP body callbacks. This is the first step to enabling us to implement optional checksum verification of requests and responses.
- (smithy-rs#1330) Upgrade to Smithy 1.21.0
Breaking Changes:
- ⚠ (aws-sdk-rust#490) Update all runtime crates to edition 2021
New this release:
- (smithy-rs#1262, @liubin) Fix link to Developer Guide in crate's README.md
- (smithy-rs#1301, @benesch) Update urlencoding crate to v2.1.0
Contributors Thank you for your contributions! ❤
- @benesch (smithy-rs#1301)
- @liubin (smithy-rs#1262)
Breaking Changes:
-
⚠ (aws-sdk-rust#406)
aws_types::config::Confighas been renamed toaws_types:sdk_config::SdkConfig. This is to better differentiate it from service-specific configs likeaws_s3_sdk::Config. If you were creating shared configs withaws_config::load_from_env(), then you don't have to do anything. If you were directly referring to a shared config, update yourusestatements andstructnames.Before:
use aws_types::config::Config; fn main() { let config = Config::builder() // config builder methods... .build() .await; }
After:
use aws_types::SdkConfig; fn main() { let config = SdkConfig::builder() // config builder methods... .build() .await; }
-
⚠ (smithy-rs#724) Timeout configuration has been refactored a bit. If you were setting timeouts through environment variables or an AWS profile, then you shouldn't need to change anything. Take note, however, that we don't currently support HTTP connect, read, write, or TLS negotiation timeouts. If you try to set any of those timeouts in your profile or environment, we'll log a warning explaining that those timeouts don't currently do anything.
If you were using timeouts programmatically, you'll need to update your code. In previous versions, timeout configuration was stored in a single
TimeoutConfigstruct. In this new version, timeouts have been broken up into several different config structs that are then collected in atimeout::Configstruct. As an example, to get the API per-attempt timeout in previous versions you would access it with<your TimeoutConfig>.api_call_attempt_timeout()and in this new version you would access it with<your timeout::Config>.api.call_attempt_timeout(). We also made some unimplemented timeouts inaccessible in order to avoid giving users the impression that setting them had an effect. We plan to re-introduce them once they're made functional in a future update.
New this release:
- (smithy-rs#1225)
DynMiddlewareis nowcloneable - (smithy-rs#1257) HTTP request property bag now contains list of desired HTTP versions to use when making requests. This list is not currently used but will be in an upcoming update.
Breaking Changes:
- ⚠ (smithy-rs#1197)
aws_smithy_types::retry::RetryKindhad itsNotRetryablevariant split intoUnretryableFailureandUnnecessary. If you implement theClassifyResponse, then successful responses need to returnUnnecessary, and failures that shouldn't be retried need to returnUnretryableFailure. - ⚠ (smithy-rs#1209)
aws_smithy_types::primitive::Encoderis now a struct rather than an enum, but its usage remains the same. - ⚠ (smithy-rs#1217)
ClientBuilderhelpersrustls()andnative_tls()now returnDynConnectorand use dynamic dispatch rather than returning their concrete connector type that would allow static dispatch. If static dispatch is desired, then manually construct a connector to give to the builder. For example, for rustls:builder.connector(Adapter::builder().build(aws_smithy_client::conns::https()))(whereAdapteris inaws_smithy_client::hyper_ext).
New this release:
- 🐛 (smithy-rs#1197) Fixed a bug that caused clients to eventually stop retrying. The cross-request retry allowance wasn't being reimbursed upon receiving a successful response, so once this allowance reached zero, no further retries would ever be attempted.
Breaking Changes:
-
⚠ (smithy-rs#1144) Some APIs required that timeout configuration be specified with an
aws_smithy_client::timeout::Settingsstruct while others required anaws_smithy_types::timeout::TimeoutConfigstruct. Both were equivalent. Nowaws_smithy_types::timeout::TimeoutConfigis used everywhere andaws_smithy_client::timeout::Settingshas been removed. Here's how to migrate code your code that depended ontimeout::Settings:The old way:
let timeout = timeout::Settings::new() .with_connect_timeout(Duration::from_secs(1)) .with_read_timeout(Duration::from_secs(2));
The new way:
// This example is passing values, so they're wrapped in `Option::Some`. You can disable a timeout by passing `None`. let timeout = TimeoutConfig::new() .with_connect_timeout(Some(Duration::from_secs(1))) .with_read_timeout(Some(Duration::from_secs(2)));
-
⚠ (smithy-rs#1085) Moved the following re-exports into a
typesmodule for all services:<service>::AggregatedBytes-><service>::types::AggregatedBytes<service>::Blob-><service>::types::Blob<service>::ByteStream-><service>::types::ByteStream<service>::DateTime-><service>::types::DateTime<service>::SdkError-><service>::types::SdkError
-
⚠ (smithy-rs#1085)
AggregatedBytesandByteStreamare now only re-exported if the service has streaming operations, andBlob/DateTimeare only re-exported if the service uses them. -
⚠ (smithy-rs#1130) MSRV increased from
1.54to1.56.1per our 2-behind MSRV policy.
New this release:
- (smithy-rs#1144)
MakeConnectorFn,HttpConnector, andHttpSettingshave been moved fromaws_config::provider_configtoaws_smithy_client::http_connector. This is in preparation for a later update that will change how connectors are created and configured. - (smithy-rs#1123) Refactor
Documentshape parser generation - (smithy-rs#1085) The
ClientandConfigre-exports now have their documentation inlined in the service docs
New this release:
- (smithy-rs#1087) Improve docs on
Endpoint::{mutable, immutable} - (smithy-rs#1118) SDK examples now come from
awsdocs/aws-doc-sdk-examplesrather than fromsmithy-rs - (smithy-rs#1114, @mchoicpe-amazon) Provide SigningService creation via owned String
Contributors Thank you for your contributions! ❤
- @mchoicpe-amazon (smithy-rs#1114)
Changes only impact generated AWS SDK
Changes only impact generated AWS SDK
New this release:
- (smithy-rs#1053) Upgraded Smithy to 1.16.1
- 🐛 (smithy-rs#1069) Fix broken link to
RetryModein client docs - 🐛 (smithy-rs#1069) Fix several doc links to raw identifiers (identifiers excaped with
r#) - 🐛 (smithy-rs#1069) Reduce dependency recompilation in local dev
- 🐛 (aws-sdk-rust#405, smithy-rs#1083) Fixed paginator bug impacting EC2 describe VPCs (and others)
New this release:
- 🐛 (smithy-rs#1054, aws-sdk-rust#391) Fix critical paginator bug where an empty outputToken lead to a never ending stream.
Breaking Changes:
- ⚠ (smithy-rs#990) Codegen will no longer produce builders and clients with methods that take
impl Into<T>except for strings and boxed types. - ⚠ (smithy-rs#1003) The signature of
aws_smithy_protocol_test::validate_headerswas made more flexible but may require adjusting invocations slightly.
New this release:
- 🎉 (aws-sdk-rust#47, smithy-rs#1006) Add support for paginators! Paginated APIs now include
.into_paginator()and (when supported).into_paginator().items()to enable paginating responses automatically. The paginator API should be considered in preview and is subject to change pending customer feedback. - 🐛 (aws-sdk-rust#357) Generated docs will convert
<a>tags with nohrefattribute to<pre>tags - (aws-sdk-rust#254, @jacco) Made fluent operation structs cloneable
Contributors Thank you for your contributions! ❤
- @jacco (aws-sdk-rust#254)
New this release:
- 🐛 (smithy-rs#979) Make
aws-smithy-clienta required dependency in generated services.
Breaking Changes:
-
⚠ (smithy-rs#930) Runtime crates no longer have default features. You must now specify the features that you want when you add a dependency to your
Cargo.toml.Upgrade guide
before after aws-smithy-async = "VERSION"aws-smithy-async = { version = "VERSION", features = ["rt-tokio"] }aws-smithy-client = "VERSION"aws-smithy-client = { version = "VERSION", features = ["client-hyper", "rustls", "rt-tokio"] }aws-smithy-http = "VERSION"aws-smithy-http = { version = "VERSION", features = ["rt-tokio"] } -
⚠ (smithy-rs#940)
aws_smithy_client::Client::https()has been renamed todyn_https(). This is to clearly distinguish it fromrustlsandnative_tlswhich do not use a boxed connector.
New this release:
- 🐛 (smithy-rs#957) Include non-service-specific examples in the generated root Cargo workspace
- 🎉 (smithy-rs#922, smithy-rs#914) Add changelog automation to sdk-lints
- 🐛 (aws-sdk-rust#317, smithy-rs#907) Removed spamming log message when a client was used without a sleep implementation, and improved context and call to action in logged messages around missing sleep implementations.
- (smithy-rs#923) Use provided
sleep_implfor retries instead of using Tokio directly. - (smithy-rs#920) Fix typos in module documentation for generated crates
- 🐛 (aws-sdk-rust#301, smithy-rs#892) Avoid serializing repetitive
xmlnsattributes in generated XML serializers. - 🐛 (smithy-rs#953, aws-sdk-rust#331) Fixed a bug where certain characters caused a panic during URI encoding.
- This release was a version bump to fix a version number conflict in crates.io
New this week
- Add docs.rs metadata section to all crates to document all features
New this week
- Improve docs on
aws-smithy-client(smithy-rs#855) - Fix http-body dependency version (smithy-rs#883, aws-sdk-rust#305)
SdkErrornow includes a variantTimeoutErrorfor when a request times out (smithy-rs#885)- Timeouts for requests are now configurable. You can set separate timeouts for each individual request attempt and all attempts made for a request. (smithy-rs#831)
Breaking Changes
- (aws-smithy-client): Extraneous
pub use SdkSuccessremoved fromaws_smithy_client::hyper_ext. (smithy-rs#855)
Breaking Changes
Several breaking changes around aws_smithy_types::Instant were introduced by smithy-rs#849:
aws_smithy_types::Instantfrom was renamed toDateTimeto avoid confusion with the standard library's monotonically non-decreasingInstanttype.DateParseErrorinaws_smithy_typeshas been renamed toDateTimeParseErrorto match the type that's being parsed.- The
chrono-conversionsfeature and associated functions have been moved to theaws-smithy-types-convertcrate.- Calls to
Instant::from_chronoshould be changed to:use aws_smithy_types::DateTime; use aws_smithy_types_convert::date_time::DateTimeExt; // For chrono::DateTime<Utc> let date_time = DateTime::from_chrono_utc(chrono_date_time); // For chrono::DateTime<FixedOffset> let date_time = DateTime::from_chrono_offset(chrono_date_time);
- Calls to
instant.to_chrono()should be changed to:use aws_smithy_types_convert::date_time::DateTimeExt; date_time.to_chrono_utc();
- Calls to
Instant::from_system_timeandInstant::to_system_timehave been changed toFromtrait implementations.- Calls to
from_system_timeshould be changed to:DateTime::from(system_time); // or let date_time: DateTime = system_time.into();
- Calls to
to_system_timeshould be changed to:SystemTime::from(date_time); // or let system_time: SystemTime = date_time.into();
- Calls to
- Several functions in
Instant/DateTimewere renamed:Instant::from_f64->DateTime::from_secs_f64Instant::from_fractional_seconds->DateTime::from_fractional_secsInstant::from_epoch_seconds->DateTime::from_secsInstant::from_epoch_millis->DateTime::from_millisInstant::epoch_fractional_seconds->DateTime::as_secs_f64Instant::has_nanos->DateTime::has_subsec_nanosInstant::epoch_seconds->DateTime::secsInstant::epoch_subsecond_nanos->DateTime::subsec_nanosInstant::to_epoch_millis->DateTime::to_millis
- The
DateTime::fmtmethod is now fallible and fails when aDateTime's value is outside what can be represented by the desired date format. - In
aws-sigv4, theSigningParamsbuilder'sdate_timesetter was renamed totimeand changed to take astd::time::SystemTimeinstead of a chrono'sDateTime<Utc>.
New this week
⚠️ MSRV increased from 1.53.0 to 1.54.0 per our 3-behind MSRV policy.- Conversions from
aws_smithy_types::DateTimetoOffsetDateTimefrom thetimecrate are now available from theaws-smithy-types-convertcrate. (smithy-rs#849) - Fixed links to Usage Examples (smithy-rs#862, @floric)
No changes since last release except for version bumping since older versions
of the AWS SDK were failing to compile with the 0.27.0-alpha.2 version chosen
for the previous release.
Breaking Changes
- Members named
builderon model structs were renamed tobuilder_valueso that their accessors don't conflict with the existingbuilder()methods (smithy-rs#842)
New this week
- Fix epoch seconds date-time parsing bug in
aws-smithy-types(smithy-rs#834) - Omit trailing zeros from fraction when formatting HTTP dates in
aws-smithy-types(smithy-rs#834) - Generated structs now have accessor methods for their members (smithy-rs#842)
Breaking Changes
<operation>.make_operation(&config)is now anasyncfunction 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
- SDK code generation now includes a version in addition to path parameters when the
versionparameter is included in smithy-build.json moduleDescriptioninsmithy-build.jsonsettings is now optional- Upgrade to Smithy 1.12
hyper::Error(IncompleteMessage)will now be retried (smithy-rs#815)- Unions will optionally generate an
Unknownvariant to support parsing variants that don't exist on the client. These variants will fail to serialize if they are ever included in requests. - Fix generated docs on unions. (smithy-rs#826)
Breaking Changes
⚠️ All Smithy runtime crates have been renamed to have anaws-prefix. This may require code changes:- Cargo.toml changes:
smithy-async->aws-smithy-asyncsmithy-client->aws-smithy-clientsmithy-eventstream->aws-smithy-eventstreamsmithy-http->aws-smithy-httpsmithy-http-tower->aws-smithy-http-towersmithy-json->aws-smithy-jsonsmithy-protocol-test->aws-smithy-protocol-testsmithy-query->aws-smithy-querysmithy-types->aws-smithy-typessmithy-xml->aws-smithy-xml
- Rust
usestatement changes:smithy_async->aws_smithy_asyncsmithy_client->aws_smithy_clientsmithy_eventstream->aws_smithy_eventstreamsmithy_http->aws_smithy_httpsmithy_http_tower->aws_smithy_http_towersmithy_json->aws_smithy_jsonsmithy_protocol_test->aws_smithy_protocol_testsmithy_query->aws_smithy_querysmithy_types->aws_smithy_typessmithy_xml->aws_smithy_xml
- Cargo.toml changes:
New this week
- Filled in missing docs for services in the rustdoc documentation (smithy-rs#779)
Breaking Changes
⚠️ Therust-codegenplugin now requires amoduleDescriptionin the smithy-build.json file. This property goes into the generated Cargo.toml file as the package description. (smithy-rs#766)
New this week
- Add
RustSettingstoCodegenContext(smithy-rs#616, smithy-rs#752) - Prepare crate manifests for publishing to crates.io (smithy-rs#755)
- Generated Cargo.toml files can now be customized (smithy-rs#766)
New this week
- 🐛 Re-add missing deserialization operations that were missing because of a typo in
HttpBoundProtocolGenerator.kt
Breaking changes
⚠️ MSRV increased from 1.52.1 to 1.53.0 per our 3-behind MSRV policy.⚠️ smithy_client::retry::Configfieldmax_retriesis renamed tomax_attempts- This also brings a change to the semantics of the field. In the old version, setting
max_retriesto 3 would mean that up to 4 requests could occur (1 initial request and 3 retries). In the new version, settingmax_attemptsto 3 would mean that up to 3 requests could occur (1 initial request and 2 retries).
- This also brings a change to the semantics of the field. In the old version, setting
⚠️ smithy_client::retry::Config::with_max_retriesmethod is renamed towith_max_attempts⚠️ Several classes in the codegen module were renamed and/or refactored (smithy-rs#735):ProtocolConfigbecameCodegenContextand moved tosoftware.amazon.smithy.rust.codegen.smithyHttpProtocolGeneratorbecameProtocolGeneratorand was refactored to rely on composition instead of inheritanceHttpProtocolTestGeneratorbecameProtocolTestGeneratorProtocolmoved intosoftware.amazon.smithy.rust.codegen.smithy.protocols
SmithyConnectorandDynConnectornow returnConnectorErrorinstead ofBox<dyn Error>. If you have written a custom connector, it will need to be updated to return the new error type. (#744)- The
DispatchErrorvariant ofSdkErrornow containsConnectorErrorinstead ofBox<dyn Error>(#744).
New this week
- 🐛 Fix an issue where
smithy-xmlmay have generated invalid XML (smithy-rs#719) - Add
RetryConfigstruct for configuring retry behavior (smithy-rs#725) - 🐛 Fix error when receiving empty event stream messages (smithy-rs#736)
- 🐛 Fix bug in event stream receiver that could cause the last events in the response stream to be lost (smithy-rs#736)
- Add connect & HTTP read timeouts to IMDS, defaulting to 1 second
- IO and timeout errors from Hyper can now be retried (#744)
Contributors
Thank you for your contributions! ❤️
- @obi1kenobi (smithy-rs#719)
- @guyilin-amazon (smithy-rs#750)
New This Week
- Add IMDS credential provider to
aws-config(smithy-rs#709) - Add IMDS client to
aws-config(smithy-rs#701) - Add
TimeSourcetoaws_types::os_shim_internal(smithy-rs#701) - User agent construction is now
const fn(smithy-rs#701) - Add
sts::AssumeRoleProvidertoaws-config(smithy-rs#703, aws-sdk-rust#3) - Add IMDS region provider to
aws-config(smithy-rs#715) - Add query param signing to the
aws-sigv4crate (smithy-rs#707) - 🐛 Update event stream
Receivers to beSend(smithy-rs#702, #aws-sdk-rust#224)
New This Week
- 🐛 Fixes issue where
Content-Lengthheader could be duplicated leading to signing failure (aws-sdk-rust#220, smithy-rs#697) - 🐛 Fixes naming collision during generation of model shapes that collide with
<operationname>Inputand<operationname>Output(#699)
This release adds support for three commonly requested features:
- More powerful credential chain
- Support for constructing multiple clients from the same configuration
- Support for Transcribe streaming and S3 Select
In addition, this overhauls client configuration which lead to a number of breaking changes. Detailed changes are inline.
Current Credential Provider Support:
- Environment variables
- Web Identity Token Credentials
- Profile file support (partial)
- Credentials
- SSO
- ECS Credential source
- IMDS credential source
- Assume role from source profile
- Static credentials source profile
- WebTokenIdentity provider
- Region
- Credentials
- IMDS
- ECS
from_env loaded region & credentials from environment variables only. Default sources have been removed from the generated
SDK clients and moved to the aws-config package. Note that the aws-config package default chain adds support for
profile file and web identity token profiles.
- Add a dependency on
aws-config:[dependencies] aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.17-alpha" }
- Update your client creation code:
// `shared_config` can be used to construct multiple different service clients! let shared_config = aws_config::load_from_env().await; // before: <service>::Client::from_env(); let client = <service>::Client::new(&shared_config)
Config::build() has been modified to not fallback to a default provider. Instead, use aws-config to load and modify
the default chain. Note that when you switch to aws-config, support for profile files and web identity tokens will be added.
-
Add a dependency on
aws-config:[dependencies] aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.17-alpha" }
-
Update your client creation code:
fn before() { let region = aws_types::region::ChainProvider::first_try(<1 provider>).or_default_provider(); let config = <service>::Config::builder().region(region).build(); let client = <service>::Client::from_conf(&config); } async fn after() { use aws_config::meta::region::RegionProviderChain; let region_provider = RegionProviderChain::first_try(<1 provider>).or_default_provider(); // `shared_config` can be used to construct multiple different service clients! let shared_config = aws_config::from_env().region(region_provider).load().await; let client = <service>::Client::new(&shared_config) }
All credential providers that were in aws-auth-providers have been moved to aws-config. Unless you have a specific use case
for a specific credential provider, you should use the default provider chain:
let shared_config = aws_config::load_from_env().await;
let client = <service>::Client::new(&shared_config);AsyncProvideCredentials has been renamed to ProvideCredentials. The trait has been moved from aws-auth to aws-types.
The original ProvideCredentials trait has been removed. The return type has been changed to by a custom future.
For synchronous use cases:
use aws_types::credentials::{ProvideCredentials, future};
#[derive(Debug)]
struct CustomCreds;
impl ProvideCredentials for CustomCreds {
fn provide_credentials<'a>(&'a self) -> future::ProvideCredentials<'a>
where
Self: 'a,
{
// if your credentials are synchronous, use `::ready`
// if your credentials are loaded asynchronously, use `::new`
future::ProvideCredentials::ready(todo!()) // your credentials go here
}
}For asynchronous use cases:
use aws_types::credentials::{ProvideCredentials, future, Result};
#[derive(Debug)]
struct CustomAsyncCreds;
impl CustomAsyncCreds {
async fn load_credentials(&self) -> Result {
Ok(Credentials::from_keys("my creds...", "secret", None))
}
}
impl ProvideCredentials for CustomCreds {
fn provide_credentials<'a>(&'a self) -> future::ProvideCredentials<'a>
where
Self: 'a,
{
future::ProvideCredentials::new(self.load_credentials())
}
}Breaking Changes
-
Credential providers from
aws-auth-providershave been moved toaws-config(#678) -
AsyncProvideCredentialshas been renamed toProvideCredentials. The original non-async provide credentials has been removed. See the migration guide above. -
<sevicename>::from_env()has been removed (#675). A drop-in replacement is available:- Add a dependency on
aws-config:[dependencies] aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.17-alpha" }
- Update your client creation code:
let client = <service>>::Client::new(&aws_config::load_from_env().await)
- Add a dependency on
-
ProvideRegionhas been moved toaws_config::meta::region::ProvideRegion. (#675) -
aws_types::region::ChainProviderhas been moved toaws_config::meta::region::RegionProviderChain(#675). -
ProvideRegionis now asynchronous. Code that calledprovider.region()must be changed toprovider.region().await. -
<awsservice>::Config::builder()will not load a default region. To preserve previous behavior:- Add a dependency on
aws-config:[dependencies] aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.17-alpha" }
-
let shared_config = aws_config::load_from_env().await; let config = <service>::config::Builder::from(&shared_config).<other builder modifications>.build();
- Add a dependency on
-
RequestandResponseinsmithy_http::operationnow useSharedPropertyBaginstead ofArc<Mutex<PropertyBag>>. Use theacquireandacquire_mutmethods to get a reference to the underlyingPropertyBagto access properties. (#667)
New this week
- 🎉 Add profile file provider for region (#594, #682)
- 🎉 Add support for shared configuration between multiple services (#673)
- 🎉 Add support for Transcribe
StartStreamTranscriptionand S3SelectObjectContentoperations (#667) - 🎉 Add support for new MemoryDB service (#677)
- Improve documentation on collection-aware builders (#664)
- Update AWS SDK models (#677)
- 🐛 Fix sigv4 signing when request ALPN negotiates to HTTP/2. (#674)
- 🐛 Fix integer size on S3
Size(#679, aws-sdk-rust#209) - 🐛 Fix JSON parsing issue for modeled empty structs (#683, aws-sdk-rust#212)
- 🐛 Fix acronym case disagreement between FluentClientGenerator and HttpProtocolGenerator type aliasing (#668)
Internal Changes
- Add Event Stream support for restJson1 and restXml (#653, #667)
- Add NowOrLater future to smithy-async (#672)
New This Week
- 🎉 Add Chime Identity, Chime Messaging, and Snow Device Management support (#657)
- 🎉 Add profile file credential provider implementation. This implementation currently does not support credential sources for assume role providers other than environment variables. (#640)
- 🎉 Add support for WebIdentityToken providers via profile & environment variables. (#654)
- 🐛 Fix name collision that occurred when a model had both a union and a structure named
Result(#643) - 🐛 Fix STS Assume Role with WebIdentity & Assume role with SAML to support clients with no credentials provided (#652)
- Update AWS SDK models (#657)
- Add initial implementation of a default provider chain. (#650)
Internal Changes
- Update sigv4 tests to work around behavior change in httparse 1.5. (#656)
- Remove Bintray/JCenter source from gradle build. (#651)
- Add experimental
dvrmodule to smithy-client. This will enable easier testing of HTTP traffic. (#640) - Update smithy-client to simplify creating HTTP/HTTPS connectors (#650)
- Add Event Stream support to aws-sigv4 (#648)
- Add support for the smithy auth trait. This enables authorizations that explicitly disable authorization to work when no credentials have been provided. (#652)
Breaking changes
-
(#635) The
config(),config_mut(),request(), andrequest_mut()methods onoperation::Requesthave been renamed toproperties(),properties_mut(),http(), andhttp_mut()respectively. -
(#635) The
Responsetype on Tower middleware has been changed fromhttp::Response<SdkBody>tooperation::Response. The HTTP response is still available from theoperation::Responseusing itshttp()andhttp_mut()methods. -
(#635) The
ParseHttpResponsetrait'sparse_unloaded()method now takes anoperation::Responserather than anhttp::Response<SdkBody>. -
(#626)
ParseHttpResponseno longer has a generic argument for the body type, but instead, always usesSdkBody. This may cause compilation failures for you if you are using Smithy generated types to parse JSON or XML without using a client to request data from a service. The fix should be as simple as removing<SdkBody>in the example below:Before:
let output = <Query as ParseHttpResponse<SdkBody>>::parse_loaded(&parser, &response).unwrap();
After:
let output = <Query as ParseHttpResponse>::parse_loaded(&parser, &response).unwrap();
New This Week
- Add AssumeRoleProvider parser implementation. (#632)
- The closure passed to
provide_credentials_fncan now borrow values (#637) - Add
Sender/Receiverimplementations for Event Stream (#639) - Bring in the latest AWS models (#630)
IoT Data Plane is now available! If you discover it isn't functioning as expected, please let us know!
This week also sees the addition of a robust async caching credentials provider. Take a look at the STS example to see how to use it.
New This Week
- 🎉 Add IoT Data Plane (#624)
- 🎉 Add LazyCachingCredentialsProvider to aws-auth for use with expiring credentials, such as STS AssumeRole. Update STS example to use this new provider (#578, #595)
- 🐛 Correctly encode HTTP Checksums using base64 instead of hex. Fixes aws-sdk-rust#164. (#615)
- Update SDK gradle build logic to use gradle properties (#620)
- Overhaul serialization/deserialization of numeric/boolean types. This resolves issues around serialization of NaN/Infinity and should also reduce the number of allocations required during serialization. (#618)
- Update SQS example to clarify usage of FIFO vs. standard queues (#622, @trevorrobertsjr)
- Implement Event Stream frame encoding/decoding (#609, #619)
Contributions
Thank you for your contributions! ❤️
- @trevorrobertsjr (#622)
- Remove timestreamwrite and timestreamquery from the generated services (#613)
Breaking changes
test-utilhas been made an optional dependency and has moved from aws-hyper to smithy-http. If you were relying onaws_hyper::TestConnection, addsmithy-clientas a dependency and enable the optionaltest-utilfeature. This prunes some unnecessary dependencies onroxmltreeandserde_jsonfor most users. (#608)
New This Week
- 🎉 Release all but three remaining AWS services! Glacier, IoT Data Plane and Transcribe streaming will be available in a future release. If you discover that a service isn't functioning as expected please let us know! (#607)
- 🐛 Bugfix: Fix parsing bug where parsing XML incorrectly stripped whitespace (#590, aws-sdk-rust#153)
- Establish common abstraction for environment variables (#594)
- Add windows to the test matrix (#594)
- 🐛 Bugfix: Constrain RFC-3339 timestamp formatting to microsecond precision (#596)
New this Week
- 🎉 Add support for Autoscaling (#576, #582)
AsyncProvideCredentialsnow introduces an additional lifetime parameter, simplifying bridging it with#[async_trait]interfaces- Fix S3 bug when content type was set explicitly (aws-sdk-rust#131, #566, @eagletmt)
Contributions
Thank you for your contributions! ❤️
- @eagletmt (#566)
New this Week
⚠️ Breaking Change:ProvideCredentialsandCredentialErrorwere both moved intoaws_auth::providerwhen they were previously inaws_auth(#572)- 🎉 Add support for AWS Config (#570)
- 🎉 Add support for EBS (#567)
- 🎉 Add support for Cognito (#573)
- 🎉 Add support for Snowball (#579, @landonxjames)
- Make it possible to asynchronously provide credentials with
provide_credentials_fn(#572, #577) - Improve RDS, QLDB, Polly, and KMS examples (#561, #560, #558, #556, #550)
- Update AWS SDK models (#575)
- 🐛 Bugfix: Fill in message from error response even when it doesn't match the modeled case format (#565)
Internal Changes
- Add support for
@unsignedPayloadSmithy trait (#567) - Strip service/api/client suffix from sdkId (#546)
- Remove idempotency token trait (#571)
Contributions
Thank you for your contributions! ❤️
- landonxjames (#579)
This week, we've added EKS, ECR and Cloudwatch. The JSON deserialization implementation has been replaced, please be on the lookout for potential issues.
New this Week
- 🎉 Add support for ECR (#557)
- 🎉 Add support for Cloudwatch (#554)
- 🎉 Add support for EKS (#553)
- :warn: Breaking Change: httpLabel no longer causes fields to be non-optional. (#537)
- :warn: Breaking Change:
Exceptionis not renamed toError. Code may need to be updated to replaceexceptionwitherror - Add more SES examples, and improve examples for Batch.
- Improved error handling ergonomics: Errors now provide
is_<variantname>()methods to simplify error handling - 🐛 Bugfix: fix bug where invalid query strings could be generated (#531, @eagletmt)
Internal Changes
- Pin CI version to 1.52.1 (#532)
- New JSON deserializer implementation (#530)
- Fix numerous namespace collision bugs (#539)
- Gracefully handle empty response bodies during JSON parsing (#553)
Contributors
Thank you for your contributions! ❤️
- @eagletmt (#531)
This week, we've added CloudWatch Logs support and fixed several bugs in the generated S3 clients. There are a few breaking changes this week.
New this Week
- 🎉 Add support for CloudWatch Logs (#526)
⚠️ Breaking Change: Theset_*functions on generated Builders now always take anOption(#506)⚠️ Breaking Change: Unions with Documents will see the inner document type change fromOption<Document>toDocument(#520)⚠️ Breaking Change: Theas_*functions on unions now returnResultrather thanOptionto clearly indicate what the actual value is (#527)- Add more S3 examples, and improve SNS, SQS, and SageMaker examples. Improve example doc comments (#490, #508, #509, #510, #511, #512, #513, #524)
- 🐛 Bugfix: Show response body in trace logs for calls that don't return a stream (#514)
- 🐛 Bugfix: Correctly parse S3's GetBucketLocation response (#516)
- 🐛 Bugfix: Correctly URL-encode tilde characters before SigV4 signing (#519)
- 🐛 Bugfix: Fix S3 PutBucketLifecycle operation by adding support for the
@httpChecksumRequiredSmithy trait ( #523) - 🐛 Bugfix: Correctly parse non-list headers with commas in them (#525, @eagletmt)
Internal Changes
- Reduce name collisions in generated code (#502)
- Combine individual example packages into per-service example packages with multiple binaries (#481, #490)
- Re-export HyperAdapter in smithy-client (#515, @zekisherif)
- Add serialization/deserialization benchmark for DynamoDB to exercise restJson1 generated code (#507)
Contributions
Thank you for your contributions! ❤️
- @eagletmt (#525)
- @zekisherif (#515)
Smithy-rs now has codegen support for all AWS services! This week, we've added CloudFormation, SageMaker, EC2, and SES. More details below.
New this Week
- 🎉 Add support for CloudFormation (#500, @alistaim)
- 🎉 Add support for SageMaker (#473, @alistaim)
- 🎉 Add support for EC2 (#495)
- 🎉 Add support for SES (#499)
- Add support for the EC2 Query protocol (#475)
- Generate fluent builders for all smithy-rs clients (#496, @jonhoo)
- 🐛 Bugfix: RFC-3339 timestamps (
date-timeformat in Smithy) are now formatted correctly (#479, #489) - 🐛 Bugfix: Union and enum variants named Self no longer cause compile errors in generated code (#492)
Internal Changes
- Combine individual example packages into per-service example packages with multiple binaries (#477, #480, #482, #484, #485, #486, #487, #491)
- Work towards JSON deserialization overhaul (#474)
- Make deserializer function naming consistent between XML and JSON deserializers (#497)
Contributors:
- @Doug-AWS
- @jdisanti
- @rcoh
- @alistaim
- @jonhoo
Thanks!!
Starting this week, smithy-rs now has codegen support for all AWS services except EC2. This week we’ve added MediaLive, MediaPackage, SNS, Batch, STS, RDS, RDSData, Route53, and IAM. More details below.
New this Week
- 🎉 Add support for MediaLive and MediaPackage (#449, @alastaim)
- 🎉 Add support for SNS (#450)
- 🎉 Add support for Batch (#452, @alistaim)
- 🎉 Add support for STS. Note: This does not include support for an STS-based credential provider although an example is provided. (#453)
- 🎉 Add support for RDS (#455) and RDS-Data (#470). (@LMJW)
- 🎉 Add support for Route53 (#457, @alistaim)
- Support AWS Endpoints & Regions. With this update, regions like
iam-fipsandcn-north-1will now resolve to the correct endpoint. Please report any issues with endpoint resolution. (#468) - 🐛 Bugfix: Primitive numerics and booleans are now filtered from serialization when they are 0 and not marked as required. This resolves issues where maxResults needed to be set even though it is optional. (#451)
- 🐛 Bugfix: S3 Head Object returned the wrong error when the object did not exist (#460, fixes #456)
Internal Changes
- Remove unused key “build” from smithy-build.json and Rust settings (#447)
- Split SDK CI jobs for faster builds & reporting (#446)
- Fix broken doc link in JSON serializer (@LMJW)
- Work towards JSON deserialization overhaul (#454, #462)
Contributors:
- @rcoh
- @jdisanti
- @alistaim
- @LMJW
Thanks!!
New this week:
- 🎉 Add support for SQS. SQS is our first service to use the awsQuery protocol. Please report any issues you may encounter.
- 🎉 Add support for ECS.
- Breaking Change: Refactored
smithy_types::Errorto be more flexible. Internal fields ofErrorare now private and can now be accessed accessor functions. (#426) ByteStream::from_pathnow acceptsimplications AsRef<Path>(@LMJW)- Add support for S3 extended request id (#429)
- Add support for the awsQuery protocol. smithy-rs can now add support for all services except EC2.
- Bugfix: Timestamps that fell precisely on minute boundaries were not properly formatted (#435)
- Improve documentation for
ByteStream& addpub use(#443) - Add support for
EndpointPrefixused bys3::WriteGetObjectResponse( #420)
Smithy Internals
- Rewrite JSON serializer (#411, #423, #416, #427)
- Remove dead “rootProject” setting in
smithy-build.json - Bugfix: Idempotency tokens were not properly generated when operations were used by resources
Contributors:
- @jdisanti
- @rcoh
- @LMJW
Thanks!