Skip to content

August 1st, 2023

Pre-release
Pre-release
Compare
Choose a tag to compare

Breaking 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) ClientProtocolGenerator has been renamed to OperationGenerator better 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-auth to 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_signer method on the Config. This function was called at serialization time to connect the signer to the streaming body. Now, instead, a special DeferredSigner is 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, a DeferredSignerSender must be pulled out of the property bag, and its send() 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 EventStreamSender in inputs/outputs now requires the passed in Stream impl to implement Sync.

  • ⚠️ (server, smithy-rs#2539) Code generation will abort if the ignoreUnsupportedConstraints codegen 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, not SystemTime. If your code relies on setting request time, use aws_smithy_async::time::SharedTimeSource.

  • ⚠️ (server, smithy-rs#2676, smithy-rs#2685) Bump dependency on lambda_http by aws-smithy-http-server to 0.8.0. This version of aws-smithy-http-server is only guaranteed to be compatible with 0.8.0, or semver-compatible versions of 0.8.0 of the lambda_http crate. 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 PollError from an operations Service::Error.

    Any tower::Service provided to
    Operation::from_service
    no longer requires Service::Error = OperationError<Op::Error, PollError>, instead requiring just Service::Error = Op::Error.

  • ⚠️ (client, smithy-rs#2742) A newtype wrapper SharedAsyncSleep has been introduced and occurrences of Arc<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) ShapeId is the new structure used to represent a shape, with its absolute name, namespace and name.
    OperationExtension's members are replaced by the ShapeId and operations' names are now replced by a ShapeId.

    Before you had an operation and an absolute name as its NAME member. 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 with SharedEndpointResolver in public APIs.

  • ⚠️ (server, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, @hlbarber) Remove filter_by_operation_id and plugin_from_operation_id_fn in favour of filter_by_operation and plugin_from_operation_fn.

    Previously, we provided filter_by_operation_id which filtered Plugin application 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 to filter_by_operation which 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_fn now allows for

    use 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_token for fields and the API of IdempotencyTokenProvider in service configs and their builders has now been updated to idempotency_token_provider.

  • ⚠️ (all, smithy-rs#2808) CoreCodegenDecorator.transformModel now takes an additional parameter settings: CodegenSettings.

  • ⚠️ (client, smithy-rs#2845) aws_smithy_async::future::rendezvous::Sender::send no longer exposes tokio::sync::mpsc::error::SendError for the error of its return type and instead exposes a new-type wrapper called aws_smithy_async::future::rendezvous::error::SendError. In addition, the aws_smithy_xml crate no longer exposes types from xmlparser.

  • ⚠️ (client, smithy-rs#2847) By default endpoint_url/set_endpoint_url methods will be added to the service config. If this causes duplicate definitions, disable creation of those methods by setting includeEndpointUrlConfig under codegen to false (example).

  • ⚠️ (client, smithy-rs#2848) The implementation From<bytes_utils::segmented::SegmentedBuf> for aws_smithy_http::event_stream::RawMessage has been removed.

  • ⚠️ (server, smithy-rs#2865) The alb_health_check module has been moved out of the plugin module into a new layer module. 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-util feature in aws-smithy-client has been split to include a separate wiremock feature. 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, DateTime primitives
  • 🎉 (client, smithy-rs#2652, @thomas-k-cameron) Add a send_with function on -Input types 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 TimeSource trait. This facilitates testing as well as use cases like WASM where SystemTime::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:
    HTTP/1.1 400 Bad Request
    content-type: application/json
    x-amzn-errortype: com.example.service#InvalidRequestException
    ...
    
    Example server error response now:
    HTTP/1.1 400 Bad Request
    content-type: application/json
    x-amzn-errortype: InvalidRequestException
    ...
    

Contributors
Thank you for your contributions! ❤