middleware

package
v0.0.0-...-9808740 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MiddlewareManager

type MiddlewareManager struct {
	// contains filtered or unexported fields
}

Middleware manager

func NewMiddlewareManager

func NewMiddlewareManager(sessUC session.UCSession, authUC auth.UseCase, cfg *config.Config, origins []string, logger logger.Logger) *MiddlewareManager

Middleware manager constructor

func (*MiddlewareManager) AdminMiddleware

func (mw *MiddlewareManager) AdminMiddleware(next echo.HandlerFunc) echo.HandlerFunc

Admin role

func (*MiddlewareManager) AuthJWTMiddleware

func (mw *MiddlewareManager) AuthJWTMiddleware(authUC auth.UseCase, cfg *config.Config) echo.MiddlewareFunc

JWT way of auth using cookie or Authorization header

func (*MiddlewareManager) AuthSessionMiddleware

func (mw *MiddlewareManager) AuthSessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc

Auth sessions middleware using redis

func (*MiddlewareManager) CSRF

func (mw *MiddlewareManager) CSRF(next echo.HandlerFunc) echo.HandlerFunc

CSRF Middleware

func (*MiddlewareManager) CheckAuth

func (mw *MiddlewareManager) CheckAuth(next echo.HandlerFunc) echo.HandlerFunc

Check auth middleware

func (*MiddlewareManager) DebugMiddleware

func (mw *MiddlewareManager) DebugMiddleware(next echo.HandlerFunc) echo.HandlerFunc

Debug dump request middleware

func (*MiddlewareManager) MetricsMiddleware

func (mw *MiddlewareManager) MetricsMiddleware(metrics metric.Metrics) echo.MiddlewareFunc

Prometheus metrics middleware

func (*MiddlewareManager) OwnerOrAdminMiddleware

func (mw *MiddlewareManager) OwnerOrAdminMiddleware() echo.MiddlewareFunc

Role based auth middleware, using ctx user

func (*MiddlewareManager) RequestLoggerMiddleware

func (mw *MiddlewareManager) RequestLoggerMiddleware(next echo.HandlerFunc) echo.HandlerFunc

Request logger middleware

func (*MiddlewareManager) RoleBasedAuthMiddleware

func (mw *MiddlewareManager) RoleBasedAuthMiddleware(roles []string) echo.MiddlewareFunc

Role based auth middleware, using ctx user

func (*MiddlewareManager) Sanitize

func (mw *MiddlewareManager) Sanitize(next echo.HandlerFunc) echo.HandlerFunc

Sanitize and read request body to ctx for next use in easy json

Jump to

Keyboard shortcuts

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