auth

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Issuer      = "sola/auth"
	CtxUsername = "auth.username"
	CtxPassword = "auth.password"
	CtxClaims   = "auth.claims"
	CtxToken    = "auth.token"
)

Context Key

Variables

View Source
var (
	ErrNoClaims = errors.New("auth.claims not found")
)

error(s)

View Source
var LoadAuthCache = loadAuthCache

LoadAuthCache Middleware's export

Functions

func Auth

func Auth(t Type, key interface{}) sola.Middleware

Auth Token

func Claims

func Claims(c sola.Context, key string) interface{}

Claims Reader

func Clean

func Clean(m sola.Middleware) sola.Middleware

Clean Data

func CleanFunc

func CleanFunc(h sola.Handler) sola.Handler

CleanFunc Data

func New

func New(signAuth, pre, success sola.Middleware) sola.Middleware

New Auth Middleware

func NewFunc

func NewFunc(signAuth, pre sola.Middleware, success sola.Handler) sola.Handler

NewFunc Auth Handler

func NewJWT added in v2.1.1

func NewJWT(key []byte) (sign sola.Middleware, wrapper sola.Middleware)

NewJWT Middleware

func Sign

func Sign(t Type, key interface{}) sola.Middleware

Sign Token

Types

type BaseCheck

type BaseCheck func(username, password string) bool

BaseCheck for Base Auth

type Type

type Type uint8

Type of Auth

const (
	AuthBase Type = iota
	AuthJWT
)

AuthType

Jump to

Keyboard shortcuts

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