Skip to content

Commit 0890f1c

Browse files
committed
more sendables
1 parent e3249a5 commit 0890f1c

File tree

23 files changed

+42
-22
lines changed

23 files changed

+42
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.2.4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.2.5

AWSSDKSwiftCLI/tmp/build-request.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"features":[]}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

IntegrationTests/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.0
22

33
//
44
// Copyright Amazon.com Inc. or its affiliates.

PerformanceTests/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

SPRCLI/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSClientRuntime/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Endpoints/AccountIDEndpointMode.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
/// Determines how & whether an account ID-based endpoint will be used for requests.
9-
public enum AccountIDEndpointMode: String, Equatable {
9+
public enum AccountIDEndpointMode: String, Equatable, Sendable {
1010
// Note : these case names match string values for the accountIdEndpointMode endpoint param.
1111
// Do not rename them
1212

Sources/Core/AWSClientRuntime/Tests/AWSClientRuntimeTests/Middlewares/FlexibleChecksumsMiddlewareTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -475,3 +475,5 @@ func XCTAssertThrowsErrorAsync(
475475
block(error)
476476
}
477477
}
478+
479+
extension SigningConfig: @retroactive @unchecked Sendable {}

Sources/Core/AWSSDKChecksums/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSSDKChecksums/Sources/AWSSDKChecksums/AWSChecksumCalculationMode.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
public enum AWSChecksumCalculationMode: String {
8+
public enum AWSChecksumCalculationMode: String, Sendable {
99
case whenRequired = "when_required"
1010
case whenSupported = "when_supported"
1111

Sources/Core/AWSSDKCommon/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSSDKEventStreamsAuth/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSSDKEventStreamsAuth/Sources/AWSSSDKEventStreamsAuth/AWSMessageSigner.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import struct Smithy.Attributes
1515
import struct Smithy.AttributeKey
1616

1717
/// Signs a `Message` using the AWS SigV4 signing algorithm
18-
public class AWSMessageSigner: MessageSigner {
18+
public class AWSMessageSigner: MessageSigner, @unchecked Sendable {
1919
let encoder: MessageEncoder
2020
let signer: () async throws -> MessageDataSigner
2121
let signingConfig: () async throws -> AWSSigningConfig

Sources/Core/AWSSDKEventStreamsAuth/Tests/AWSSDKEventStreamsAuthTests/TestCustomAWSCredentialIdentityResolver.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Smithy
99
import SmithyIdentity
1010

11-
class TestCustomAWSCredentialIdentityResolver: AWSCredentialIdentityResolver {
11+
class TestCustomAWSCredentialIdentityResolver: AWSCredentialIdentityResolver, @unchecked Sendable {
1212
let credentials: AWSCredentialIdentity
1313

1414
init(credentials: AWSCredentialIdentity) {

Sources/Core/AWSSDKHTTPAuth/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSSDKHTTPAuth/Sources/AWSSDKHTTPAuth/AWSSigV4Signer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import struct Foundation.TimeInterval
3232
import struct Foundation.URL
3333
import AWSSDKChecksums
3434

35-
public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer {
35+
public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer, @unchecked Sendable {
3636

3737
public init() {}
3838

Sources/Core/AWSSDKHTTPAuth/Tests/AWSSDKHTTPAuthTests/SigV4SigningTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class Sigv4SigningTests: XCTestCase {
302302
}
303303
}
304304

305-
class TestCustomAWSCredentialIdentityResolver: AWSCredentialIdentityResolver {
305+
class TestCustomAWSCredentialIdentityResolver: AWSCredentialIdentityResolver, @unchecked Sendable {
306306
let credentials: AWSCredentialIdentity
307307

308308
init(credentials: AWSCredentialIdentity) {

Sources/Core/AWSSDKIdentity/Package.swift.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Sources/Core/AWSSDKIdentity/Tests/AWSSDKIdentityTests/AWSCredentialIdentityResolverTests/CachedAWSCredentialIdentityResolverTests.swift

+18-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ import struct AWSSDKIdentity.CachedAWSCredentialIdentityResolver
1010

1111
class CachedAWSCredentialIdentityResolverTests: XCTestCase {
1212

13+
actor Counter {
14+
private var value: Int = 0
15+
16+
func increment() {
17+
value += 1
18+
}
19+
20+
func get() -> Int {
21+
return value
22+
}
23+
}
24+
1325
func testGetIdentity() async throws {
14-
var counter: Int = 0
26+
let counter = Counter()
1527
let accessKey = UUID().uuidString
1628
let secret = UUID().uuidString
1729
let accountID = UUID().uuidString
1830
let coreProvider = MockAWSCredentialIdentityResolver {
19-
counter += 1
31+
await counter.increment()
2032
return .init(accessKey: accessKey, secret: secret, accountID: accountID)
2133
}
2234
let subject = try CachedAWSCredentialIdentityResolver(
@@ -30,13 +42,15 @@ class CachedAWSCredentialIdentityResolverTests: XCTestCase {
3042
_ = try await subject.getIdentity()
3143

3244
// Counter is 1 because the last three accesses use cached credentials
33-
XCTAssertEqual(counter, 1)
45+
let finalCount = await counter.get()
46+
XCTAssertEqual(finalCount, 1)
3447

3548
try! await Task.sleep(nanoseconds: 1_000_000_000 / 100) // 0.01 seconds
3649
let credentials = try await subject.getIdentity()
3750

3851
// Counter is 2 because we slept long enough for cache to expire
39-
XCTAssertEqual(counter, 2)
52+
let countAfterSleep = await counter.get()
53+
XCTAssertEqual(countAfterSleep, 2)
4054
XCTAssertEqual(credentials.accessKey, accessKey)
4155
XCTAssertEqual(credentials.secret, secret)
4256
XCTAssertEqual(credentials.accountID, accountID)

Sources/Core/AWSSDKIdentity/Tests/AWSSDKIdentityTests/Mocks/MockAWSCredentialIdentityResolver.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import struct SmithyIdentity.AWSCredentialIdentity
1010
import protocol SmithyIdentity.AWSCredentialIdentityResolver
1111

1212
struct MockAWSCredentialIdentityResolver: AWSCredentialIdentityResolver {
13-
let _getIdentity: () async throws -> AWSCredentialIdentity
14-
init(_ _getIdentity: @escaping () async throws -> AWSCredentialIdentity) {
13+
let _getIdentity: @Sendable () async throws -> AWSCredentialIdentity
14+
init(_ _getIdentity: @escaping @Sendable () async throws -> AWSCredentialIdentity) {
1515
self._getIdentity = _getIdentity
1616
}
1717
init() {

codegen/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.0
22

33
//
44
// Copyright Amazon.com Inc. or its affiliates.

0 commit comments

Comments
 (0)