Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicUnitAuth ¶
func BasicUnitAuth() gin.HandlerFunc
func BasicUserAuth ¶
func BasicUserAuth() gin.HandlerFunc
func BodyLimit ¶
func BodyLimit(maxBytes int64) gin.HandlerFunc
BodyLimit rejects requests whose body exceeds maxBytes before any downstream binding reads it, so unauthenticated or semi-trusted routes cannot be used to exhaust memory with oversized payloads.
func InitJWT ¶
func InitJWT() *jwt.GinJWTMiddleware
func InstanceJWT ¶
func InstanceJWT() *jwt.GinJWTMiddleware
func RateLimiter ¶
func RateLimiter(rps rate.Limit, burst int) gin.HandlerFunc
RateLimiter throttles requests per client IP with a token-bucket limiter, so an unauthenticated route cannot be flooded with enough concurrent requests to exhaust memory before BodyLimit's per-request cap can help (BodyLimit bounds one request's body, not how many requests run at once). rps is the sustained rate and burst the number of requests allowed instantly.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.