middlewares

package
v0.0.0-...-4711403 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MPL-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolParamsSkipper

func BoolParamsSkipper(sourceParam string, contextKey string, skipAfter bool) func(echo.Context) (bool, error)

BoolParamsSkipper return true when skipAfter and no param provided (only for bool param). If a param is provided it can assign it to a context 'variable' if contextKey is passed

func Init

func Init(globals utils.Globals, e *echo.Echo)

func Int64ParamsSkipper

func Int64ParamsSkipper(sourceParam string, contextKey string, skipAfter bool) func(echo.Context) (bool, error)

Int64ParamsSkipper return true when skipAfter and no param provided (only for int64 param). If a param is provided it can assign it to a context 'variable' if contextKey is passed

func PermissionsVerification

func PermissionsVerification(globals utils.Globals, permissions []string, skipper func(c echo.Context) (bool, error)) echo.MiddlewareFunc

PermissionsVerification it will check if the user as the provided permission, there is a skipper to skip if not needed

func SkipOrSetUser

func SkipOrSetUser(isSkipper bool) func(echo.Context) (bool, error)

SkipOrSetUser I use this 'skipper' has a function to set the user id present in the body so that permissions can check for it later

func TokenVerification

func TokenVerification(globals utils.Globals, skipper func(c echo.Context) (bool, error)) echo.MiddlewareFunc

TokenVerification it will check if the token is present and its authenticity then add its user information to a context variable there is a skipper to skip if not needed

Types

This section is empty.

Jump to

Keyboard shortcuts

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