Skip to content

Releases: vapor/jwt

Release Candidate 1

01 Mar 22:24
cc68651
Compare
Choose a tag to compare
Release Candidate 1 Pre-release
Pre-release

Upgrades to Swift 5.2.

Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.

Beta 3

27 Feb 01:09
d22a648
Compare
Choose a tag to compare
Beta 3 Pre-release
Pre-release
This patch was authored and released by @gwynne.
  • Update OS version requirement for compatibility with latest Vapor beta.
  • Major beta version bumped due to the OS version requirement being a breaking change. No changes have been made to JWT itself.

Adds JWT validation for Apple and Google

19 Feb 02:04
0f79b27
Compare
Choose a tag to compare

Allows for simple validation of Sign in with Apple or google. In your routes, you can now do this:

public func registerFromSignInWithApple(req: Request) throws -> EventLoopFuture<User> {
    req.jwt.apple
        .verify(applicationIdentifier: "com.whoever.myapp")
        .map { (token: AppleIdentityToken) in
            let uniqueUserID = token.subject.value

            // Create the user in the database

            return user
    }
}

Add JWKSCache helper for storing JWKS

14 Feb 19:55
0ecb6fa
Compare
Choose a tag to compare
Pre-release

Provides a way that servers can download JWKS files in response to HTTP requests such that only one request will ever be performing a download at a time. If the remote server provides caching headers this ensures the downloads are cached appropriately.

final class RouteController {
    let apple: JWKSCache

    init(app: Application) {
        apple = .init(keyURL: "https://appleid.apple.com/auth/keys", client: app.client)
    }

    func signIn(_ req: Request) throws -> EventLoopFuture<Void> {
        apple.keys(on: req).flatMap { jwks in
            guard let key = jwks.find(identifier: "AIDOPK1", type: .rsa) else {
                return req.eventLoop.makeFailedFuture(Abort(.internalServerError))
            }

            // Use the key here
        }
    }
}

JWT 4.0.0 Beta 2

09 Dec 16:55
9e121e0
Compare
Choose a tag to compare
JWT 4.0.0 Beta 2 Pre-release
Pre-release

This package is now a Vapor + JWTKit integration.

import JWT
import Vapor

try app.jwt.signers.use(.es512(key: .generate()))

app.post("login") { req -> LoginResponse in
    let credentials = try req.content.decode(LoginCredentials.self)
    return try LoginResponse(
        token: req.jwt.sign(User(name: credentials.name))
    )
}

app.get("me") { req -> String in
    try req.jwt.verify(as: User.self).name
}

JWT 3.1.1

24 Oct 15:41
4265f12
Compare
Choose a tag to compare
  • Fixed warnings about public access modifier being redundant. (#108)

JWT 3.1.0

23 Oct 14:48
0debb7f
Compare
Choose a tag to compare
  • Adds JWK signer support. (#106)
let json = """
{"kty":"RSA", ...}
"""
let signer = try JWTSigner.jwk(key: json)

4.0.0 Alpha 1.3

07 Oct 22:08
00b6715
Compare
Choose a tag to compare
4.0.0 Alpha 1.3 Pre-release
Pre-release
  • Fixed an intermittent verification failure with ECDSA signed tokens. (#103, #104)

JWTKit 4.0.0 Alpha 1.2

29 Aug 22:48
cbf0751
Compare
Choose a tag to compare
Pre-release
  • Fixed ECDSA signature encoding to follow spec. (#100, #102)

JWTKit 4.0.0 Alpha 1.1

15 Aug 04:27
3a9ada8
Compare
Choose a tag to compare
Pre-release

Fixed:

  • Added jwtkit_ namespace to OpenSSL shim methods to avoid clashes (#101)