authjwt

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package authjwt signs and verifies the JWT access tokens used by the Web UI.

Index

Constants

View Source
const ClockSkew = 30 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Issuer    string `json:"iss"`
	Audience  string `json:"aud"`
	Namespace string `json:"namespace"`
	IssuedAt  int64  `json:"iat"`
	NotBefore int64  `json:"nbf"`
	ExpiresAt *int64 `json:"exp,omitempty"`
	JWTID     string `json:"jti"`
}

func Issue

func Issue(opts Options) (string, Claims, error)

func Verify

func Verify(token string, opts VerifyOptions) (Claims, error)

func (Claims) Permanent

func (c Claims) Permanent() bool

type Options

type Options struct {
	Secret         []byte
	Issuer         string
	Audience       string
	Namespace      string
	TTL            time.Duration
	Permanent      bool
	AllowPermanent bool
	Now            time.Time
	Random         io.Reader
}

type VerifyOptions

type VerifyOptions struct {
	Secret         []byte
	Issuer         string
	Audience       string
	AllowPermanent bool
	Now            time.Time
	ClockSkew      time.Duration
}

Jump to

Keyboard shortcuts

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