middleware

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuth added in v1.4.0

func AdminAuth(apiKey string) func(http.Handler) http.Handler

AdminAuth is middleware that checks for a valid admin API key in the request headers.

func AuthMiddleware

func AuthMiddleware(authService *auth.Service, cookieName string) func(http.Handler) http.Handler

func CSRFMiddleware added in v1.0.4

func CSRFMiddleware(csrfConfig models.CSRFConfig) func(http.Handler) http.Handler

func CorsMiddleware

func CorsMiddleware(allowedOrigins []string) func(http.Handler) http.Handler

func EndpointHooksMiddleware added in v1.0.3

func EndpointHooksMiddleware(config *models.Config, authService *auth.Service) func(http.Handler) http.Handler

func OptionalAuthMiddleware

func OptionalAuthMiddleware(authService *auth.Service, cookieName string) func(http.Handler) http.Handler

func RateLimitMiddleware added in v1.0.4

func RateLimitMiddleware(rateLimitService models.RateLimitService) func(http.Handler) http.Handler

func Redirect added in v1.3.6

func Redirect(ctx *models.EndpointHookContext, url string, status int)

Redirect sets up a redirect response and marks the request as handled.

func RedirectAuthMiddleware added in v1.3.8

func RedirectAuthMiddleware(authService *auth.Service, cookieName string, redirectURL string, status int) func(http.Handler) http.Handler

RedirectAuthMiddleware redirects unauthenticated users to the specified URL.

Types

type AuthContextKey added in v1.4.0

type AuthContextKey string
const ContextUserID AuthContextKey = "user_id"

Jump to

Keyboard shortcuts

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