Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
CreateToken takes some claims and a private key (either rsa or ec) and returns a signed json web token
func GetTokenFromRequest ¶ added in v0.2.0
GetTokenFromRequest takes the first Authorization header and extracts the bearer json web token
func LoadPrivateKey ¶
LoadPublicKey loads a PEM encoded private key (either rsa or ec)
func LoadPublicKey ¶
LoadPublicKey loads a PEM encoded public key (either rsa or ec)
Types ¶
type Claims ¶
type Claims map[string]interface{}
Claims is a map of string->something containing the meta infos associated with a token
func GetClaimsFromRequest ¶ added in v0.2.0
GetClaimsFromRequest extracts the
func ValidateToken ¶
ValidateToken checks the signature of the token with a given public key and returns the associated claims
Click to show internal directories.
Click to hide internal directories.