Protocols
The following protocols are available globally.
-
A protocol for representing the claims on a JSON web token. https://tools.ietf.org/html/rfc7519#section-4.1
Usage Example:
See morestruct AdminClaims: Claims { var sub: String var isAdmin: Bool var exp: Date? } let jwt = JWT(claims: AdminClaims(sub: "Kitura", isAdmin: true, exp: Date(timeIntervalSinceNow: 3600)))
Declaration
Swift
public protocol Claims : Decodable, Encodable