Documentation
¶
Index ¶
- func AuthenticationMiddleware(next http.Handler, authenticator security.Authenticator, ...) http.Handler
- func ContextSetupMiddleware(mainCtx context.Context, next http.Handler, ...) http.Handler
- func LoggingMiddleware(next http.Handler, logBody bool) http.HandlerFunc
- func TenancyAccessMiddleware(next http.Handler, checker *authorizer.TenancyAccessChecker) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticationMiddleware ¶
func AuthenticationMiddleware( next http.Handler, authenticator security.Authenticator, opts ...security.AuthOption, ) http.Handler
AuthenticationMiddleware is an HTTP middleware that verifies and extracts authentication data supplied in a JWT as an Authorization bearer token.
func ContextSetupMiddleware ¶
func ContextSetupMiddleware( mainCtx context.Context, next http.Handler, ctxFnList ...func(ctx context.Context) context.Context, ) http.Handler
ContextSetupMiddleware propagates logger in main context into HTTP context.
func LoggingMiddleware ¶
func LoggingMiddleware(next http.Handler, logBody bool) http.HandlerFunc
LoggingMiddleware — zero-alloc hot path, panic-safe, production-grade.
func TenancyAccessMiddleware ¶ added in v1.76.1
func TenancyAccessMiddleware(next http.Handler, checker *authorizer.TenancyAccessChecker) http.Handler
TenancyAccessMiddleware is an HTTP middleware that verifies the caller has data access to the partition identified in their claims. It uses TenancyAccessChecker.CheckAccess which checks the "member" relation for regular users and the "service" relation for system_internal callers.
This middleware should be placed after AuthenticationMiddleware in the handler chain so that claims are available in the context.
Types ¶
This section is empty.