jwt

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	JTI() string
	ISS() string
	SUB() string
	AUD() string
	IAT() time.Time
	MTD() map[string]any

	Sign() (string, error)

	WithContext(ctx context.Context) context.Context

	Privilege() string

	jwt.Claims
}

func FromContext

func FromContext(ctx context.Context) (Interface, error)

func MustFromContext

func MustFromContext(ctx context.Context) Interface

func New

func New(issuer, subject, audience string, options ...Option) Interface

func Parse

func Parse(raw string) (Interface, error)

type Option

type Option = optionutil.I[claims]

func WithId

func WithId(id string) Option

func WithMetadata

func WithMetadata(md map[string]string) Option

Jump to

Keyboard shortcuts

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