Skip to content

Commit

Permalink
JWTKit v5 and Swift 6 (#52)
Browse files Browse the repository at this point in the history
* Swift 6, update CI

* jwt-kit v5

* Trying to fix tests

* formatting
  • Loading branch information
adam-fowler authored Oct 13, 2024
1 parent 1c2b207 commit 0c3ba9b
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 194 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/api-breakage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
linux:
runs-on: ubuntu-latest
container:
image: swift:5.9
image: swift:latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ jobs:
strategy:
matrix:
image:
- swift:5.10
- swift:6.0
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Test
run: swift test --enable-code-coverage
- name: Convert coverage files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Dependencies
Expand Down
16 changes: 5 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.0
//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
Expand All @@ -17,10 +17,6 @@

import PackageDescription

let swiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("StrictConcurrency=complete"),
]

let package = Package(
name: "soto-cognito-authentication-kit",
platforms: [
Expand All @@ -33,10 +29,10 @@ let package = Package(
.library(name: "SotoCognitoAuthenticationSRP", targets: ["SotoCognitoAuthenticationSRP"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0"..<"4.0.0"),
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0"..<"5.0.0"),
.package(url: "https://github.com/soto-project/soto.git", from: "7.0.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.10.0"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0-rc.1"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0"),
// for SRP
.package(url: "https://github.com/adam-fowler/big-num.git", .upToNextMajor(from: "2.0.0")),
],
Expand All @@ -49,16 +45,14 @@ let package = Package(
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "JWTKit", package: "jwt-kit"),
.product(name: "Crypto", package: "swift-crypto"),
],
swiftSettings: swiftSettings
]
),
.target(
name: "SotoCognitoAuthenticationSRP",
dependencies: [
.product(name: "BigNum", package: "big-num"),
.target(name: "SotoCognitoAuthenticationKit"),
],
swiftSettings: swiftSettings
]
),
.testTarget(name: "SotoCognitoAuthenticationKitTests", dependencies: ["SotoCognitoAuthenticationKit"]),
.testTarget(name: "SotoCognitoAuthenticationSRPTests", dependencies: ["SotoCognitoAuthenticationSRP"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extension CognitoAuthenticatable {
)
let signers = JWTKeyCollection()
let data = try await response.body.collect(upTo: 1_000_000)
try await signers.use(jwksJSON: String(buffer: data))
try await signers.add(jwksJSON: String(buffer: data))
self.jwtSigners = signers
return signers
}
Expand Down
Loading

0 comments on commit 0c3ba9b

Please sign in to comment.