Releases: smithy-lang/smithy-rs
November 1st, 2023
New this release:
- (client, smithy-rs#3112, smithy-rs#3116) Upgrade
ring
to 0.17.5.
October 31st, 2023
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: middleware
opt-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 theRuntimePlugin
trait. Acurrent_components
argument was added to theruntime_components
method 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::order
method. -
⚠️ (all, smithy-rs#2948) Update MSRV to Rust 1.70.0 -
⚠️ (client, smithy-rs#2970)aws_smithy_client::hyper_ext::Adapter
was moved/renamed toaws_smithy_runtime::client::connectors::hyper_connector::HyperConnector
. -
⚠️ (client, smithy-rs#2970) Test connectors moved intoaws_smithy_runtime::client::connectors::test_util
behind thetest-util
feature. -
⚠️ (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_cell
from 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::Stream
trait has been removed from public API.FnStream
only supportsnext
,try_next
,collect
, andtry_collect
methods.TryFlatMap::flat_map
returnsPaginationStream
, which should be preferred toFnStream
at 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_stream
has been moved to be a child module ofpagination_stream
. -
⚠️ (client, smithy-rs#2983) Thefutures_core::stream::Stream
trait 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
'suri
constructor now takes aString
instead of aUri
. -
⚠️ (server, smithy-rs#3038)SdkError
is no longer re-exported in generated server crates. -
⚠️ (client, smithy-rs#3039) Thecustomize()
method is now sync and infallible. Remove anyawait
s and error handling from it to make things compile again. -
🐛
⚠️ (all, smithy-rs#3037, aws-sdk-rust#756) Our algorithm for converting identifiers tosnake_case
has 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 traitsEndpointResolver
andIdentityResolver
changed to new-typesEndpointFuture
andIdentityFuture
respectively. -
⚠️ (client, smithy-rs#3032)EndpointPrefix::new
no longer returnscrate::operation::error::BuildError
for an Err variant, instead returns a more specificInvalidEndpointError
. -
⚠️ (client, smithy-rs#3061) Lifetimes have been added to theEndpointResolver
trait. -
⚠️ (client, smithy-rs#3065) Several traits have been renamed from noun form to verb form to be more idiomatic:AuthSchemeOptionResolver
->ResolveAuthSchemeOptions
EndpointResolver
->ResolveEndpoint
IdentityResolver
->ResolveIdentity
Signer
->Sign
RequestSerializer
->SerializeRequest
ResponseDeserializer
->DeserializeResponse
Interceptor
->Intercept
-
⚠️ (client, smithy-rs#3059) This change has detailed upgrade guidance. A summary is below.
TheHttpRequest
type alias now points toaws-smithy-runtime-api::client::http::Request
. This is a first-party request type to allow us to gracefully supporthttp = 1.0
when it arrives. Most customer code using this method should be unaffected.TryFrom
/TryInto
conversions are provided forhttp = 0.2.*
. -
⚠️ (client, smithy-rs#2917)RuntimeComponents
have been added as an argument to theIdentityResolver::resolve_identity
trait function. -
⚠️ (client, smithy-rs#3072) Theidempotency_provider
field 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_resolver
method no longer accepts&'static str
. Useconfig::Builder::endpoint_url
instead. -
⚠️ (client, smithy-rs#3043, smithy-rs#3078) This change has detailed upgrade guidance.
The endpoint interfaces fromaws-smithy-http
have 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_http
for 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_http
for 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_http
for backwards compatibility but are deprecated. -
⚠️ (client, smithy-rs#3077) Behavior Break! Identities for auth are now cached by default. See theConfig
builder'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-body
andhyper
crates withinaws-smithy-types
are now feature-gated. Se...
August 22nd, 2023
Breaking Changes:
- 🐛
⚠️ (client, smithy-rs#2931, aws-sdk-rust#875) Fixed re-exportedSdkError
type. The previous release had the wrong type forSdkError
when generating code for orchestrator mode, which caused projects to fail to compile when upgrading.
New this release:
- (client, smithy-rs#2904)
RuntimeComponents
andRuntimeComponentsBuilder
are 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::orchestrator
module is now emitted at theDEBUG
level to reduce the amount of logging when emitted at theINFO
level. - 🐛 (client, smithy-rs#2935) Fix
SDK::Endpoint
built-in for@endpointRuleSet
.
August 1st, 2023
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 toOperationGenerator
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 theConfig
. This function was called at serialization time to connect the signer to the streaming body. Now, instead, a specialDeferredSigner
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, aDeferredSignerSender
must 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, theEventStreamSender
in inputs/outputs now requires the passed inStream
impl to implementSync
. -
⚠️ (server, smithy-rs#2539) Code generation will abort if theignoreUnsupportedConstraints
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 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_http
byaws-smithy-http-server
to 0.8.0. This version ofaws-smithy-http-server
is only guaranteed to be compatible with 0.8.0, or semver-compatible versions of 0.8.0 of thelambda_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) RemovePollError
from an operationsService::Error
.Any
tower::Service
provided to
Operation::from_service
no longer requiresService::Error = OperationError<Op::Error, PollError>
, instead requiring justService::Error = Op::Error
. -
⚠️ (client, smithy-rs#2742) A newtype wrapperSharedAsyncSleep
has 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)ShapeId
is the new structure used to represent a shape, with its absolute name, namespace and name.
OperationExtension
's members are replaced by theShapeId
and operations' names are now replced by aShapeId
.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 ofArc<dyn ResolveEndpoint>
have now been replaced withSharedEndpointResolver
in public APIs. -
⚠️ (server, smithy-rs#2740, smithy-rs#2759, smithy-rs#2779, @hlbarber) Removefilter_by_operation_id
andplugin_from_operation_id_fn
in favour offilter_by_operation
andplugin_from_operation_fn
.Previously, we provided
filter_by_operation_id
which filteredPlugin
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 tofilter_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 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_token
for fields and the API ofIdempotencyTokenProvider
in service configs and their builders has now been updated toidempotency_token_provider
. -
⚠️ (all, smithy-rs#2808)CoreCodegenDecorator.transformModel
now takes an additional parametersettings: CodegenSettings
. -
⚠️ (client, smithy-rs#2845)aws_smithy_async::future::rendezvous::Sender::send
no longer exposestokio::sync::mpsc::error::SendError
for the error of its return type and instead exposes a new-type wrapper calledaws_smithy_async::future::rendezvous::error::SendError
. In addition, theaws_smithy_xml
crate no longer exposes types fromxmlparser
. -
⚠️ (client, smithy-rs#2847) By defaultendpoint_url
/set_endpoint_url
methods will be added to the service config. If this causes duplicate definitions, disable creation of those methods by settingincludeEndpointUrlConfig
undercodegen
to false (example). -
⚠️ (client, smithy-rs#2848) The implementationFrom<bytes_utils::segmented::SegmentedBuf>
foraws_smithy_http::event_stream::RawMessage
has been removed. -
⚠️ (server, smithy-rs#2865) Thealb_health_check
module has been moved out of theplugin
module into a newlayer
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) Thetest-util
feature in aws-smithy-client has been split to include a separatewiremock
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](https:/...
May 23rd, 2023
New this release:
- (all, smithy-rs#2612) The
Debug
implementation forPropertyBag
now prints a list of the types it contains. This significantly improves debuggability. - (all, smithy-rs#2653, smithy-rs#2656, @henriiik) Implement
Ord
andPartialOrd
forDateTime
. - 🐛 (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
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 ataws_smithy_http_server::plugin::alb_health_check
to learn about it. - 🎉 (client, smithy-rs#2254, @eduardomourar) Clients now compile for the
wasm32-unknown-unknown
andwasm32-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 atower::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
release-2023-04-11 Update changelog
March 23rd, 2023
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 intoProvideErrorMetadata
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 toaws_smithy_types::error::ErrorMetadata
. -
⚠ (server, smithy-rs#2436) Remove unnecessary type parameter
B
fromUpgrade
service. -
🐛⚠ (server, smithy-rs#2382) Smithy members named
send
were previously renamed tosend_value
at codegen time. These will now be calledsend
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 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
awsQueryCompatible
trait. This allows services to continue supporting a custom error code (via theawsQueryError
trait) when the services migrate their protocol fromawsQuery
toawsJson1_0
annotated withawsQueryCompatible
.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 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.NonExistentQueue
and<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)
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
, 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_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
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
Breaking Changes:
- ⚠🎉 (all, smithy-rs#2222, @Nugine) Upgrade Rust MSRV to 1.63.0
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! ❤