Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTokenExpired is returned when a valid token is past its expiry time. ErrTokenExpired = errors.New("paseto: token expired") // ErrTokenInvalid is returned when the token cannot be decrypted or parsed. ErrTokenInvalid = errors.New("paseto: token invalid") )
Functions ¶
func NewTokenParser ¶
func NewTokenParser(key paseto.V4SymmetricKey) func(string) (*Claims, error)
NewTokenParser is a helper that returns a TokenParser function compatible with the auth middleware.
func Seal ¶
func Seal(claims Claims, key paseto.V4SymmetricKey) (string, error)
Seal encrypts claims into a PASETO v4 local token string.
func V4SymmetricKeyFromHex ¶
func V4SymmetricKeyFromHex(hexKey string) (paseto.V4SymmetricKey, error)
V4SymmetricKeyFromHex is a helper that parses a hex-encoded string into a paseto.V4SymmetricKey.
Types ¶
Click to show internal directories.
Click to hide internal directories.