Releases: vapor/jwt
Add `@discardableResult` attribute to `verify(as:)` functions
This patch was authored by @jiahan-wu and released by @0xTim.
Marks JWT's verify(as:)
functions with @discardableResult
so you can verify then without reading the contents in a clean way. For example
let _ = try req.jwt.verify(as: Payload.self)
Can become:
try req.jwt.verify(as: Payload.self)
Drop support for Swift 5.2 and 5.3
This patch was authored and released by @0xTim.
This removes support for Swift 5.2 and Swift 5.3, making Swift 5.4 the earliest supported version as
announced
Add support for `async`/`await`
This patch was authored and released by @0xTim.
Adds async
APIs for JWT calls when interacting with JWKS servers
JWT 4.0.0
This patch was authored and released by @tanner0101.
Docs:
https://docs.vapor.codes/4.0/jwt/
More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802
Make JWT helpers extendable
This patch was authored and released by @tanner0101.
This change publicizes internal properties on JWT helpers to make them more easily extendable (#131, fixes #125).
// Custom extension
extension Request.JWT {
// Methods now have access to the request
func myVerifier() {
print(self._request) // Current request
}
}
// Usage
req.jwt.myVerifier()
The property names have been prefixed with _
to prevent autocomplete from suggesting things like:
req.jwt.request
Application.JWT
and Request.JWT
's initializers have been removed. These were redundant and can be declared much more concisely:
- Application.JWT(application: app)
+ app.jwt
- Request.JWT(request: req)
+ req.jwt
Add Microsoft JWT helpers
This patch was authored and released by @tanner0101.
Adds new helper methods for verifying Microsoft JWTs (#130, #121).
// Configure your Microsoft application identifier.
app.jwt.microsoft.applicationIdentifier = "..."
// Fetch and verify Microsoft identity token from Bearer header.
// Microsoft's JWKS is downloaded and cached automatically.
req.jwt.microsoft.verify().map { token in
print(token) // MicrosoftIdentityToken
}
Added a public initializer to Request.JWT
This patch was authored and released by @grosch.
People couldn't make their own verifiers since request
was internal.
Update to Vapor 4 GM
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
Make HMAC signers thread safe
Makes HMAC JWT signers (hs256
, hs384
, hs512
) thread safe (#117).