token

package
v0.0.0-...-2735486 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimISS               = "iss"
	ClaimISSValue          = "arangodb"
	ClaimEXP               = "exp"
	ClaimIAT               = "iat"
	ClaimPreferredUsername = "preferred_username"
)

Variables

This section is empty.

Functions

func IsSignatureInvalidError

func IsSignatureInvalidError(err error) bool

func New

func New(secret []byte, claims map[string]interface{}) (string, error)

Types

type Claims

type Claims jg.MapClaims

func NewClaims

func NewClaims() Claims

func Parse

func Parse(token string, secret []byte) (Claims, error)

func ParseWithAny

func ParseWithAny(token string, secrets ...[]byte) (Claims, error)

func (Claims) With

func (t Claims) With(mods ...Mod) Claims

type Mod

type Mod func(in Claims) Claims

func WithCurrentIAT

func WithCurrentIAT() Mod

func WithDefaultClaims

func WithDefaultClaims() Mod

func WithDuration

func WithDuration(dur time.Duration) Mod

func WithExp

func WithExp(time time.Time) Mod

func WithIAT

func WithIAT(time time.Time) Mod

func WithUsername

func WithUsername(username string) Mod

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL