Documentation
¶
Overview ¶
Package KISStokens is a Go library for signing, verifying and decoding authentication tokens following the JSON Web Signature (JWS, RFC7515) and JSON Web Token (JWT, RFC7519) standards.
KISStokens offers both a high-level and a low-level API. While the high-level API aims to be easily usable from within applications, offering implementations with reasonable defaults for common use cases, the low-level API offers a more direct representation of the JWS and JWT standards, for use cases in which more control is needed.
The high-level API is contained in the top-level KISStokens package, with opinionated implementations in the subpackage opinionated. The low-level API can be found in the subpackages jws and jwt, with strictjson being a helper package for unambiguous JSON parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenAuthority ¶
type TokenAuthority interface { // Sign produces a signed authentication token for the given set of claims. // Note that this function may check the given claims object against constraints defined by the // concrete TokenAuthority implementation, rejecting claim sets that don't meet its requirements. Sign(claims *jwt.Claims) (string, error) // DecodeAndVerify decodes and verifies an authentication token and returns its JWT claims. // On failure, an error describing why decoding or verification failed will be returned. DecodeAndVerify(encodedToken string) (*jwt.Claims, error) }
A TokenAuthority holds key and configuration for signing and verifying authentication tokens It provides methods for signing, and decoding/verifying tokens.
Directories
¶
Path | Synopsis |
---|---|
Package jws contains a partial implementation of the JWS Standard (RFC7515).
|
Package jws contains a partial implementation of the JWS Standard (RFC7515). |
Package jwt implements encoding/decoding for JSON Web Token claims (RFC7519).
|
Package jwt implements encoding/decoding for JSON Web Token claims (RFC7519). |
Package opinionated provides authentication token signing and verification with reasonable defaults for common use cases.
|
Package opinionated provides authentication token signing and verification with reasonable defaults for common use cases. |
Package strictjson is a helper package that provides unambiguous JSON parsing and helper functions for extracting JWS/JWT-specific data types from JSON.
|
Package strictjson is a helper package that provides unambiguous JSON parsing and helper functions for extracting JWS/JWT-specific data types from JSON. |