auth

package
v0.0.0-...-5ac1aa0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_EXPIRY = 365 * 24 * time.Hour

one year

Variables

View Source
var Command = &cli.Command{
	Name:   "genkey",
	Usage:  "Generates a secure 64-byte base64 auth token",
	Action: genkey,
}

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserID      xid.ID `json:"sub"`
	TokenID     xid.ID `json:"jti"`
	UserIsAdmin bool   `json:"adm"`

	ReadOnly bool `json:"twr"`

	jwt.RegisteredClaims
}

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func New

func New(c config.Config) *Verifier

func (*Verifier) Claims

func (v *Verifier) Claims(token string) (c Claims, err error)

func (*Verifier) CreateToken

func (v *Verifier) CreateToken(userID, tokenID xid.ID, isAdmin, readOnly bool) (string, error)

Jump to

Keyboard shortcuts

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