middleware

package
v0.0.0-...-06a4187 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserCtxKey = &middleware.ContextKey{"user"}

Functions

func AccessAbove

func AccessAbove(level users.AccessLevel) func(next http.Handler) http.Handler

AccessAbove checks if the user has access level above the given level

func JWTAuth

func JWTAuth(j *jwt.JWT, u users.UserStorer) func(next http.Handler) http.Handler

JWTAuth is a middleware that checks for a valid JWT in the Authorization header. If one is found, it will be parsed and the user will be added to the request context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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