Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // JWTTokenSigningKey is key used to sign jtw tokens JWTTokenSigningKey = rndKey(32) // JWTTokenSigningKey set static for testing, but should be random.. // JWTTokenDuration is how long the jwt token is valid JWTTokenDuration = 1 * time.Hour )
View Source
var ( ErrTokenExpired = errors.New("Token has expired") ErrTokenInvalidData = errors.New("Token contains invalid data") ErrTokenInvalidSigningMethod = errors.New("Token has an invalid signing method") ErrTokenConversionError = errors.New("Token conversion error") )
Errors returned
Functions ¶
Types ¶
type Credentials ¶
type Credentials struct { Id string `json:"id"` // user ID matching the user Tokens []string `json:"tk"` // authorization tokens of the user Nonce float64 `json:"nonce"` // nonce }
JWTUserCredentials is the token given to the user
Click to show internal directories.
Click to hide internal directories.