Releases: kylef/JSONWebToken.swift
Releases · kylef/JSONWebToken.swift
2.2.0
2.1.0
Enhancements
-
Introduces a new
ClaimSet
structure. The structure can be returned from
decode
providing you convenience accessors.encode
will now accept a
ClaimSet
.ClaimSet
provides methods to manually validate individual claims.try claims.validateAudience("example.com") try claims.validateIssuer("fuller.li") try claims.validateExpiary() try claims.validateNotBefore() try claims.validateIssuedAt()
2.0.2
2.0.1
This release adds support for Swift 3.0.
Breaking
-
Algorithms now take
Data
instead of aString
. This improves the API
allowing you to use keys that cannot be serialised as a String.You can easily convert a String to Data such as in the following example:
.hs256("secret".data(using: .utf8)!)
2.0.0
1.5.0
1.4.3
1.4.0
1.2.0
1.1.0
Enforces that the decode function now takes an algorithm or a set of algorithms which the JWT must match while decoding a JWT (unless verification is disabled).
JWT.decode("eyJhb..hSeJy5w", .HS256("secret"))
JWT.decode("eyJh...5w", [.HS256("secret"), .HS256("secret2"), .HS512("secure")])