Skip to main content

Module auth

Module auth 

Source

Structs§

AuthState
RateLimiterState

Functions§

default_rate_limiter
Default rate limiter: 1000 requests per second.
generate_token
Generate a random UUID v4 token for Bearer authentication.
origin_guard
Localhost origin guard: rejects requests with non-localhost Origin header.
rate_limit
Axum middleware for rate limiting.
require_auth
Axum middleware that validates Bearer token authentication.
security_headers
Security headers middleware: X-Content-Type-Options, Cache-Control.