# Functions
ConsumerFor derives the Consumer from the JWT claims DEPRECATED: This should no longer be used in favour of creating a tokeniser.
ConsumerFromContext extracts the consumer from the supplied context.
ContextWithConsumer takes a context and a service consumer and returns a new context with the consumer embedded.
EnsureRequestID will create a Request ID header if one is not found.
HandlerGrants is an HTTP handler to check that the consumer in the request context has the required grants.
HandlerValidateJWT takes a JWT from the request headers, attempts validation and returns a http handler.
NewContextWithRequestID takes a context and an *http.Request and returns a new context with the RequestID.
NewMockTokeniser creates a new tokeniser with a random key pair.
NewTokeniser returns a new JWT instance.
NewTokeniserFromKeyPair parses a public key to.
NewTokeniserFromPublicKey parses a public key to.
ParseJWT parses a JWT string and checks its signature validity DEPRECATED: This should no longer be used in favour of creating a tokeniser.
RequestIDFromContext extracts the RequestID from the supplied context.
RespondToJWT takes the raw JWT and the public RSA key.
# Constants
TokenValidPeriod is the default amount of minutes a token is valid.
# Variables
ErrTokenExpired is the message to return for an expired token.
ErrTokenInvalid is the message to return for an invalid token.
ErrTokenMalformed is the message to return for a malformed token.
# Structs
Claims hold the JWT claims to user for a token.
Consumer represents an API user.
ErrAssertClaims is thrown when asserting the type of claims.
ErrUnexpectedSigningMethod is thrown when parsing a JWT encounters an unexpected signature method.
Tokeniser is the auth tokeniser for JSON Web Tokens.
# Interfaces
JWTResponder defines the behaviour of validating a JWT.