$ show soto-project/soto
Soto is a comprehensive Swift library for interacting with Amazon Web Services (AWS). It provides auto-generated, type-safe, async/await client code for over 300 AWS services, covering compute, storage, databases, machine learning, analytics, and more. The SDK uses a code generation pipeline (soto-codegenerator) that reads Smithy model files from the official AWS SDK Go v2 repository to produce Swift service structs, request/response shapes, paginators, and waiters. Beyond generated code, Soto includes handcrafted extensions for S3 (multipart uploads, presigned POST/URLs), DynamoDB (custom Encoder/Decoder to/from AttributeValue), and credential providers built on Cognito Identity and STS. The library depends on SotoCore for HTTP client, signing, and middleware infrastructure. It supports Linux, macOS, iOS, tvOS, and watchOS via Swift Package Manager.
The LLM identified 3 files worth highlighting for reuse:
Implements a custom `Encoder` that maps native Swift types (String, Int, Double, Bool, Date, Dictionary, Array, Optional) into DynamoDB's `AttributeValue` representation. Supports configurable date encoding strategies (secondsSince1970, millisecondsSince1970, iso8601, deferred to timestamp, custom). The encoder handles nested collections and recursive structures, and is designed to be used directly with DynamoDB put/update operations. This component is self-contained, requiring only SotoCore types, and can be extracted for any Swift project needing DynamoDB serialization.
Provides the reverse operation of `DynamoDBEncoder`: a custom `Decoder` that converts DynamoDB's `AttributeValue` map (`[String: AttributeValue]`) back into Swift types. It handles all DynamoDB types (S, N, B, BOOL, NULL, M, L, SS, NS, BS) and supports the same date decoding strategies. Uses recursive keyed, unkeyed, and single-value decoding containers. This component is critical for reading data from DynamoDB and mapping it to domain models, and is reusable in any Swift project using DynamoDB's document model.
Generates presigned POST policies for direct browser uploads to S3. Computes HMAC-SHA256 signatures, creates base64-encoded policy documents with expiration and conditions, and returns the complete form fields required for POST uploads. Demonstrates advanced usage of AWS Signature V4 and credential scoping. The component is standalone and can be reused in any Swift application that needs to allow client-side uploads to S3 without exposing permanent credentials.