August 1st, 2023
Pre-releaseBreaking Changes:
-
⚠️ (client) The entire architecture of generated clients has been overhauled. See the upgrade guide to get your code working again. -
⚠️ (client, smithy-rs#2738)ClientProtocolGeneratorhas been renamed toOperationGeneratorbetter represent what its generating. -
⚠️ 🎉 (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. See the server middleware changes discussion for more information. -
⚠️ (all, smithy-rs#2675) Remove native-tls and add a migration guide. -
⚠️ (client, smithy-rs#2671)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, theEventStreamSenderin inputs/outputs now requires the passed inStreamimpl to implementSync. -
⚠️ (server, smithy-rs#2539) Code generation will abort if theignoreUnsupportedConstraintscodegen 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 nowSharedTimeSource, notSystemTime. If your code relies on setting request time, useaws_smithy_async::time::SharedTimeSource. -
⚠️ (server, smithy-rs#2676, smithy-rs#2685) Bump dependency onlambda_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) RemovePollErrorfrom an operationsService::Error.Any
tower::Serviceprovided to
Operation::from_service
no longer requiresService::Error = OperationError<Op::Error, PollError>, instead requiring justService::Error = Op::Error. -
⚠️ (client, smithy-rs#2742) A newtype wrapperSharedAsyncSleephas 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 ofArc<dyn ResolveEndpoint>have now been replaced withSharedEndpointResolverin public APIs. -
⚠️ (server, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, @hlbarber) Removefilter_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 namingmake_tokenfor fields and the API ofIdempotencyTokenProviderin service configs and their builders has now been updated toidempotency_token_provider. -
⚠️ (all, smithy-rs#2808)CoreCodegenDecorator.transformModelnow takes an additional parametersettings: CodegenSettings. -
⚠️ (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#2847) By defaultendpoint_url/set_endpoint_urlmethods will be added to the service config. If this causes duplicate definitions, disable creation of those methods by settingincludeEndpointUrlConfigundercodegento false (example). -
⚠️ (client, smithy-rs#2848) The implementationFrom<bytes_utils::segmented::SegmentedBuf>foraws_smithy_http::event_stream::RawMessagehas been removed. -
⚠️ (server, smithy-rs#2865) Thealb_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) Thetest-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.
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)