Documentation
¶
Overview ¶
Package middleware provides HTTP middleware for authorization and context handling.
Index ¶
Constants ¶
View Source
const ContextUserClaims contextKey = "userClaims"
ContextUserClaims is the key for storing user claims in the context.
Variables ¶
This section is empty.
Functions ¶
func Authorization ¶
Authorization is a middleware that validates the JWT token from the request cookie. If the token is valid, the user claims are attached to the request context; otherwise, it returns an HTTP 401 Unauthorized error.
func RateLimitMiddleware ¶ added in v1.1.0
func RateLimitMiddleware(limiter ratelimiter.IRateLimiter) func(http.Handler) http.Handler
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.