auth

package
v0.0.0-...-ba59bca Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNeedRefresh = errors.New("no need to refresh")

Functions

func NewAuthenticator

func NewAuthenticator() web.Filter

func NewAuthorizer

func NewAuthorizer(us store.UserStore, rs store.RoleStore) web.Filter

Types

type Authorizer

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

func (*Authorizer) Apply

func (a *Authorizer) Apply(next web.HandlerFunc) web.HandlerFunc

Apply implements `web.Filter` interface.

type JWT

type JWT struct {
	Schema     string
	Sources    data.Options
	KeyFunc    jwt.Keyfunc
	Identifier func(token *jwt.Token) web.User
	// contains filtered or unexported fields
}

func (*JWT) Apply

func (j *JWT) Apply(next web.HandlerFunc) web.HandlerFunc

func (*JWT) CreateToken

func (j *JWT) CreateToken(id, name string) (string, error)

type RolePerms

type RolePerms map[string]data.Map

Jump to

Keyboard shortcuts

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