auth

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CtxUsername = "auth.username"
	CtxPassword = "auth.password"
	CtxClaims   = "auth.claims"
)

Context Key

Variables

This section is empty.

Functions

func Auth

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

Auth Token

func Claims

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

Claims Reader

func Clean

Clean Data

func New

New Auth Middleware

func Sign

func Sign(t Type, key interface{}) middleware.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