lib

package
v0.0.0-...-8bf14a4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DateTimeFormatNoSeparator = "20060102150405"
View Source
const GuestUserName = "guest"

Variables

View Source
var ErrNotFoundAuthorizationHeader = errors.New("not found Authorization header")
View Source
var ErrNotFoundBearerToken = errors.New("not found bearer token")
View Source
var ErrNotFoundClaims = errors.New("not found claims in token")
View Source
var ErrNotFoundName = errors.New("not found name in token")
View Source
var ErrTokenExpired = errors.New("token is expired")
View Source
var ErrTokenInvalid = errors.New("token is invalid")
View Source
var ErrTokenInvalidNotExistingUserName = errors.New("the user name contained in token doesn't exist")
View Source
var ErrUnexpectedSigningMethod = errors.New("unexpected signing method")
View Source
var NowFunc = time.Now

Functions

func GenerateToken

func GenerateToken(userName string) (tokenString string, err error)

func VerifyHeaderToken

func VerifyHeaderToken(r *http.Request) (userName string, err error)

func VerifyToken

func VerifyToken(tokenString string) (userName string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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