middleware

package
v0.0.0-...-fbf9a92 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableCORS

func EnableCORS(cors string) gin.HandlerFunc

EnableCORS : Enable CORS Middleware in DEV Enviroment

func Logger

func Logger(logger loggerEntryWithFields, utc bool) gin.HandlerFunc

Logger Middleware

Types

type Auth

type Auth struct {
	Authenticator *auth.Authenticator
}

Auth is used to authenticate and authorize HTTP requests.

func (*Auth) Authenticate

func (a *Auth) Authenticate() gin.HandlerFunc

Authenticate validates a JWT from the `Authorization` header.

func (*Auth) HasRole

func (a *Auth) HasRole(roles ...string) func(next http.Handler) http.Handler

HasRole validates that an authenticated user has at least one role from a specified list. This method constructs the actual function that is used.

Jump to

Keyboard shortcuts

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