diff --git a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.txt b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.txt index 712d57b2cb9..3fd89b63a77 100644 --- a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.txt +++ b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.txt @@ -129,7 +129,7 @@ private var runtimeTargets: [Target] { ), .target( name: "AWSSDKHTTPAuth", - dependencies: [.crt, .smithy, .clientRuntime, .smithyHTTPAuth, "AWSSDKChecksums"], + dependencies: [.crt, .smithy, .clientRuntime, .smithyHTTPAuth, "AWSSDKChecksums", "AWSSDKIdentity"], path: "Sources/Core/AWSSDKHTTPAuth/Sources" ), .target( diff --git a/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressConfigTests.swift b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressConfigTests.swift new file mode 100644 index 00000000000..db08bb8eeb2 --- /dev/null +++ b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressConfigTests.swift @@ -0,0 +1,157 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import Smithy +import XCTest +import AWSS3 +import ClientRuntime +import SmithyHTTPAPI +import SmithyHTTPAuthAPI +import SmithyTestUtil +import AWSSDKIdentity +import AWSSDKHTTPAuth + +// These tests confirm that the disableS3ExpressSessionAuth option +// works as expected and that the SDK selects the correct auth option +// based on bucket name. +// +// This test makes no connections to S3, either for the GetObject operation +// being tested, or to obtain S3 Express credentials. +// +// Tests set up an initial S3 client config and GetObject input params. +// An interceptor is used to determine that the correct auth scheme was +// selected based on the inputs. +// +// The ProtocolTestClient is used in place of a live HTTP client +// to prevent real HTTP requests from being made. +final class S3ExpressConfigTests: XCTestCase { + let region = "us-east-1" + + // This bucket name maps to a "general purpose" (i.e. non-S3 Express) bucket. + let ordinaryBucket = "testbucket" + + // This bucket name fits the S3 Express / directory bucket name pattern + let s3ExpressBucket = "testbucket--use1-az1--x-s3" + + var config: S3Client.S3ClientConfiguration! + + override func setUp() async throws { + try await super.setUp() + self.config = try await S3Client.Config( + s3ExpressIdentityResolver: MockS3ExpressIdentityResolver(), + region: region, + httpClientEngine: ProtocolTestClient() + ) + } + + func test_config_usesSigV4ForGeneralPurposeBucketByDefault() async throws { + self.config.addInterceptorProvider(CheckSelectedAuthSchemeProvider(expected: SigV4AuthScheme())) + let client = S3Client(config: config) + let input = GetObjectInput(bucket: ordinaryBucket, key: "text") + do { + _ = try await client.getObject(input: input) + } catch is TestCheckError { + // no-op + } + } + + func test_config_usesSigV4ForGeneralPurposeBucketWhenS3ExpressEnabled() async throws { + self.config.disableS3ExpressSessionAuth = false + self.config.addInterceptorProvider(CheckSelectedAuthSchemeProvider(expected: SigV4AuthScheme())) + let client = S3Client(config: config) + let input = GetObjectInput(bucket: ordinaryBucket, key: "text") + do { + _ = try await client.getObject(input: input) + } catch is TestCheckError { + // no-op + } + } + + func test_config_enablesS3ExpressByDefaultForS3ExpressBucket() async throws { + self.config.addInterceptorProvider(CheckSelectedAuthSchemeProvider(expected: SigV4S3ExpressAuthScheme())) + let client = S3Client(config: config) + let input = GetObjectInput(bucket: s3ExpressBucket, key: "text") + do { + _ = try await client.getObject(input: input) + } catch is TestCheckError { + // no-op + } + } + + func test_config_enablesS3ExpressExplicitlyForS3ExpressBucket() async throws { + self.config.disableS3ExpressSessionAuth = false + self.config.addInterceptorProvider(CheckSelectedAuthSchemeProvider(expected: SigV4S3ExpressAuthScheme())) + let client = S3Client(config: config) + let input = GetObjectInput(bucket: s3ExpressBucket, key: "text") + do { + _ = try await client.getObject(input: input) + } catch is TestCheckError { + // no-op + } + } + + func test_config_disablesS3ExpressForS3ExpressBucket() async throws { + self.config.disableS3ExpressSessionAuth = true + self.config.addInterceptorProvider(CheckSelectedAuthSchemeProvider(expected: SigV4AuthScheme())) + let client = S3Client(config: config) + let input = GetObjectInput(bucket: s3ExpressBucket, key: "text") + do { + _ = try await client.getObject(input: input) + } catch is TestCheckError { + // no-op + } + } +} + +class CheckSelectedAuthScheme: Interceptor { + typealias RequestType = HTTPRequest + typealias ResponseType = HTTPResponse + + let expectedAuthScheme: AuthScheme + + init(expected expectedAuthScheme: AuthScheme) { + self.expectedAuthScheme = expectedAuthScheme + } + + func readBeforeSigning(context: some AfterSerialization) async throws { + // Get the auth scheme and check that it matches expected + guard let selectedAuthScheme = context.getAttributes().selectedAuthScheme else { + XCTFail("No auth scheme selected"); return + } + XCTAssertEqual(selectedAuthScheme.schemeID, expectedAuthScheme.schemeID) + } +} + +class CheckSelectedAuthSchemeProvider: HttpInterceptorProvider { + + let expectedAuthScheme: AuthScheme + + init(expected expectedAuthScheme: AuthScheme) { + self.expectedAuthScheme = expectedAuthScheme + } + + func create() -> any Interceptor { + return CheckSelectedAuthScheme(expected: expectedAuthScheme) + } +} + +// Real S3 credentials are not needed for this test so a mock credential resolver +// is used to prevent obtaining credentials from live S3. +// +// The mock also prevents the interceptors above from needing logic to ignore the +// CreateSession call before the GetObject. +private actor MockS3ExpressIdentityResolver: S3ExpressIdentityResolver { + + func getIdentity(identityProperties: Smithy.Attributes?) async throws -> AWSSDKIdentity.S3ExpressIdentity { + return S3ExpressIdentity( + accessKeyID: "AKIAIOSFODNN7EXAMPLE", + secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + sessionToken: "abcdef", + expiration: Date().addingTimeInterval(300.0) + ) + } +} diff --git a/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressIntegrationTests.swift b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressIntegrationTests.swift new file mode 100644 index 00000000000..3fe8d9e8616 --- /dev/null +++ b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressIntegrationTests.swift @@ -0,0 +1,62 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import XCTest +import AWSS3 + +final class S3ExpressIntegrationTests: S3ExpressXCTestCase { + + // This test: + // - Creates multiple S3Express ("directory") buckets + // - Puts an object with sample contents to each bucket + // - Reads each object & compares its contents to the original data + // - Deletes the object from each bucket + // - Deletes each S3Express bucket + func test_s3Express_operationalTest() async throws { + + // The number of buckets to create + let n = 5 + + // The object key & data contents to put in each bucket + let key = "text" + let originalContents = Data("Hello, World!".utf8) + + // Create the S3Express-enabled directory buckets with random names, + // save the names for later use + var buckets = [String]() + for _ in 1...n { + let baseName = String(UUID().uuidString.prefix(8)).lowercased() + let newBucket = try await createS3ExpressBucket(baseName: baseName) + buckets.append(newBucket) + } + + // add an object to each bucket + for bucket in buckets { + let input = PutObjectInput(body: .data(originalContents), bucket: bucket, key: key) + let _ = try await client.putObject(input: input) + } + + // Get the object from each bucket, and check its contents match original + for bucket in buckets { + let input = GetObjectInput(bucket: bucket, key: key) + let output = try await client.getObject(input: input) + + let retrievedContents = try await output.body!.readData()! + XCTAssertEqual(retrievedContents, originalContents) + } + + // Delete the object from each bucket + for bucket in buckets { + try await deleteObject(bucket: bucket, key: key) + } + + // Delete each directory bucket + for bucket in buckets { + try await deleteBucket(bucket: bucket) + } + } +} diff --git a/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressPresignedURLTests.swift b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressPresignedURLTests.swift new file mode 100644 index 00000000000..0905c8bb1be --- /dev/null +++ b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressPresignedURLTests.swift @@ -0,0 +1,72 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif +import Foundation +import XCTest +import AWSS3 + +final class S3ExpressPresignedURLTests: S3ExpressXCTestCase { + + func test_putAndGetPresignedURL() async throws { + let key = "text" + let original = Data("Hello, World!".utf8) + + // Create a S3Express (directory) bucket + let bucket = try await createS3ExpressBucket() + + // Presign a PutObject URL + let putObjectInput = PutObjectInput(bucket: bucket, key: key) + let putObjectURL = try await putObjectInput.presignURL(config: config, expiration: 300.0) + + // Perform the S3 PutObject request + try await URLSession.perform(url: XCTUnwrap(putObjectURL), method: "PUT", body: original) + + // Presign a GetObject URL + let getObjectInput = GetObjectInput(bucket: bucket, key: key) + let getObjectURL = try await getObjectInput.presignURL(config: config, expiration: 300.0) + + // Perform the S3 GetObject request & keep the response data + let retrieved = try await URLSession.perform(url: XCTUnwrap(getObjectURL)) + + // Compare GetObject response to PutObject request + XCTAssertEqual(original, retrieved) + + // Delete the object + try await deleteObject(bucket: bucket, key: key) + + // Delete the bucket + try await deleteBucket(bucket: bucket) + } +} + +// Made this helper because URLSession's `data(for: URLRequest)` async method +// isn't available on Swift 5.9 for some reason. So I made my own URLSession-based +// async interface. +private extension URLSession { + + @discardableResult + static func perform(url: URL, method: String = "GET", body: Data? = nil) async throws -> Data { + return try await withCheckedThrowingContinuation { continuation in + var urlRequest = URLRequest(url: url) + urlRequest.httpMethod = method + urlRequest.httpBody = body + let dataTask = shared.dataTask(with: urlRequest) { data, _, error in + if let error { + continuation.resume(throwing: error) + } else { + // Empty data is returned if no data was received + // This works for the purposes of the tests we're running + continuation.resume(returning: data ?? Data()) + } + } + dataTask.resume() + } + } +} diff --git a/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressXCTestCase.swift b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressXCTestCase.swift new file mode 100644 index 00000000000..8a1ae9a29a5 --- /dev/null +++ b/IntegrationTests/Services/AWSS3IntegrationTests/S3ExpressXCTestCase.swift @@ -0,0 +1,60 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import XCTest +import AWSS3 + +class S3ExpressXCTestCase: XCTestCase { + // Region in which to run the test + var region: String { "us-west-2" } + + // Availability zone where the buckets should be created + var azID: String { "usw2-az1" } + + // The S3 client config object + var config: S3Client.Config! + + // The S3 client + var client: S3Client! + + override func setUp() async throws { + try await super.setUp() + self.config = try await S3Client.Config(region: region) + self.client = S3Client(config: config) + } + + @discardableResult + func createS3ExpressBucket( + baseName: String = String(UUID().uuidString.prefix(8)).lowercased() + ) async throws -> String { + let bucket = bucket(baseName: baseName) + let input = CreateBucketInput( + bucket: bucket, + createBucketConfiguration: .init( + bucket: .init(dataRedundancy: .singleavailabilityzone, type: .directory), + location: .init(name: azID, type: .availabilityzone) + ) + ) + let _ = try await client.createBucket(input: input) + return bucket + } + + func deleteObject(bucket: String, key: String) async throws { + let deleteObjectInput = DeleteObjectInput(bucket: bucket, key: key) + _ = try await client.deleteObject(input: deleteObjectInput) + } + + func deleteBucket(bucket: String) async throws { + let deleteBucketInput = DeleteBucketInput(bucket: bucket) + _ = try await client.deleteBucket(input: deleteBucketInput) + } + + // Helper method to create a S3Express-compliant bucket name + func bucket(baseName: String) -> String { + "a\(baseName)--\(azID)--x-s3" + } +} diff --git a/Package.swift b/Package.swift index 7a2854d4220..1cbdf03bc48 100644 --- a/Package.swift +++ b/Package.swift @@ -562,7 +562,7 @@ private var runtimeTargets: [Target] { ), .target( name: "AWSSDKHTTPAuth", - dependencies: [.crt, .smithy, .clientRuntime, .smithyHTTPAuth, "AWSSDKChecksums"], + dependencies: [.crt, .smithy, .clientRuntime, .smithyHTTPAuth, "AWSSDKChecksums", "AWSSDKIdentity"], path: "Sources/Core/AWSSDKHTTPAuth/Sources" ), .target( diff --git a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/AWSClientConfigDefaultsProvider.swift b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/AWSClientConfigDefaultsProvider.swift index 26f19683333..12a5b60bafe 100644 --- a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/AWSClientConfigDefaultsProvider.swift +++ b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/AWSClientConfigDefaultsProvider.swift @@ -6,6 +6,7 @@ // @_spi(FileBasedConfig) import class AWSSDKCommon.CRTFileBasedConfiguration +import struct AWSSDKCommon.FieldResolver import struct SmithyRetries.ExponentialBackoffStrategy import struct SmithyRetriesAPI.RetryStrategyOptions import enum AWSSDKChecksums.AWSChecksumCalculationMode @@ -168,4 +169,22 @@ public class AWSClientConfigDefaultsProvider: ClientConfigDefaultsProvider { ) } } + + public static func disableS3ExpressSessionAuth( + _ disableS3ExpressSessionAuth: Bool? = nil + ) throws -> Bool { + let fileBasedConfig = try CRTFileBasedConfiguration.make() + return FieldResolver( + configValue: disableS3ExpressSessionAuth, + envVarName: "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH", + configFieldName: "s3_disable_express_session_auth", + fileBasedConfig: fileBasedConfig, + profileName: nil, converter: { value in + switch value { + case "true": return true + case "false": return false + default: return nil + } + }).value ?? false + } } diff --git a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Endpoints/EndpointResolverMiddleware.swift b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Endpoints/EndpointResolverMiddleware.swift index 1576037cab0..cc3a095c6ad 100644 --- a/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Endpoints/EndpointResolverMiddleware.swift +++ b/Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Endpoints/EndpointResolverMiddleware.swift @@ -55,7 +55,7 @@ extension AWSEndpointResolverMiddleware: ApplyEndpoint { let authScheme = try authSchemeResolver.resolve(authSchemes: schemes) signingAlgorithm = authScheme.name switch authScheme { - case .sigV4(let param): + case .sigV4(let param), .sigV4S3Express(let param): signingName = param.signingName signingRegion = param.signingRegion case .sigV4A(let param): diff --git a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/AWSSigV4Signer.swift b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/AWSSigV4Signer.swift index 36c8240f8a0..c37ab588917 100644 --- a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/AWSSigV4Signer.swift +++ b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/AWSSigV4Signer.swift @@ -5,6 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 // +import struct AWSSDKIdentity.S3ExpressIdentity import class AwsCommonRuntimeKit.HTTPRequestBase import class AwsCommonRuntimeKit.Signer import class SmithyHTTPAPI.HTTPRequest @@ -48,7 +49,7 @@ public final class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer, Sendable { ) } - guard let identity = identity as? AWSCredentialIdentity else { + guard let identity = identity.asAWSCredentialIdentity else { throw Smithy.ClientError.authError( "Identity passed to the AWSSigV4Signer must be of type Credentials." ) @@ -273,3 +274,18 @@ extension SigningConfig { } } } + +private extension Identity { + + var asAWSCredentialIdentity: AWSCredentialIdentity? { + (self as? AWSCredentialIdentity) ?? + (self as? S3ExpressIdentity)?.awsCredentialIdentity + } +} + +private extension S3ExpressIdentity { + + var awsCredentialIdentity: AWSCredentialIdentity { + .init(accessKey: accessKeyID, secret: secretAccessKey, expiration: expiration, sessionToken: sessionToken) + } +} diff --git a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AAuthScheme.swift b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AAuthScheme.swift index 194f95c6a62..7fe82c81581 100644 --- a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AAuthScheme.swift +++ b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AAuthScheme.swift @@ -30,8 +30,9 @@ public struct SigV4AAuthScheme: AuthScheme { value: context.isBidirectionalStreamingEnabled ) - // Set signing name and signing region flags - updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: context.signingName) + // Set resolved signing name and signing region flags + let signingName = updatedSigningProperties.get(key: SigningPropertyKeys.signingName) ?? context.signingName + updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: signingName) updatedSigningProperties.set( key: SigningPropertyKeys.signingRegion, value: signingProperties.get(key: SigningPropertyKeys.signingRegion) ?? context.signingRegion diff --git a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AuthScheme.swift b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AuthScheme.swift index 79d8ea06487..b0c45851489 100644 --- a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AuthScheme.swift +++ b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4AuthScheme.swift @@ -37,8 +37,9 @@ public struct SigV4AuthScheme: AuthScheme { value: context.isBidirectionalStreamingEnabled ) - // Set signing name and signing region flags - updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: context.signingName) + // Set resolved signing name and signing region flags + let signingName = updatedSigningProperties.get(key: SigningPropertyKeys.signingName) ?? context.signingName + updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: signingName) updatedSigningProperties.set( key: SigningPropertyKeys.signingRegion, value: signingProperties.get(key: SigningPropertyKeys.signingRegion) ?? context.signingRegion diff --git a/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4S3ExpressAuthScheme.swift b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4S3ExpressAuthScheme.swift new file mode 100644 index 00000000000..ee393b4c469 --- /dev/null +++ b/Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/SigV4S3ExpressAuthScheme.swift @@ -0,0 +1,96 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import class Smithy.Context +import enum SmithyHTTPAuthAPI.AWSSignedBodyHeader +import enum SmithyHTTPAuthAPI.SigningPropertyKeys +import protocol SmithyHTTPAuthAPI.AuthScheme +import protocol SmithyHTTPAuthAPI.Signer +import struct Smithy.Attributes + +public struct SigV4S3ExpressAuthScheme: AuthScheme { + public let schemeID: String = "aws.auth#sigv4-s3express" + public let signer: Signer = AWSSigV4Signer() + public let requestUnsignedBody: Bool + + public init() { + self.requestUnsignedBody = false + } + + public init(requestUnsignedBody: Bool) { + self.requestUnsignedBody = requestUnsignedBody + } + + public func customizeSigningProperties(signingProperties: Attributes, context: Context) throws -> Attributes { + var updatedSigningProperties = signingProperties + + // Set signing algorithm flag + updatedSigningProperties.set(key: SigningPropertyKeys.signingAlgorithm, value: .sigv4s3express) + + // Set bidirectional streaming flag + updatedSigningProperties.set( + key: SigningPropertyKeys.bidirectionalStreaming, + value: context.isBidirectionalStreamingEnabled + ) + + // Set resolved signing name and signing region flags + let signingName = updatedSigningProperties.get(key: SigningPropertyKeys.signingName) ?? context.signingName + updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: signingName) + updatedSigningProperties.set( + key: SigningPropertyKeys.signingRegion, + value: signingProperties.get(key: SigningPropertyKeys.signingRegion) ?? context.signingRegion + ) + + // Set expiration flag + // + // Expiration is only used for presigning (presign request flow or presign URL flow). + updatedSigningProperties.set(key: SigningPropertyKeys.expiration, value: context.expiration) + + // Set signature type flag + // + // AWSSignatureType.requestQueryParams is only used for presign URL flow. + // Out of the AWSSignatureType enum cases, only two are used. .requestHeaders and .requestQueryParams. + // .requestHeaders is the deafult signing used for AWS operations. + let isPresignURLFlow = context.getFlowType() == .PRESIGN_URL + updatedSigningProperties.set( + key: SigningPropertyKeys.signatureType, + value: isPresignURLFlow ? .requestQueryParams : .requestHeaders + ) + + // Set unsignedBody to true IFF operation had unsigned payload trait. + let unsignedBody = context.hasUnsignedPayloadTrait() + updatedSigningProperties.set(key: SigningPropertyKeys.unsignedBody, value: unsignedBody) + + // Set default values. + updatedSigningProperties.set(key: SigningPropertyKeys.signedBodyHeader, value: AWSSignedBodyHeader.none) + updatedSigningProperties.set(key: SigningPropertyKeys.useDoubleURIEncode, value: true) + updatedSigningProperties.set(key: SigningPropertyKeys.shouldNormalizeURIPath, value: true) + updatedSigningProperties.set(key: SigningPropertyKeys.omitSessionToken, value: false) + + // Copy checksum from middleware context to signing properties + updatedSigningProperties.set(key: SigningPropertyKeys.checksum, value: context.checksumString) + + // Copy chunked streaming eligiblity from middleware context to signing properties + updatedSigningProperties.set( + key: SigningPropertyKeys.isChunkedEligibleStream, + value: context.isChunkedEligibleStream + ) + + // Optionally toggle unsigned body + if self.requestUnsignedBody { + updatedSigningProperties.set(key: SigningPropertyKeys.requestUnsignedBody, value: true) + } + + // Set service-specific signing properties if needed. + try CustomSigningPropertiesSetter().setServiceSpecificSigningProperties( + signingProperties: &updatedSigningProperties, + context: context + ) + + return updatedSigningProperties + } +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/AWSIdentityPropertyKeys.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/AWSIdentityPropertyKeys.swift new file mode 100644 index 00000000000..5a6ffc3ae16 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/AWSIdentityPropertyKeys.swift @@ -0,0 +1,29 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import struct Smithy.AttributeKey + +public enum AWSIdentityPropertyKeys { + + /// The S3 bucket associated with the credentials to be resolved. + /// + /// Used only in conjunction with the `awsv4-s3express` auth scheme, which generates bucket-specific credentials + /// for use with the S3 Express service. + public static let bucket = AttributeKey(name: "AWSIdentityBucket") + + /// The region to be used for client creation. + /// + /// Used only in conjunction with the `awsv4-s3express` auth scheme, which generates bucket-specific credentials + /// for use with the S3 Express service. + public static let region = AttributeKey(name: "AWSIdentityRegion") + + /// The S3 service client to be used in credential resolution. + /// + /// Used only in conjunction with the `awsv4-s3express` auth scheme, which generates bucket-specific credentials + /// for use with the S3 Express service. + public static let s3ExpressClient = AttributeKey(name: "AWSIdentityS3Client") +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/Context+S3ExpressIdentity.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/Context+S3ExpressIdentity.swift new file mode 100644 index 00000000000..b21daf53762 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/Context+S3ExpressIdentity.swift @@ -0,0 +1,23 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import class Smithy.Context +import struct Smithy.AttributeKey +import struct SmithyIdentity.AWSCredentialIdentity + +public extension Context { + + /// The S3Express identity that was resolved for this request, if any. + /// + /// Will be set at the time of signing if the auth scheme resolved to `aws.auth#sigv4-s3express`, will be `nil` otherwise. + var s3ExpressIdentity: S3ExpressIdentity? { + get { get(key: s3ExpressIdentityKey) } + set { set(key: s3ExpressIdentityKey, value: newValue) } + } +} + +private let s3ExpressIdentityKey: AttributeKey = .init(name: "S3ExpressIdentity") diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/DefaultS3ExpressIdentityResolver.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/DefaultS3ExpressIdentityResolver.swift new file mode 100644 index 00000000000..5305a226c21 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/DefaultS3ExpressIdentityResolver.swift @@ -0,0 +1,43 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import struct Smithy.Attributes + +public actor DefaultS3ExpressIdentityResolver: S3ExpressIdentityResolver { + private typealias CacheType = [S3ExpressIdentityCachedElement.CacheKey: S3ExpressIdentityCachedElement] + + private var cache: CacheType = [:] + + public init() {} + + public func getIdentity(identityProperties: Attributes?) async throws -> S3ExpressIdentity { + guard let identityProperties else { throw S3ExpressClientError.missingIdentityProperties } + let identityCachedElement = try getCachedIdentity(identityProperties: identityProperties) + return try await identityCachedElement.accessIdentity() + } + + // Gets the cached identity if one is in the cache. + // If no identity is cached for the current request, create one, put it in the cache, and return it. + private func getCachedIdentity(identityProperties: Attributes) throws -> S3ExpressIdentityCachedElement { + let cacheKey = try S3ExpressIdentityCachedElement.CacheKey(identityProperties: identityProperties) + if let identityCachedElement = cache[cacheKey] { + return identityCachedElement + } else { + let newIdentityCachedElement = + try S3ExpressIdentityCachedElement(resolver: self, identityProperties: identityProperties) + cache[cacheKey] = newIdentityCachedElement + return newIdentityCachedElement + } + } + + // Check that the identity of the element is as expected, then remove that element from the cache. + // The identity check ensures that the new element is not removed if a refresh has taken place. + func remove(element: S3ExpressIdentityCachedElement, cacheKey: S3ExpressIdentityCachedElement.CacheKey) { + guard cache[cacheKey] === element else { return } + cache.removeValue(forKey: cacheKey) + } +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressCachedElement.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressCachedElement.swift new file mode 100644 index 00000000000..0dd28adffec --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressCachedElement.swift @@ -0,0 +1,153 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +@_spi(ClientConfigWrapper) import enum ClientRuntime.IdentityPropertyKeys +import struct Foundation.Date +import struct Foundation.TimeInterval +import struct Foundation.UUID +import struct Smithy.Attributes + +final actor S3ExpressIdentityCachedElement { + + struct CacheKey: Hashable { + let bucket: String + + init(identityProperties: Attributes) throws { + guard let bucket = identityProperties.get(key: AWSIdentityPropertyKeys.bucket) else { + throw S3ExpressClientError.bucketNotProvided + } + self.bucket = bucket + } + } + + enum Status { + case initial + case unaccessed + case accessed + } + + // The amount of time before credentials expire that the refresh task is scheduled for. + private static let buffer: TimeInterval = 30.0 + + private weak var resolver: DefaultS3ExpressIdentityResolver? + private let identityProperties: Attributes + private let cacheKey: CacheKey + private var retrieveTask: Task + private var refreshTask: Task? + private var status: Status + + init(resolver: DefaultS3ExpressIdentityResolver, identityProperties: Attributes) throws { + self.resolver = resolver + self.identityProperties = identityProperties + self.cacheKey = try CacheKey(identityProperties: identityProperties) + self.status = .initial + self.retrieveTask = Self.newRetrieveTask(identityProperties: identityProperties) + Task { + // This is performed in its own Task so as to keep the initializer synchronous. + await scheduleRefreshTask() + } + } + + deinit { + // Cancel the current refresh task so it does not schedule further tasks after its wait. + refreshTask?.cancel() + } + + func accessIdentity() async throws -> S3ExpressIdentity { + do { + let identity = try await retrieveTask.value + status = .accessed + return identity + } catch { + // If there was an error retrieving credentials, throw it to the caller + // and remove this cached element. + // A subsequent request will create a new cached element. + await removeSelfFromCache() + throw error + } + } + + private static func newRetrieveTask(identityProperties: Attributes) -> Task { + // Note that this task does not capture self, so that the task can be assigned to + // the retrieveTask property without causing a reference cycle. + return Task { + guard let wrapper = identityProperties.get(key: IdentityPropertyKeys.clientConfigWrapper) else { + throw S3ExpressClientError.clientConfigNotProvided + } + guard let client = identityProperties.get(key: AWSIdentityPropertyKeys.s3ExpressClient) else { + throw S3ExpressClientError.clientNotProvided + } + guard let bucket = identityProperties.get(key: AWSIdentityPropertyKeys.bucket) else { + throw S3ExpressClientError.bucketNotProvided + } + return try await client.createSession(clientConfig: wrapper.clientConfig, bucket: bucket) + } + } + + private func scheduleRefreshTask() { + // Cancel any previous refresh task + self.refreshTask?.cancel() + + // Task captures self weakly, to prevent refreshing a cache that has been purged. + // self is then bound strongly both before & after the credential refresh wait. + self.refreshTask = Task { [weak self] in + guard let selfBeforeWait = self else { return } + let expiration: Date + do { + expiration = try await selfBeforeWait.retrieveTask.value.expiration ?? Date.distantPast + } catch { + // If there was an error retrieving credentials, throw it to the caller + // and remove this cached element. + // A subsequent access to credentials will create a new cached element. + await selfBeforeWait.removeSelfFromCache() + throw error + } + + // Asynchronously wait until the credentials are within buffer time of expiring. + // Use the modern `ContinuousClock` time measurement if available. + let now = Date() + if #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) { + let interval = expiration.timeIntervalSince(now) - Self.buffer + let duration = Duration(secondsComponent: Int64(interval), attosecondsComponent: 0) + let clock = ContinuousClock.now.advanced(by: duration) + let tolerance = Duration(secondsComponent: 1, attosecondsComponent: 0) + try await Task.sleep(until: clock, tolerance: tolerance, clock: .continuous) + } else { + let interval = expiration.timeIntervalSince(now) - Self.buffer + try await Task.sleep(nanoseconds: UInt64(interval) * 1_000_000_000) + } + + // wait has now passed. Perform the credential refresh if credentials have been accessed, + // else this cached element will be purged for not being used. + guard !Task.isCancelled, let selfAfterWait = self else { return } + await selfAfterWait.performRefreshIfNeeded() + } + } + + private func performRefreshIfNeeded() async { + switch status { + case .initial: + // This is the very first access to these credentials. + // If there isn't another access before refresh, these credentials will get purged. + status = .unaccessed + case .unaccessed: + // Credential hasn't been accessed since initial access. + // Purge this cached element from the cache. + await removeSelfFromCache() + case .accessed: + // Credential has been accessed since last refresh + // Refresh again. + self.status = .unaccessed + retrieveTask = Self.newRetrieveTask(identityProperties: identityProperties) + scheduleRefreshTask() + } + } + + private func removeSelfFromCache() async { + await resolver?.remove(element: self, cacheKey: cacheKey) + } +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressClientError.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressClientError.swift new file mode 100644 index 00000000000..f8c01d22ddd --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/IdentityResolver/S3ExpressClientError.swift @@ -0,0 +1,13 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +public enum S3ExpressClientError: Error { + case missingIdentityProperties + case clientConfigNotProvided + case clientNotProvided + case bucketNotProvided +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressCreateSessionClient.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressCreateSessionClient.swift new file mode 100644 index 00000000000..6e912b10479 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressCreateSessionClient.swift @@ -0,0 +1,30 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import protocol ClientRuntime.DefaultClientConfiguration + +/// Protocol that allows a S3 client to be created & used by the S3Express identity resolver without taking +/// a direct dependency on it. +/// +/// The `S3ExpressCreateSessionClient` concrete type, which conforms to this protocol, +/// is code-generated into the `AWSS3` module along with the S3 client. +public protocol S3ExpressCreateSessionClient: Sendable { + + /// Uses standard AWS credentials to obtain bucket-specific S3 Express-specific credentials + /// from the AWS S3 `CreateSession` operation. + /// - Parameters: + /// - clientConfig: The S3 client config object to be used for the `CreateSession` S3 client. + /// Passing any type of config object other than S3 will result in a + /// `S3ExpressClientError.clientConfigNotProvided` error. + /// - bucket: The name of the S3 directory bucket to obtain credentials for. + /// - Returns: S3 Express-specific credentials. Credentials are typically good for 5 minutes, and are + /// only usable for the specified bucket. + func createSession( + clientConfig: DefaultClientConfiguration, + bucket: String + ) async throws -> S3ExpressIdentity +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentity.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentity.swift new file mode 100644 index 00000000000..d77aad25ca6 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentity.swift @@ -0,0 +1,23 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import protocol SmithyIdentityAPI.Identity +import struct Foundation.Date + +public struct S3ExpressIdentity: Identity { + public var accessKeyID: String + public var secretAccessKey: String + public var sessionToken: String + public var expiration: Date? + + public init(accessKeyID: String, secretAccessKey: String, sessionToken: String, expiration: Date?) { + self.accessKeyID = accessKeyID + self.secretAccessKey = secretAccessKey + self.sessionToken = sessionToken + self.expiration = expiration + } +} diff --git a/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentityResolver.swift b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentityResolver.swift new file mode 100644 index 00000000000..492fe02e6f4 --- /dev/null +++ b/Sources/Core/AWSSDKIdentity/Sources/AWSSDKIdentity/S3Express/S3ExpressIdentityResolver.swift @@ -0,0 +1,11 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +import struct Smithy.Attributes +import protocol SmithyIdentityAPI.IdentityResolver + +public protocol S3ExpressIdentityResolver: IdentityResolver where IdentityT == S3ExpressIdentity {} diff --git a/Sources/Services/AWSS3/Sources/AWSS3/AuthSchemeResolver.swift b/Sources/Services/AWSS3/Sources/AWSS3/AuthSchemeResolver.swift index c833783707f..3737bb4cc36 100644 --- a/Sources/Services/AWSS3/Sources/AWSS3/AuthSchemeResolver.swift +++ b/Sources/Services/AWSS3/Sources/AWSS3/AuthSchemeResolver.swift @@ -8,6 +8,7 @@ // Code generated by smithy-swift-codegen. DO NOT EDIT! import class Smithy.Context +import enum AWSSDKIdentity.AWSIdentityPropertyKeys import enum AWSSDKIdentity.InternalClientKeys import enum ClientRuntime.EndpointsAuthScheme import enum Smithy.ClientError @@ -130,6 +131,13 @@ public struct DefaultS3AuthSchemeResolver: S3AuthSchemeResolver { sigV4Option.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingRegion, value: param.signingRegionSet?[0]) sigV4Option.identityProperties.set(key: AWSSDKIdentity.InternalClientKeys.internalSTSClientKey, value: InternalAWSSTS.IdentityProvidingSTSClient()) validAuthOptions.append(sigV4Option) + case .sigV4S3Express(let param): + var authOption = SmithyHTTPAuthAPI.AuthOption(schemeID: "aws.auth#sigv4-s3express") + authOption.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingName, value: param.signingName) + authOption.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingRegion, value: param.signingRegion) + authOption.identityProperties.set(key: AWSSDKIdentity.AWSIdentityPropertyKeys.bucket, value: serviceParams.bucket) + authOption.identityProperties.set(key: AWSSDKIdentity.AWSIdentityPropertyKeys.s3ExpressClient, value: S3ExpressCreateSessionClient()) + validAuthOptions.append(authOption) default: throw Smithy.ClientError.authError("Unknown auth scheme name: \(scheme.name)") } diff --git a/Sources/Services/AWSS3/Sources/AWSS3/Models.swift b/Sources/Services/AWSS3/Sources/AWSS3/Models.swift index 14a4a689776..3b88f533870 100644 --- a/Sources/Services/AWSS3/Sources/AWSS3/Models.swift +++ b/Sources/Services/AWSS3/Sources/AWSS3/Models.swift @@ -22765,11 +22765,13 @@ extension GetObjectInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -22915,11 +22917,13 @@ extension PutObjectInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -23006,11 +23010,13 @@ extension UploadPartInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -23076,11 +23082,13 @@ extension GetObjectInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -23149,11 +23157,13 @@ extension PutObjectInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -23226,11 +23236,13 @@ extension UploadPartInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in diff --git a/Sources/Services/AWSS3/Sources/AWSS3/Plugins.swift b/Sources/Services/AWSS3/Sources/AWSS3/Plugins.swift index 73712c02e62..a5fce50f335 100644 --- a/Sources/Services/AWSS3/Sources/AWSS3/Plugins.swift +++ b/Sources/Services/AWSS3/Sources/AWSS3/Plugins.swift @@ -15,6 +15,7 @@ import protocol SmithyIdentity.AWSCredentialIdentityResolver import protocol SmithyIdentity.BearerTokenIdentityResolver import struct AWSSDKHTTPAuth.SigV4AAuthScheme import struct AWSSDKHTTPAuth.SigV4AuthScheme +import struct AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme import struct SmithyIdentity.BearerTokenIdentity import struct SmithyIdentity.StaticBearerTokenIdentityResolver import typealias SmithyHTTPAuthAPI.AuthSchemes @@ -44,7 +45,7 @@ public class DefaultAWSAuthSchemePlugin: ClientRuntime.Plugin { public func configureClient(clientConfiguration: ClientRuntime.ClientConfiguration) throws { if let config = clientConfiguration as? S3Client.S3ClientConfiguration { config.authSchemeResolver = DefaultS3AuthSchemeResolver() - config.authSchemes = [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme()] + config.authSchemes = [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme(), AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme()] config.awsCredentialIdentityResolver = AWSSDKIdentity.DefaultAWSCredentialIdentityResolverChain() config.bearerTokenIdentityResolver = SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")) } diff --git a/Sources/Services/AWSS3/Sources/AWSS3/S3Client+S3Express.swift b/Sources/Services/AWSS3/Sources/AWSS3/S3Client+S3Express.swift new file mode 100644 index 00000000000..8c66af2483d --- /dev/null +++ b/Sources/Services/AWSS3/Sources/AWSS3/S3Client+S3Express.swift @@ -0,0 +1,33 @@ +// +// Copyright Amazon.com Inc. or its affiliates. +// All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// + +// Code generated by smithy-swift-codegen. DO NOT EDIT! + +import enum AWSSDKIdentity.S3ExpressClientError +import protocol AWSSDKIdentity.S3ExpressCreateSessionClient +import protocol ClientRuntime.DefaultClientConfiguration +import struct AWSSDKIdentity.S3ExpressIdentity + + +public struct S3ExpressCreateSessionClient: AWSSDKIdentity.S3ExpressCreateSessionClient, Swift.Sendable { + + public func createSession(clientConfig: ClientRuntime.DefaultClientConfiguration, bucket: Swift.String) async throws -> AWSSDKIdentity.S3ExpressIdentity { + guard let config = clientConfig as? S3Client.Config else { + throw AWSSDKIdentity.S3ExpressClientError.clientConfigNotProvided + } + let client = S3Client(config: config) + let input = CreateSessionInput(bucket: bucket) + let output = try await client.createSession(input: input) + guard let creds = output.credentials, let accessKeyID = creds.accessKeyId, let secretAccessKey = creds.secretAccessKey, let sessionToken = creds.sessionToken else { fatalError() } + return AWSSDKIdentity.S3ExpressIdentity( + accessKeyID: accessKeyID, + secretAccessKey: secretAccessKey, + sessionToken: sessionToken, + expiration: output.credentials?.expiration + ) + } +} diff --git a/Sources/Services/AWSS3/Sources/AWSS3/S3Client.swift b/Sources/Services/AWSS3/Sources/AWSS3/S3Client.swift index b4541972689..57c1b6b300a 100644 --- a/Sources/Services/AWSS3/Sources/AWSS3/S3Client.swift +++ b/Sources/Services/AWSS3/Sources/AWSS3/S3Client.swift @@ -15,6 +15,7 @@ import class AWSClientRuntime.AWSClientConfigDefaultsProvider import class AWSClientRuntime.AmzSdkRequestMiddleware import class AWSClientRuntime.DefaultAWSClientPlugin import class AWSSDKIdentity.DefaultAWSCredentialIdentityResolverChain +import class AWSSDKIdentity.DefaultS3ExpressIdentityResolver import class ClientRuntime.ClientBuilder import class ClientRuntime.DefaultClientPlugin import class ClientRuntime.HttpClientConfiguration @@ -37,6 +38,7 @@ import enum Smithy.ClientError @_spi(SmithyReadWrite) import enum SmithyReadWrite.WritingClosures import protocol AWSClientRuntime.AWSDefaultClientConfiguration import protocol AWSClientRuntime.AWSRegionClientConfiguration +import protocol AWSSDKIdentity.S3ExpressIdentityResolver import protocol ClientRuntime.Client import protocol ClientRuntime.DefaultClientConfiguration import protocol ClientRuntime.DefaultHttpClientConfiguration @@ -58,6 +60,7 @@ import struct AWSClientRuntime.FlexibleChecksumsResponseMiddleware import struct AWSClientRuntime.UserAgentMiddleware import struct AWSSDKHTTPAuth.SigV4AAuthScheme import struct AWSSDKHTTPAuth.SigV4AuthScheme +import struct AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme import struct ClientRuntime.AuthSchemeMiddleware import struct ClientRuntime.BlobStreamBodyMiddleware @_spi(SmithyReadWrite) import struct ClientRuntime.BodyMiddleware @@ -107,6 +110,7 @@ public class S3Client: ClientRuntime.Client { extension S3Client { public class S3ClientConfiguration: AWSClientRuntime.AWSDefaultClientConfiguration & AWSClientRuntime.AWSRegionClientConfiguration & ClientRuntime.DefaultClientConfiguration & ClientRuntime.DefaultHttpClientConfiguration { + public var s3ExpressIdentityResolver: any AWSSDKIdentity.S3ExpressIdentityResolver public var useFIPS: Swift.Bool? public var useDualStack: Swift.Bool? public var appID: Swift.String? @@ -141,6 +145,7 @@ extension S3Client { internal let logger: Smithy.LogAgent private init( + _ s3ExpressIdentityResolver: any AWSSDKIdentity.S3ExpressIdentityResolver, _ useFIPS: Swift.Bool?, _ useDualStack: Swift.Bool?, _ appID: Swift.String?, @@ -173,6 +178,7 @@ extension S3Client { _ interceptorProviders: [ClientRuntime.InterceptorProvider], _ httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider] ) { + self.s3ExpressIdentityResolver = s3ExpressIdentityResolver self.useFIPS = useFIPS self.useDualStack = useDualStack self.appID = appID @@ -208,6 +214,7 @@ extension S3Client { } public convenience init( + s3ExpressIdentityResolver: (any AWSSDKIdentity.S3ExpressIdentityResolver)? = nil, useFIPS: Swift.Bool? = nil, useDualStack: Swift.Bool? = nil, appID: Swift.String? = nil, @@ -241,6 +248,7 @@ extension S3Client { httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider]? = nil ) throws { self.init( + s3ExpressIdentityResolver ?? AWSSDKIdentity.DefaultS3ExpressIdentityResolver(), useFIPS, useDualStack, try appID ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), @@ -256,7 +264,7 @@ extension S3Client { useArnRegion, disableMultiRegionAccessPoints, accelerate, - disableS3ExpressSessionAuth, + try disableS3ExpressSessionAuth ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.disableS3ExpressSessionAuth(), useGlobalEndpoint, try endpointResolver ?? DefaultEndpointResolver(), telemetryProvider ?? ClientRuntime.DefaultTelemetry.provider, @@ -266,7 +274,7 @@ extension S3Client { idempotencyTokenGenerator ?? AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), httpClientEngine ?? AWSClientConfigDefaultsProvider.httpClientEngine(httpClientConfiguration), httpClientConfiguration ?? AWSClientConfigDefaultsProvider.httpClientConfiguration(), - authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme()], + authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme(), AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme()], authSchemePreference ?? nil, authSchemeResolver ?? DefaultS3AuthSchemeResolver(), bearerTokenIdentityResolver ?? SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), @@ -276,6 +284,7 @@ extension S3Client { } public convenience init( + s3ExpressIdentityResolver: (any AWSSDKIdentity.S3ExpressIdentityResolver)? = nil, useFIPS: Swift.Bool? = nil, useDualStack: Swift.Bool? = nil, appID: Swift.String? = nil, @@ -309,6 +318,7 @@ extension S3Client { httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider]? = nil ) async throws { self.init( + s3ExpressIdentityResolver ?? AWSSDKIdentity.DefaultS3ExpressIdentityResolver(), useFIPS, useDualStack, try appID ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), @@ -324,7 +334,7 @@ extension S3Client { useArnRegion, disableMultiRegionAccessPoints, accelerate, - disableS3ExpressSessionAuth, + try disableS3ExpressSessionAuth ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.disableS3ExpressSessionAuth(), useGlobalEndpoint, try endpointResolver ?? DefaultEndpointResolver(), telemetryProvider ?? ClientRuntime.DefaultTelemetry.provider, @@ -334,7 +344,7 @@ extension S3Client { idempotencyTokenGenerator ?? AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), httpClientEngine ?? AWSClientConfigDefaultsProvider.httpClientEngine(httpClientConfiguration), httpClientConfiguration ?? AWSClientConfigDefaultsProvider.httpClientConfiguration(), - authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme()], + authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme(), AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme()], authSchemePreference ?? nil, authSchemeResolver ?? DefaultS3AuthSchemeResolver(), bearerTokenIdentityResolver ?? SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), @@ -345,6 +355,7 @@ extension S3Client { public convenience required init() async throws { try await self.init( + s3ExpressIdentityResolver: nil, useFIPS: nil, useDualStack: nil, appID: nil, @@ -381,6 +392,7 @@ extension S3Client { public convenience init(region: Swift.String) throws { self.init( + AWSSDKIdentity.DefaultS3ExpressIdentityResolver(), nil, nil, try AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), @@ -396,7 +408,7 @@ extension S3Client { nil, nil, nil, - nil, + try AWSClientRuntime.AWSClientConfigDefaultsProvider.disableS3ExpressSessionAuth(), nil, try DefaultEndpointResolver(), ClientRuntime.DefaultTelemetry.provider, @@ -406,7 +418,7 @@ extension S3Client { AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), AWSClientConfigDefaultsProvider.httpClientEngine(), AWSClientConfigDefaultsProvider.httpClientConfiguration(), - [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme()], + [AWSSDKHTTPAuth.SigV4AuthScheme(), AWSSDKHTTPAuth.SigV4AAuthScheme(), AWSSDKHTTPAuth.SigV4S3ExpressAuthScheme()], nil, DefaultS3AuthSchemeResolver(), SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), @@ -491,11 +503,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -618,11 +632,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -752,11 +768,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -858,11 +876,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -948,11 +968,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1090,11 +1112,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1175,11 +1199,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1264,11 +1290,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1340,11 +1368,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1415,11 +1445,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1504,11 +1536,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1581,11 +1615,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1658,11 +1694,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1743,11 +1781,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1818,11 +1858,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1897,11 +1939,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -1972,11 +2016,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2054,11 +2100,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2129,11 +2177,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2204,11 +2254,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2279,11 +2331,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2382,11 +2436,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2457,11 +2513,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2566,11 +2624,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2649,11 +2709,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2722,11 +2784,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2795,11 +2859,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2872,11 +2938,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -2947,11 +3015,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3036,11 +3106,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3113,11 +3185,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3190,11 +3264,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3291,11 +3367,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3366,11 +3444,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3441,11 +3521,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3516,11 +3598,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3595,11 +3679,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3668,11 +3754,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3750,11 +3838,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3830,11 +3920,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3909,11 +4001,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -3984,11 +4078,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4057,11 +4153,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4142,11 +4240,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4219,11 +4319,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4294,11 +4396,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4404,11 +4508,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4488,11 +4594,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4631,11 +4739,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4704,11 +4814,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4777,11 +4889,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4850,11 +4964,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -4927,11 +5043,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5000,11 +5118,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5078,11 +5198,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5161,11 +5283,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5277,11 +5401,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5354,11 +5480,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5431,11 +5559,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5508,11 +5638,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5585,11 +5717,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5656,11 +5790,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5726,11 +5862,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5827,11 +5965,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5906,11 +6046,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -5992,11 +6134,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6097,11 +6241,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6187,11 +6333,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6269,11 +6417,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6420,11 +6570,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6534,11 +6686,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6623,11 +6777,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6736,11 +6892,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6820,11 +6978,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -6900,11 +7060,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7006,11 +7168,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7098,11 +7262,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7188,11 +7354,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7264,11 +7432,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7342,11 +7512,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7428,11 +7600,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7507,11 +7681,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7586,11 +7762,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7676,11 +7854,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7757,11 +7937,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -7878,11 +8060,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8012,11 +8196,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8159,11 +8345,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8234,11 +8422,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8315,11 +8505,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8390,11 +8582,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8480,11 +8674,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8563,11 +8759,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8787,11 +8985,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -8886,11 +9086,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -9007,11 +9209,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -9145,11 +9349,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in @@ -9216,11 +9422,13 @@ extension S3Client { .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSAuthUtils.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSAuthUtils.kt index 18080fe80eb..8d1a1a78cca 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSAuthUtils.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSAuthUtils.kt @@ -5,6 +5,7 @@ package software.amazon.smithy.aws.swift.codegen +import software.amazon.smithy.aws.swift.codegen.customization.s3.isS3 import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSSDKHTTPAuthTypes import software.amazon.smithy.aws.traits.auth.SigV4ATrait import software.amazon.smithy.aws.traits.auth.SigV4Trait @@ -86,7 +87,9 @@ open class AWSAuthUtils( if (effectiveAuthSchemes.contains(SigV4ATrait.ID) || servicesUsingSigV4A.contains(sdkId)) { updatedAuthSchemeList += writer.format("\$N()", AWSSDKHTTPAuthTypes.SigV4AAuthScheme) } - + if (ctx.service.isS3) { + updatedAuthSchemeList += writer.format("\$N()", AWSSDKHTTPAuthTypes.SigV4S3ExpressAuthScheme) + } return updatedAuthSchemeList } } diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHTTPProtocolCustomizations.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHTTPProtocolCustomizations.kt index 2aec37d1f64..5e9b22bcee5 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHTTPProtocolCustomizations.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHTTPProtocolCustomizations.kt @@ -6,6 +6,7 @@ package software.amazon.smithy.aws.swift.codegen import software.amazon.smithy.aws.swift.codegen.customization.RulesBasedAuthSchemeResolverGenerator +import software.amazon.smithy.aws.swift.codegen.customization.s3.isS3 import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSClientRuntimeTypes import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSSDKEventStreamsAuthTypes import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSSDKIdentityTypes @@ -39,6 +40,9 @@ abstract class AWSHTTPProtocolCustomizations : DefaultHTTPProtocolCustomizations } writer.write(" .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: \$S)", "aws.auth#sigv4") writer.write(" .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: \$S)", "aws.auth#sigv4a") + if (ctx.service.isS3) { + writer.write(" .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: \$S)", "aws.auth#sigv4-s3express") + } writer.write(" .withRegion(value: config.region)") writer.write(" .withRequestChecksumCalculation(value: config.requestChecksumCalculation)") writer.write(" .withResponseChecksumValidation(value: config.responseChecksumValidation)") @@ -47,6 +51,9 @@ abstract class AWSHTTPProtocolCustomizations : DefaultHTTPProtocolCustomizations writer.write(" .withSigningName(value: \$S)", signingName) writer.write(" .withSigningRegion(value: config.signingRegion)") } + if (ctx.service.isS3) { + writer.write(" .withClientConfig(value: config)") // this is used in S3 Express + } } override fun renderEventStreamAttributes( diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHttpProtocolServiceClient.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHttpProtocolServiceClient.kt index 6979d9af125..7ff7ea15f7a 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHttpProtocolServiceClient.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHttpProtocolServiceClient.kt @@ -119,6 +119,19 @@ class AWSHttpProtocolServiceClient( true, ) } + "disableS3ExpressSessionAuth" -> { + ConfigProperty( + "disableS3ExpressSessionAuth", + SwiftTypes.Bool.toOptional(), + { writer -> + writer.format( + "\$N.disableS3ExpressSessionAuth()", + AWSClientRuntimeTypes.Core.AWSClientConfigDefaultsProvider, + ) + }, + true, + ) + } else -> property } } diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/RulesBasedAuthSchemeResolverGenerator.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/RulesBasedAuthSchemeResolverGenerator.kt index 65c3140e489..7163fe86134 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/RulesBasedAuthSchemeResolverGenerator.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/RulesBasedAuthSchemeResolverGenerator.kt @@ -1,5 +1,6 @@ package software.amazon.smithy.aws.swift.codegen.customization +import software.amazon.smithy.aws.swift.codegen.customization.s3.isS3 import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSSDKIdentityTypes import software.amazon.smithy.aws.swift.codegen.swiftmodules.InternalClientTypes import software.amazon.smithy.aws.traits.auth.SigV4ATrait @@ -137,6 +138,34 @@ class RulesBasedAuthSchemeResolverGenerator { ) write("validAuthOptions.append(sigV4Option)") dedent() + // sigv4-s3express case + if (ctx.service.isS3) { + write("case .sigV4S3Express(let param):") + indent() + write( + "var authOption = \$N(schemeID: \$S)", + SmithyHTTPAuthAPITypes.AuthOption, + "aws.auth#sigv4-s3express", + ) + write( + "authOption.signingProperties.set(key: \$N.signingName, value: param.signingName)", + SmithyHTTPAuthAPITypes.SigningPropertyKeys, + ) + write( + "authOption.signingProperties.set(key: \$N.signingRegion, value: param.signingRegion)", + SmithyHTTPAuthAPITypes.SigningPropertyKeys, + ) + write( + "authOption.identityProperties.set(key: \$N.bucket, value: serviceParams.bucket)", + AWSSDKIdentityTypes.AWSIdentityPropertyKeys, + ) + write( + "authOption.identityProperties.set(key: \$N.s3ExpressClient, value: S3ExpressCreateSessionClient())", + AWSSDKIdentityTypes.AWSIdentityPropertyKeys, + ) + write("validAuthOptions.append(authOption)") + dedent() + } // Default case: throw error if returned auth scheme is neither SigV4 nor SigV4A write("default:") indent() diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/s3/S3ExpressIntegration.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/s3/S3ExpressIntegration.kt new file mode 100644 index 00000000000..0dec67385c1 --- /dev/null +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/s3/S3ExpressIntegration.kt @@ -0,0 +1,86 @@ +package software.amazon.smithy.aws.swift.codegen.customization.s3 + +import software.amazon.smithy.aws.swift.codegen.swiftmodules.AWSSDKIdentityTypes +import software.amazon.smithy.codegen.core.Symbol +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.shapes.ServiceShape +import software.amazon.smithy.swift.codegen.SwiftDelegator +import software.amazon.smithy.swift.codegen.SwiftSettings +import software.amazon.smithy.swift.codegen.config.ClientConfiguration +import software.amazon.smithy.swift.codegen.config.ConfigProperty +import software.amazon.smithy.swift.codegen.config.DefaultProvider +import software.amazon.smithy.swift.codegen.core.SwiftCodegenContext +import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator +import software.amazon.smithy.swift.codegen.integration.SwiftIntegration +import software.amazon.smithy.swift.codegen.model.expectShape +import software.amazon.smithy.swift.codegen.model.toGeneric +import software.amazon.smithy.swift.codegen.swiftmodules.ClientRuntimeTypes +import software.amazon.smithy.swift.codegen.swiftmodules.SwiftTypes + +class S3ExpressIntegration : SwiftIntegration { + override fun enabledForService( + model: Model, + settings: SwiftSettings, + ): Boolean = model.expectShape(settings.service).isS3 + + override fun writeAdditionalFiles( + ctx: SwiftCodegenContext, + protocolGenerationContext: ProtocolGenerator.GenerationContext, + delegator: SwiftDelegator, + ) { + delegator.useFileWriter("Sources/AWSS3/S3Client+S3Express.swift") { writer -> + writer.write("") + writer.openBlock( + "public struct S3ExpressCreateSessionClient: \$N, \$N {", + "}", + AWSSDKIdentityTypes.S3ExpressCreateSessionClient, + SwiftTypes.Protocols.Sendable, + ) { + writer.write("") + writer.openBlock( + "public func createSession(clientConfig: \$N, bucket: \$N) async throws -> \$N {", + "}", + ClientRuntimeTypes.Core.DefaultClientConfiguration, + SwiftTypes.String, + AWSSDKIdentityTypes.S3ExpressIdentity, + ) { + writer.openBlock( + "guard let config = clientConfig as? S3Client.Config else {", + "}", + ) { + writer.write("throw \$N.clientConfigNotProvided", AWSSDKIdentityTypes.S3ExpressClientError) + } + writer.write("let client = S3Client(config: config)") + writer.write("let input = CreateSessionInput(bucket: bucket)") + writer.write("let output = try await client.createSession(input: input)") + writer.write( + "guard let creds = output.credentials, let accessKeyID = creds.accessKeyId, let secretAccessKey = creds.secretAccessKey, let sessionToken = creds.sessionToken else { fatalError() }", + ) + writer.openBlock("return \$N(", ")", AWSSDKIdentityTypes.S3ExpressIdentity) { + writer.write("accessKeyID: accessKeyID,") + writer.write("secretAccessKey: secretAccessKey,") + writer.write("sessionToken: sessionToken,") + writer.write("expiration: output.credentials?.expiration") + } + } + } + } + } + + override fun clientConfigurations(ctx: ProtocolGenerator.GenerationContext): List = + super.clientConfigurations(ctx) + listOf(S3ExpressClientConfiguration()) +} + +class S3ExpressClientConfiguration : ClientConfiguration { + override val swiftProtocolName: Symbol? + get() = null + + override fun getProperties(ctx: ProtocolGenerator.GenerationContext): Set = + setOf( + ConfigProperty( + "s3ExpressIdentityResolver", + AWSSDKIdentityTypes.S3ExpressIdentityResolver.toGeneric(), + DefaultProvider({ it.format("\$N()", AWSSDKIdentityTypes.DefaultS3ExpressIdentityResolver) }, false, false), + ), + ) +} diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKHTTPAuthTypes.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKHTTPAuthTypes.kt index cd84ada25c4..ac9cd8a650f 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKHTTPAuthTypes.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKHTTPAuthTypes.kt @@ -8,6 +8,7 @@ import software.amazon.smithy.swift.codegen.swiftmodules.SwiftSymbol object AWSSDKHTTPAuthTypes { val SigV4AuthScheme = runtimeSymbol("SigV4AuthScheme", SwiftDeclaration.STRUCT) val SigV4AAuthScheme = runtimeSymbol("SigV4AAuthScheme", SwiftDeclaration.STRUCT) + val SigV4S3ExpressAuthScheme = runtimeSymbol("SigV4S3ExpressAuthScheme", SwiftDeclaration.STRUCT) } private fun runtimeSymbol( diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKIdentityTypes.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKIdentityTypes.kt index 09aa4899ab5..fe1dbf875b6 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKIdentityTypes.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/swiftmodules/AWSSDKIdentityTypes.kt @@ -7,6 +7,12 @@ import software.amazon.smithy.swift.codegen.swiftmodules.SwiftSymbol object AWSSDKIdentityTypes { val DefaultBearerTokenIdentityResolverChain = runtimeSymbol("DefaultBearerTokenIdentityResolverChain", SwiftDeclaration.STRUCT) + val DefaultS3ExpressIdentityResolver = runtimeSymbol("DefaultS3ExpressIdentityResolver", SwiftDeclaration.CLASS) + val S3ExpressIdentity = runtimeSymbol("S3ExpressIdentity", SwiftDeclaration.STRUCT) + val S3ExpressIdentityResolver = runtimeSymbol("S3ExpressIdentityResolver", SwiftDeclaration.PROTOCOL) + val S3ExpressCreateSessionClient = runtimeSymbol("S3ExpressCreateSessionClient", SwiftDeclaration.PROTOCOL) + val S3ExpressClientError = runtimeSymbol("S3ExpressClientError", SwiftDeclaration.ENUM) + val AWSIdentityPropertyKeys = runtimeSymbol("AWSIdentityPropertyKeys", SwiftDeclaration.ENUM) val DefaultAWSCredentialIdentityResolverChain = runtimeSymbol("DefaultAWSCredentialIdentityResolverChain", SwiftDeclaration.CLASS) val InternalClientKeys = runtimeSymbol("InternalClientKeys", SwiftDeclaration.ENUM) val IdentityProvidingSTSClient = runtimeSymbol("IdentityProvidingSTSClient", SwiftDeclaration.PROTOCOL) diff --git a/codegen/smithy-aws-swift-codegen/src/main/resources/META-INF/services/software.amazon.smithy.swift.codegen.integration.SwiftIntegration b/codegen/smithy-aws-swift-codegen/src/main/resources/META-INF/services/software.amazon.smithy.swift.codegen.integration.SwiftIntegration index 2bb0b53f38a..20916659c72 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/resources/META-INF/services/software.amazon.smithy.swift.codegen.integration.SwiftIntegration +++ b/codegen/smithy-aws-swift-codegen/src/main/resources/META-INF/services/software.amazon.smithy.swift.codegen.integration.SwiftIntegration @@ -2,6 +2,7 @@ software.amazon.smithy.aws.swift.codegen.AddProtocols software.amazon.smithy.aws.swift.codegen.customization.s3.S3ErrorIntegration software.amazon.smithy.aws.swift.codegen.customization.s3.S3ErrorWith200StatusIntegration software.amazon.smithy.aws.swift.codegen.customization.s3.S3Expires +software.amazon.smithy.aws.swift.codegen.customization.s3.S3ExpressIntegration software.amazon.smithy.aws.swift.codegen.customization.s3.TruncatablePaginationIntegration software.amazon.smithy.aws.swift.codegen.customization.route53.Route53TrimHostedZone software.amazon.smithy.aws.swift.codegen.customization.route53.Route53InvalidBatchErrorIntegration @@ -30,4 +31,4 @@ software.amazon.smithy.swift.codegen.protocols.rpcv2cbor.CborValidateResponseHea software.amazon.smithy.aws.swift.codegen.customization.rds.AuthTokenGeneratorIntegration software.amazon.smithy.aws.swift.codegen.customization.dsql.AuthTokenGeneratorIntegration software.amazon.smithy.aws.swift.codegen.customization.credentialresolverservices.InternalModelIntegration -software.amazon.smithy.aws.swift.codegen.customization.credentialresolverservices.IdentityProvidingSTSClientIntegration \ No newline at end of file +software.amazon.smithy.aws.swift.codegen.customization.credentialresolverservices.IdentityProvidingSTSClientIntegration diff --git a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt index b141ccc7409..abf7e737b6f 100644 --- a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt +++ b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt @@ -268,11 +268,13 @@ extension PutObjectInput { .withExpiration(value: expiration) .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withIdentityResolver(value: config.s3ExpressIdentityResolver, schemeID: "aws.auth#sigv4-s3express") .withRegion(value: config.region) .withRequestChecksumCalculation(value: config.requestChecksumCalculation) .withResponseChecksumValidation(value: config.responseChecksumValidation) .withSigningName(value: "s3") .withSigningRegion(value: config.signingRegion) + .withClientConfig(value: config) .build() let builder = ClientRuntime.OrchestratorBuilder() config.interceptorProviders.forEach { provider in diff --git a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/customizations/RulesBasedAuthSchemeResolverGeneratorTests.kt b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/customizations/RulesBasedAuthSchemeResolverGeneratorTests.kt index 325caa4754e..3bd2be34413 100644 --- a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/customizations/RulesBasedAuthSchemeResolverGeneratorTests.kt +++ b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/customizations/RulesBasedAuthSchemeResolverGeneratorTests.kt @@ -149,6 +149,13 @@ public struct DefaultS3AuthSchemeResolver: S3AuthSchemeResolver { sigV4Option.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingRegion, value: param.signingRegionSet?[0]) sigV4Option.identityProperties.set(key: AWSSDKIdentity.InternalClientKeys.internalSTSClientKey, value: InternalAWSSTS.IdentityProvidingSTSClient()) validAuthOptions.append(sigV4Option) + case .sigV4S3Express(let param): + var authOption = SmithyHTTPAuthAPI.AuthOption(schemeID: "aws.auth#sigv4-s3express") + authOption.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingName, value: param.signingName) + authOption.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingRegion, value: param.signingRegion) + authOption.identityProperties.set(key: AWSSDKIdentity.AWSIdentityPropertyKeys.bucket, value: serviceParams.bucket) + authOption.identityProperties.set(key: AWSSDKIdentity.AWSIdentityPropertyKeys.s3ExpressClient, value: S3ExpressCreateSessionClient()) + validAuthOptions.append(authOption) default: throw Smithy.ClientError.authError("Unknown auth scheme name: \(scheme.name)") } diff --git a/sdk.properties b/sdk.properties index a1eb9a2f563..18785d8d8fb 100644 --- a/sdk.properties +++ b/sdk.properties @@ -1,5 +1,6 @@ # Use this line to only include one or more AWS services # onlyIncludeModels=s3,sts,dynamodb +# onlyIncludeModels=s3 # Use this line to exclude one or more AWS services: # excludeModels=s3,sts,dynamodb