Skip to content

Releases: smithy-lang/smithy-rs

August 1st, 2023

01 Aug 22:12
Compare
Choose a tag to compare
August 1st, 2023 Pre-release
Pre-release

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:

Read more

May 23rd, 2023

23 May 11:34
Compare
Choose a tag to compare
May 23rd, 2023 Pre-release
Pre-release

New this release:

  • (all, smithy-rs#2612) The Debug implementation for PropertyBag now prints a list of the types it contains. This significantly improves debuggability.
  • (all, smithy-rs#2653, smithy-rs#2656, @henriiik) Implement Ord and PartialOrd for DateTime.
  • 🐛 (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! ❤

April 26th, 2023

26 Apr 13:45
Compare
Choose a tag to compare
April 26th, 2023 Pre-release
Pre-release

Breaking Changes:

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_check to learn about it.
  • 🎉 (client, smithy-rs#2254, @eduardomourar) Clients now compile for the wasm32-unknown-unknown and wasm32-wasi targets 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_layer which allows you to apply a tower::Layer to 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 Sync auto-trait.
  • 🐛 (all, smithy-rs#2495) Streaming operations now emit the request ID at the debug log level like their non-streaming counterparts.
  • 🐛 (client, smithy-rs#2495) Streaming operations now emit the request ID at the debug log level like their non-streaming counterparts.
  • (client, smithy-rs#2507) The enableNewCrateOrganizationScheme codegen 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::Format has been re-exported in service client crates.
  • 🐛 (server, smithy-rs#2582, smithy-rs#2585) Fix generation of constrained shapes reaching @sensitive shapes
  • 🐛 (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! ❤

April 11th, 2023

11 Apr 19:53
Compare
Choose a tag to compare
April 11th, 2023 Pre-release
Pre-release
release-2023-04-11

Update changelog

March 23rd, 2023

23 Mar 12:56
Compare
Choose a tag to compare
March 23rd, 2023 Pre-release
Pre-release

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() and code() methods on errors have been moved into ProvideErrorMetadata trait. This trait will need to be imported to continue calling these.

  • ⚠ (client, smithy-rs#76, smithy-rs#2129, smithy-rs#2075) The *Error and *ErrorKind types have been combined to make error matching simpler.

    Example with S3

    Before:

    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:

    // 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::Error has been renamed to aws_smithy_types::error::ErrorMetadata.

  • ⚠ (server, smithy-rs#2436) Remove unnecessary type parameter B from Upgrade service.

  • 🐛⚠ (server, smithy-rs#2382) Smithy members named send were previously renamed to send_value at codegen time. These will now be called send in 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 ServerRequestId in the response headers.
    Servers need to create their service using the new layer builder ServerRequestIdProviderLayer::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 awsQueryCompatible trait. This allows services to continue supporting a custom error code (via the awsQueryError trait) when the services migrate their protocol from awsQuery to awsJson1_0 annotated with awsQueryCompatible.

    Click to expand for more details...

    After the migration, services will include an additional header x-amzn-query-error in their responses whose value is in the form of <error code>;<error type>. An example response looks something like

    HTTP/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> is AWS.SimpleQueueService.NonExistentQueue and <error type> is Sender.

    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) SdkError variants can now be constructed for easier unit testing.

  • 🐛 (server, smithy-rs#2441) Fix FilterByOperationName plugin. 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, and aws_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_errors

    If 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

February 24th, 2023

24 Feb 12:10
Compare
Choose a tag to compare
February 24th, 2023 Pre-release
Pre-release

New this release:

  • 🎉 (server, smithy-rs#1969) Support for constraint traits on member shapes (constraint trait precedence) has been added.
  • 🐛 (server, smithy-rs#2352, smithy-rs#2343) Fix bug whereby nested server structure member shapes targeting simple shapes with @default
    produced Rust code that did not compile

February 14th, 2023

14 Feb 17:16
Compare
Choose a tag to compare
February 14th, 2023 Pre-release
Pre-release

Breaking Changes:

New this release:

  • 🐛 (server, smithy-rs#2349) Fix inconsistent casing in services re-export.
  • 🐛 (client, aws-sdk-rust#736) Fix issue where clients using native-tls connector were prevented from making HTTPS requests.

Contributors
Thank you for your contributions! ❤

February 6th, 2023

07 Feb 15:11
Compare
Choose a tag to compare
February 6th, 2023 Pre-release
Pre-release

This release broke native-tls, so it was yanked from crates.io. The next release includes all of these changes and a fix to native-tls.

Breaking Changes:

  • 🐛⚠️ (server, smithy-rs#2276) Fix name and absolute methods on OperationExtension.

    The older, now removed, service builder would insert OperationExtension into the http::Response containing the absolute shape ID with the # symbol replaced with a .. When reintroduced into the new service builder machinery the behavior was changed - we now do not perform the replace. This change fixes the documentation and name/absolute methods of the OperationExtension API to match this new behavior.

    In the old service builder, OperationExtension was initialized, by the framework, and then used as follows:

    let ext = OperationExtension::new(“com.amazonaws.CompleteSnapshot);
    
    // This is expected
    let name = ext.name(); // “CompleteSnapshot”
    let namespace = ext.namespace(); // = “com.amazonaws”;

    When reintroduced, OperationExtension was initialized by the Plugin and then used as follows:

    let ext = OperationExtension::new(“com.amazonaws#CompleteSnapshot);
    
    // This is the bug
    let name = ext.name(); // “amazonaws#CompleteSnapshot”
    let namespace = ext.namespace(); // = “com”;

    The intended behavior is now restored:

    let ext = OperationExtension::new(“com.amazonaws#CompleteSnapshot);
    
    // This is expected
    let name = ext.name(); // “CompleteSnapshot”
    let namespace = ext.namespace(); // = “com.amazonaws”;

    The rationale behind this change is that the previous design was tailored towards a specific internal use case and shouldn’t be enforced on all customers.

New this release:

  • 🎉 (server, smithy-rs#2232, smithy-rs#1670) The @uniqueItems trait on list shapes is now supported in server SDKs.
  • (client, smithy-rs#2312) Raise the minimum TLS version from 1.0 to 1.2 when using the native-tls feature in aws-smithy-client.
  • 🐛 (client, smithy-rs#2271) Fix broken doc link for tokio_stream::Stream that is a re-export of futures_core::Stream.

January 25th, 2023

25 Jan 15:34
Compare
Choose a tag to compare
January 25th, 2023 Pre-release
Pre-release

New this release:

  • 🐛 (server, smithy-rs#2247) Fix bug in OperationExtensionFutures Future::poll implementation

January 24th, 2023

24 Jan 16:25
Compare
Choose a tag to compare
January 24th, 2023 Pre-release
Pre-release

Breaking Changes:

  • ⚠ (server, smithy-rs#2161) Remove deprecated service builder, this includes:

    • Remove aws_smithy_http_server::routing::Router and aws_smithy_http_server::request::RequestParts.
    • Move the aws_smithy_http_server::routers::Router trait and aws_smithy_http_server::routing::RoutingService into aws_smithy_http_server::routing.
    • Remove the following from the generated SDK:
      • operation_registry.rs
      • operation_handler.rs
      • server_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.

New this release:

  • 🐛 (server, smithy-rs#2213) @sparse list shapes and map shapes with constraint traits and with constrained members are now supported
  • (all, smithy-rs#2223) aws_smithy_types::date_time::DateTime, aws_smithy_types::Blob now implement the Eq and Hash traits
  • (server, smithy-rs#2223) Code-generated types for server SDKs now implement the Eq and Hash traits when possible