middleware

package
v0.0.0-...-80e8cda Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuthenticatedMiddleware

func AdminAuthenticatedMiddleware(sessionStore *sessions.CookieStore, jwtKey []byte, next http.HandlerFunc) http.HandlerFunc

func GzipMiddleware

func GzipMiddleware(next http.Handler) http.Handler

func HTTPSMiddleware

func HTTPSMiddleware(next http.Handler, env string) http.Handler

func HeadersMiddleware

func HeadersMiddleware(next http.Handler, env string) http.Handler

func IsSignedOn

func IsSignedOn(r *http.Request, sessionStore *sessions.CookieStore, jwtKey []byte) bool

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

func MachineAuthenticatedMiddleware

func MachineAuthenticatedMiddleware(machineToken string, next http.HandlerFunc) http.HandlerFunc

func UserAuthenticatedMiddleware

func UserAuthenticatedMiddleware(sessionStore *sessions.CookieStore, jwtKey []byte, next http.HandlerFunc) http.HandlerFunc

Types

type UserJWT

type UserJWT struct {
	IsAdmin     bool      `json:"is_admin"`
	IsRecruiter bool      `json:"is_recruiter"`
	IsDeveloper bool      `json:"is_developer"`
	UserID      string    `json:"user_id"`
	Email       string    `json:"email"`
	Type        string    `json:"type"`
	CreatedAt   time.Time `json:"created_at"`
	jwt.StandardClaims
}

func GetUserFromJWT

func GetUserFromJWT(r *http.Request, sessionStore *sessions.CookieStore, jwtKey []byte) (*UserJWT, error)

Jump to

Keyboard shortcuts

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