Skip to content

Commit f783467

Browse files
authored
Swift 5.8 (#44)
* Update workflows * Update minimum required swift version to 5.6 * _SotoSendable -> Sendable * Remove #if compiler( checks
1 parent 345dfcf commit f783467

File tree

13 files changed

+17
-51
lines changed

13 files changed

+17
-51
lines changed

.github/workflows/api-breakage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
linux:
88
runs-on: ubuntu-latest
99
container:
10-
image: swift:5.6-focal
10+
image: swift:5.8
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: macOS-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
- name: Test
2828
run: swift test --enable-code-coverage
2929
- name: Convert coverage files
@@ -41,15 +41,15 @@ jobs:
4141
strategy:
4242
matrix:
4343
image:
44-
- swift:5.4
45-
- swift:5.5
4644
- swift:5.6
45+
- swift:5.7
46+
- swift:5.8
4747
runs-on: ubuntu-latest
4848
container:
4949
image: ${{ matrix.image }}
5050
steps:
5151
- name: Checkout
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
5353
- name: Test
5454
run: swift test --enable-code-coverage
5555
- name: Convert coverage files

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: macOS-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 1
1616
- name: Install Dependencies

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.6
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the Soto for AWS open source project
@@ -30,7 +30,7 @@ let package = Package(
3030
],
3131
dependencies: [
3232
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "1.0.0")),
33-
.package(url: "https://github.com/soto-project/soto.git", from: "6.0.0"),
33+
.package(url: "https://github.com/soto-project/soto.git", from: "6.6.0"),
3434
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.10.0"),
3535
.package(url: "https://github.com/vapor/jwt-kit.git", .upToNextMajor(from: "4.2.6")),
3636
// for SRP

Sources/SotoCognitoAuthenticationKit/AsyncAwaitSupport/Authenticatable+JWT+async.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if compiler(>=5.5) && canImport(_Concurrency)
16-
1715
import AsyncHTTPClient
1816
import Foundation
1917
import JWTKit
@@ -101,5 +99,3 @@ extension CognitoAuthenticatable {
10199
return signers
102100
}
103101
}
104-
105-
#endif // compiler(>=5.5) && canImport(_Concurrency)

Sources/SotoCognitoAuthenticationKit/AsyncAwaitSupport/Authenticatable+async.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if compiler(>=5.5) && canImport(_Concurrency)
16-
1715
import Crypto
1816
import Foundation
1917
import JWTKit
@@ -516,5 +514,3 @@ public extension CognitoAuthenticatable {
516514
}
517515
}
518516
}
519-
520-
#endif // compiler(>=5.5) && canImport(_Concurrency)

Sources/SotoCognitoAuthenticationKit/AsyncAwaitSupport/Identifiable+async.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if compiler(>=5.5) && canImport(_Concurrency)
16-
1715
import NIO
1816
import SotoCognitoIdentity
1917

@@ -72,5 +70,3 @@ extension CognitoIdentifiable {
7270
}
7371
}
7472
}
75-
76-
#endif // compiler(>=5.5) && canImport(_Concurrency)

Sources/SotoCognitoAuthenticationKit/Authenticatable.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,30 @@ public enum SotoCognitoError: Error {
3535
}
3636

3737
/// Response to `createUser`
38-
public struct CognitoCreateUserResponse: Codable, _SotoSendable {
38+
public struct CognitoCreateUserResponse: Codable, Sendable {
3939
/// name of user
4040
public var userName: String
4141
/// status of user account
4242
public var userStatus: CognitoUserStatusType
4343
}
4444

4545
/// Authentication response
46-
public enum CognitoAuthenticateResponse: Codable, _SotoSendable {
46+
public enum CognitoAuthenticateResponse: Codable, Sendable {
4747
/// Response with authentication details
4848
case authenticated(AuthenticatedResponse)
4949
/// Response containing a challenge
5050
case challenged(ChallengedResponse)
5151

5252
/// Authenticated Response
53-
public struct AuthenticatedResponse: Codable, _SotoSendable {
53+
public struct AuthenticatedResponse: Codable, Sendable {
5454
public let accessToken: String?
5555
public let idToken: String?
5656
public let refreshToken: String?
5757
public let expiresIn: Date?
5858
}
5959

6060
/// Response containing an authentication challenge
61-
public struct ChallengedResponse: Codable, _SotoSendable {
61+
public struct ChallengedResponse: Codable, Sendable {
6262
/// Name of challenge
6363
public let name: CognitoChallengeName?
6464
/// Challenge parameters
@@ -107,7 +107,7 @@ public final class CognitoAuthenticatable {
107107
}
108108

109109
private var _jwtSigners: JWTSigners?
110-
private let jwtSignersLock: Lock
110+
private let jwtSignersLock: NIOLock
111111

112112
// MARK: Initialization
113113

@@ -650,7 +650,5 @@ public extension CognitoAuthenticatable {
650650
}
651651
}
652652

653-
#if compiler(>=5.6)
654-
// jwtSigners is mutable so required to use @unchecked here.
653+
// jwtSigners is mutable but access is controlled by a lock so required to use @unchecked here.
655654
extension CognitoAuthenticatable: @unchecked Sendable {}
656-
#endif

Sources/SotoCognitoAuthenticationKit/Configuration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import SotoCognitoIdentityProvider
2020
///
2121
/// See [Cognito Userpool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html)
2222
/// documention for more information.
23-
public struct CognitoConfiguration: _SotoSendable {
23+
public struct CognitoConfiguration: Sendable {
2424
/// user pool id
2525
public let userPoolId: String
2626
/// app client id
@@ -60,7 +60,7 @@ public struct CognitoConfiguration: _SotoSendable {
6060
///
6161
/// See [Cognito Identity Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
6262
/// documention for more information.
63-
public struct CognitoIdentityConfiguration: _SotoSendable {
63+
public struct CognitoIdentityConfiguration: Sendable {
6464
/// Cognito identity pool id
6565
public let identityPoolId: String
6666
/// Identity provider

Sources/SotoCognitoAuthenticationKit/Identifiable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import NIO
1616
import SotoCognitoIdentity
1717

18-
public final class CognitoIdentifiable: _SotoSendable {
18+
public final class CognitoIdentifiable: Sendable {
1919
// MARK: Member variables
2020

2121
/// Configuration

0 commit comments

Comments
 (0)