From 1111e646d80b058fdb85325610c16f6eb3505108 Mon Sep 17 00:00:00 2001 From: Anthony Castelli Date: Sun, 26 Aug 2018 18:51:24 -0700 Subject: [PATCH] apns: Update all of the requirements to use the latest releases --- Package.resolved | 48 +++++++++++++++---------------- Package.swift | 2 +- Sources/APNS/APNSJWTPayload.swift | 4 +-- Sources/APNS/Profile.swift | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Package.resolved b/Package.resolved index e41898d..96e1940 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/vapor/core.git", "state": { "branch": null, - "revision": "a909eccc41941faac6fb9e511cdb9a5cb30a05de", - "version": "3.1.7" + "revision": "7f56a09995bf3c8df562be456bdcda405d9d0678", + "version": "3.4.1" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/vapor/crypto.git", "state": { "branch": null, - "revision": "1b8c2ba5a42f1adf2aa812204678d8b16466fa59", - "version": "3.1.2" + "revision": "4b85405430df1892ee3aa1554bdb477e96cf46ad", + "version": "3.2.0" } }, { @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/vapor/database-kit.git", "state": { "branch": null, - "revision": "0db303439e5ef8b6df50a2b6c4029edddee90cb0", - "version": "1.0.1" + "revision": "7a01659316b9f033fa2150d5cd5e9d3c3e46c2e3", + "version": "1.3.0" } }, { @@ -42,8 +42,8 @@ "repositoryURL": "https://github.com/vapor/http.git", "state": { "branch": null, - "revision": "9246340ae4c5310627099349fc74785267b55607", - "version": "3.0.5" + "revision": "0fac5c7c9ab1e424621ba001d83cb59ffca99ad2", + "version": "3.1.1" } }, { @@ -51,8 +51,8 @@ "repositoryURL": "https://github.com/vapor/jwt.git", "state": { "branch": null, - "revision": "6acca0abfe335ce7585d678cd721e8a0e3c7a053", - "version": "3.0.0-rc.2.1.1" + "revision": "2e225c722bf26407c1c4bd11d341e48759f46095", + "version": "3.0.0" } }, { @@ -60,8 +60,8 @@ "repositoryURL": "https://github.com/vapor/multipart.git", "state": { "branch": null, - "revision": "7778dcb62f3efa845e8e2808937bb347575ba7ce", - "version": "3.0.1" + "revision": "e57007c23a52b68e44ebdfc70cbe882a7c4f1ec3", + "version": "3.0.2" } }, { @@ -87,8 +87,8 @@ "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, - "revision": "a5db2a67515ad2b490ac5646db204a5edf939f47", - "version": "1.6.1" + "revision": "cf08e673dc41dc63d34065234c8fc432e8d334c4", + "version": "1.9.2" } }, { @@ -96,8 +96,8 @@ "repositoryURL": "https://github.com/apple/swift-nio-ssl.git", "state": { "branch": null, - "revision": "38955a5f806a952daf2b16fbfe9aa529749cf1dd", - "version": "1.1.0" + "revision": "6617eb0d3afcb12170594968df01ca63afb58ac5", + "version": "1.2.0" } }, { @@ -123,8 +123,8 @@ "repositoryURL": "https://github.com/vapor/template-kit.git", "state": { "branch": null, - "revision": "43b57b5861d5181b906ac6411d28645e980bb638", - "version": "1.0.1" + "revision": "db35b1c35aabd0f5db3abca0cfda7becfe9c43e2", + "version": "1.1.0" } }, { @@ -132,8 +132,8 @@ "repositoryURL": "https://github.com/vapor/url-encoded-form.git", "state": { "branch": null, - "revision": "57cf7fb9c1a1014c50bc05123684a9139ad44127", - "version": "1.0.3" + "revision": "cbfe7ef6301557d3f2d0807a98165232ae06e1c6", + "version": "1.0.4" } }, { @@ -141,8 +141,8 @@ "repositoryURL": "https://github.com/vapor/validation.git", "state": { "branch": null, - "revision": "ab6c5a352d97c8687b91ed4963aef8e7cfe0795b", - "version": "2.0.0" + "revision": "156f8adeac3440e868da3757777884efbc6ec0cc", + "version": "2.1.0" } }, { @@ -150,8 +150,8 @@ "repositoryURL": "https://github.com/vapor/vapor.git", "state": { "branch": null, - "revision": "8c73eebf7c41c7d8bf83ff87f550e0f97d6aadc4", - "version": "3.0.2" + "revision": "54632a6c1e7ecd9923c0d00b612de936de1c4745", + "version": "3.0.8" } }, { diff --git a/Package.swift b/Package.swift index 4461474..fc80d41 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"), - .package(url: "https://github.com/vapor/jwt.git", from: "3.0.0-rc"), + .package(url: "https://github.com/vapor/jwt.git", from: "3.0.0"), ], targets: [ .target(name: "APNS", dependencies: ["Vapor", "JWT"]), diff --git a/Sources/APNS/APNSJWTPayload.swift b/Sources/APNS/APNSJWTPayload.swift index aa9c53d..10dab51 100644 --- a/Sources/APNS/APNSJWTPayload.swift +++ b/Sources/APNS/APNSJWTPayload.swift @@ -13,7 +13,7 @@ struct APNSJWTPayload: JWTPayload { let iat = IssuedAtClaim(value: Date()) let exp = ExpirationClaim(value: Date(timeInterval: 3500, since: Date())) - func verify() throws { - try self.exp.verify() + func verify(using signer: JWTSigner) throws { + try self.exp.verifyNotExpired() } } diff --git a/Sources/APNS/Profile.swift b/Sources/APNS/Profile.swift index 9f15d1b..558b4a5 100644 --- a/Sources/APNS/Profile.swift +++ b/Sources/APNS/Profile.swift @@ -77,7 +77,7 @@ public class Profile { let JWTheaders = JWTHeader(alg: "ES256", cty: nil, crit: nil, kid: self.keyId) let payload = APNSJWTPayload(iss: self.teamId) let signer = JWTSigner(algorithm: ES256(key: self.privateKey)) - var jwt = JWT(header: JWTheaders, payload: payload) + let jwt = JWT(header: JWTheaders, payload: payload) let signed = try jwt.sign(using: signer) guard let token = String(bytes: signed, encoding: .utf8) else { throw TokenError.tokenWasNotGeneratedCorrectly