middleware

package
v0.0.0-...-dab624b Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiInterfaceInfoList []ApiInterfaceInfo

Functions

func AccessRestriction

func AccessRestriction(u *biz.AccessRestrictionUsecase, proxy *biz.DmsProxyUsecase) echo.MiddlewareFunc

AccessRestriction enforces IP/CIDR access restriction for all DMS entry points. Order (must not reorder short-circuits):

  1. never-block register channel POST /v1/dms/proxys
  2. switch off → allow
  3. switch on → registered ProxyTarget host IP → allow
  4. whitelist hit → allow
  5. else HTTP 403 (not 401)

Loopback is NOT auto-allowed. CloudBeaver paths are not exempted.

func JWTTokenAdapter

func JWTTokenAdapter() echo.MiddlewareFunc

JWTTokenAdapter is a `echo` middleware, by rewriting the header, the jwt token support header "Authorization: {token}" and "Authorization: Bearer {token}".

func LicenseAdapter

func LicenseAdapter(l *biz.LicenseUsecase) echo.MiddlewareFunc

func OperationRecordMiddleware

func OperationRecordMiddleware(_ *service.DMSService) echo.MiddlewareFunc

func UserActivityMiddleware

func UserActivityMiddleware(_ *service.DMSService) echo.MiddlewareFunc

Types

type ApiInterfaceInfo

type ApiInterfaceInfo struct {
	RouterPath               string
	Method                   string
	OperationType            string
	OperationAction          string
	GetProjectAndContentFunc func(c echo.Context, dms interface{}) (projectName string, content i18nPkg.I18nStr, err error)
}

Jump to

Keyboard shortcuts

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