jwt

package
v0.30.35 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingToken  = errors.New("missing security token")
	ErrEmptyToken    = errors.New("empty security token")
	ErrInvalidToken  = errors.New("invalid security token")
	ErrInvalidClaims = errors.New("invalid security claims")
)

Functions

func Feature

func Feature(config ...func(*Installer)) miruken.Feature

Types

type Installer

type Installer struct{}

Installer enables core api support.

func (*Installer) Install

func (v *Installer) Install(setup *miruken.SetupBuilder) error

type KeySet

type KeySet interface {
	At(jwksURI string) *promise.Promise[jwt.Keyfunc]
	From(jwksJSON json.RawMessage) (jwt.Keyfunc, error)
}

KeySet provides JWKS (JSON Web Key Sets) to verify JWT signatures.

type LoginModule

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

LoginModule authenticates a subject from a JWT (JSON Web Token).

func (*LoginModule) Constructor

func (l *LoginModule) Constructor(
	_ *struct {
		creates.It `key:"login.jwt"`
	}, jwks KeySet,
)

func (*LoginModule) Init

func (l *LoginModule) Init(opts map[string]any) error

func (*LoginModule) Login

func (l *LoginModule) Login(
	subject security.Subject,
	handler miruken.Handler,
) error

func (*LoginModule) Logout

func (l *LoginModule) Logout(
	subject security.Subject,
	handler miruken.Handler,
) error

type Scope

type Scope string

Scope is a grouping of claims which effectively represents a permission that is set on a token. e.g. orders:read

func (*Scope) InitWithTag added in v0.30.6

func (s *Scope) InitWithTag(tag reflect.StructTag) error

func (Scope) Name added in v0.30.6

func (s Scope) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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