middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationHeaderName = "Authorization"
	BearerTokenPrefix       = "Bearer "
)

Variables

View Source
var (
	ErrInvalidAccessToken = errors.New("invalid access token")
	ErrTokenHasExpired    = errors.New("token has expired")
)

Functions

func AuthMiddleware

func AuthMiddleware(cfg *config.JWT) func(http.Handler) http.Handler

func GetBearer

func GetBearer(r *http.Request) (string, error)

func ValidateBearer

func ValidateBearer(cfg *config.JWT, tokenRaw string) (*core.BasicJWTClaims, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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