Skip to main content

Module middleware

Module middleware 

Source
Expand description

Shared axum middleware for Victauri’s localhost HTTP servers.

Gated behind the middleware feature flag. Provides thin middleware wrappers around the pure-logic security primitives in super::security.

Structs§

AuthState
Shared authentication state holding the optional Bearer token for the MCP server.

Functions§

default_rate_limiter
Create a rate limiter with the default capacity of DEFAULT_RATE_LIMIT requests per second.
dns_rebinding_guard
Axum middleware that blocks DNS rebinding attacks.
origin_guard
Axum middleware that blocks cross-origin requests from browsers.
rate_limit
Axum middleware that rejects requests with 429 when the token bucket is exhausted.
require_auth
Axum middleware that validates the Authorization: Bearer <token> header against AuthState.
security_headers
Axum middleware that sets security-hardening response headers on every response.