Soto version 5.0.0 has been released. This is a major new release with considerable changes from v4. Below is a list of the major changes that have occured.
In the autumn the SDK was renamed from AWSSDKSwift to Soto with the release of v5 this rename is complete. The package name is "soto" and all libraries are prefixed with the name "Soto".
We have split
AWSClient away from the AWS service objects. Instead of having a new client for each service you can now have one client that is used by many services. This allows for some optimizations and makes it easier for the user to manage multiple services.
Internally we are now using swift-server's async-http-client instead of our own custom HTTP client. We also allow the user to supply their own HTTP client, be it their own instance of the async-http-client or a custom written client.
On top of using async-http-client we have added support for a number of other Swift server eco-system libraries including swift-log and swift-metrics.
The credential acquisition code has been completely written. We have included the concept of a credential provider which is a pattern users of other AWS SDKs will recognise. This new system has allowed us to extend the credential acquisition with STS and Cognito credential providers.
Streaming of requests and responses with raw payloads is now available. This allows for the upload and download of large files without requiring a large memory footprint. We added
AWSPayload which allows the user to create raw payloads from a
ByteBuffer, closure supplying a stream of
ByteBuffers or a file handle to stream data from.
There are a lot of internal changes related to request encoding and response decoding.
- There is a new
Codablefor encoding. Now all protocols use
Codablefor serialization of requests and responses.
- We have replaced the
AWSShapeMembercollection encoding with property wrappers defining how collection types should be encoded or decoded. This has simplified the Encoder/Decoders as they don't have to deal with the different collection encoding formats anymore.
- We also use property wrappers to define how
Dateshould be serialized. This has allowed us to remove the type
Timestampand rely on
Along with the other Swift server eco-system libraries we are now using swift-crypto to avoid having to depend on an OpenSSL library. Due to the platform version requirements of swift-crypto though we decided to use CommonCrypto on macOS and iOS to allow us to support earlier versions of those operating systems.
The V4 Signer was completely rewritten for version 5 of Soto. The new signer fixes a number of bugs. It is in a separate library and is available for use outside of Soto. The signer has also been extended to support signing streamed S3 requests.
Soto v5 introduces retries on failed requests to AWS. The user can provide a retry policy which defines the number of times to retry, how long to wait between each retry and what the client should retry on. By default the client will retry on all connection errors, 5xx HTTP responses and throttling errors. As recommended by AWS it uses an exponential increasing jitter function to define how long to wait between each retry.
Service specific changes
DynamoDB now has a
Codable encoder and decoder for
AttributeValue arrays. Along with this we have wrapped versions of the standard functions (
scanItem) to use the new encoder and decoder where applicable. This simplifies working with DynamoDB considerably and removes the need for custom serialization code for each object.
S3 multipart upload support has been improved. The upload of each part now uses streaming to reduce memory impact and provide a more accurate calculation of upload progress. If a multipart upload fails you can now resume the upload without having to upload the parts that have already uploaded.
There are many other minor changes which fix bugs or provide minor functionality improvements. Too many to list here. You can look through all the alpha, beta releases on GitHub to read the detailed change lists.