Documentation ¶
Index ¶
- Variables
- func NewToken(kind AuthKind, id uint, expiry time.Time, key crypto.PrivateKey) (string, error)
- func NewTokenFromAuthorization(auth Authorization, expiry time.Time, key crypto.PrivateKey) (string, error)
- func ParseToken(tokenString string, pubkey crypto.PublicKey) (AuthKind, uint, *Claims, error)
- type AuthKind
- type Authorization
- type Claims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSigningMethod = errors.New("invalid signing method") ErrInvalidToken = errors.New("invalid token") )
Functions ¶
func NewTokenFromAuthorization ¶
func NewTokenFromAuthorization(auth Authorization, expiry time.Time, key crypto.PrivateKey) (string, error)
Create a new token from an Authorization.
Types ¶
type Authorization ¶
An Authorization is used to check for permissions.
func ParseTokenToAuthorization ¶
func ParseTokenToAuthorization(tokenString string, pubkey crypto.PublicKey) (*Authorization, error)
func (*Authorization) IsKind ¶
func (a *Authorization) IsKind(kind AuthKind) bool
Returns if the Authorization is of the specified kind.
Click to show internal directories.
Click to hide internal directories.