middleware

package
v0.0.0-...-b00478c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditClientIP

func AuditClientIP() gin.HandlerFunc

AuditClientIP snapshots the global audit policy before any route middleware. Read it for every request so updates take effect without mutating Gin's engine proxy configuration while requests are running. Missing/invalid policy fails back to the TCP peer through the existing resolver.

func BindDomain

func BindDomain(policies ...DomainPolicy) gin.HandlerFunc

func CSRFTokenGuard

func CSRFTokenGuard() gin.HandlerFunc

func DemoHandle

func DemoHandle() gin.HandlerFunc

func FrontendFallback

func FrontendFallback() gin.HandlerFunc

func GlobalLoading

func GlobalLoading() gin.HandlerFunc

func IsPublicFileShareAPI

func IsPublicFileShareAPI(reqPath string) bool

func LoadOperationUser

func LoadOperationUser(c *gin.Context) string

func MCPAPIIdentity

func MCPAPIIdentity() gin.HandlerFunc

func MCPDomainPolicy

func MCPDomainPolicy(c *gin.Context) bool

func MCPErrorMetadata

func MCPErrorMetadata() gin.HandlerFunc

func MCPLogPolicy

func MCPLogPolicy(c *gin.Context) bool

func MCPTokenBoundary

func MCPTokenBoundary() gin.HandlerFunc

func OperationLog

func OperationLog(policies ...OperationLogPolicy) gin.HandlerFunc

func PasswordExpired

func PasswordExpired() gin.HandlerFunc

func SessionAuth

func SessionAuth() gin.HandlerFunc

func SetPasswordPublicKey

func SetPasswordPublicKey() gin.HandlerFunc

func ShouldProxyToAgent

func ShouldProxyToAgent(reqPath string) bool

func WebSocketOriginGuard

func WebSocketOriginGuard() gin.HandlerFunc

func WhiteAllow

func WhiteAllow(policies ...SourcePolicy) gin.HandlerFunc

Types

type DomainPolicy

type DomainPolicy func(*gin.Context) bool

DomainPolicy is configured by the router and must only trust server-verified state.

type OperationLogPolicy

type OperationLogPolicy func(*gin.Context) bool

type SourcePolicy

type SourcePolicy struct {
	Bypass  func(*gin.Context) bool
	Resolve func(*gin.Context, string) (clientIP string, allowed bool)
}

func MCPSourcePolicy

func MCPSourcePolicy() SourcePolicy

Jump to

Keyboard shortcuts

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