Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultSigningMethod() jwt.SigningMethod
- func IsSignatureInvalidError(err error) bool
- func WithAllowedPaths(paths ...string) util.ModR[Claims]
- func WithCurrentIAT() util.ModR[Claims]
- func WithDefaultClaims() util.ModR[Claims]
- func WithDuration(dur time.Duration) util.ModR[Claims]
- func WithExp(time time.Time) util.ModR[Claims]
- func WithIAT(time time.Time) util.ModR[Claims]
- func WithKey(key string, value interface{}) util.ModR[Claims]
- func WithRoles(roles ...string) util.ModR[Claims]
- func WithServerID(id string) util.ModR[Claims]
- func WithUsername(username string) util.ModR[Claims]
- type Claims
- type Secret
- type Secrets
- type Token
Constants ¶
View Source
const ( ClaimISS = "iss" ClaimISSValue = "arangodb" ClaimEXP = "exp" ClaimIAT = "iat" ClaimPreferredUsername = "preferred_username" ClaimRoles = "roles" ClaimServerID = "server_id" ClaimAllowedPaths = "allowed_paths" )
View Source
const DefaultTokenSecretSize = 64
Variables ¶
View Source
var NotValidToken = errors.Errorf("Token is not valid")
Functions ¶
func DefaultSigningMethod ¶
func DefaultSigningMethod() jwt.SigningMethod
func IsSignatureInvalidError ¶
func WithCurrentIAT ¶
func WithDefaultClaims ¶
Types ¶
type Secret ¶
type Secret interface { Hash() string Sign(method jwt.SigningMethod, claims Claims) (string, error) Validate(token string) (Token, error) Exists() bool }
func EmptySecret ¶
func EmptySecret() Secret
func NewSecretSet ¶
func NewSecretWithSize ¶
func NewSecrets ¶
Click to show internal directories.
Click to hide internal directories.