Skip to content

Releases: vapor/jwt

Added a public initializer to Request.JWT

24 May 23:05
245dc75
Compare
Choose a tag to compare
This patch was authored and released by @grosch.

People couldn't make their own verifiers since request was internal.

Update to Vapor 4 GM

09 Apr 17:58
8c1681e
Compare
Choose a tag to compare
Update to Vapor 4 GM Pre-release
Pre-release
This patch was authored by @gwynne and released by @tanner0101.

Updated for final Vapor 4.0.0 release, with (improved) tests passing (#119).

Updates audience claim check for apple/google

17 Mar 02:54
a37a151
Compare
Choose a tag to compare
This patch was authored by @grosch and released by @gwynne.

Updated based on the recent changes to JWT-Kit

Make HMAC signers thread safe

12 Mar 18:51
03c8c11
Compare
Choose a tag to compare

Makes HMAC JWT signers (hs256, hs384, hs512) thread safe (#117).

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)