Skip to main content

Module middleware

Module middleware 

Source

ModulesΒ§

auth_ext

StructsΒ§

AccountContext
AuthenticatedUser
HeaderExtractor πŸ”’
A header extractor that implements OpenTelemetry’s Extractor trait for axum headers.
RateLimitState
State required for rate limiting middleware.
ReadinessMiddlewareState
Middleware that blocks all requests (except /health, /ready, /metrics) until the service is ready.
SignatureMiddlewareState
SignerContext

ConstantsΒ§

PROFILE_IMAGE_BODY_LIMIT_BYTES πŸ”’
SIGNED_JSON_BODY_LIMIT_BYTES πŸ”’

FunctionsΒ§

add_rate_limit_headers πŸ”’
Add rate limit headers to a response.
api_rate_limit_middleware
Middleware to check general API rate limits.
cancel_rate_limit_middleware
Middleware to check order cancellation rate limits.
extract_wallet πŸ”’
Extract wallet address from SignerContext extension.
is_readiness_bypass_path πŸ”’
is_standby_monitoring_get πŸ”’
json_error_response πŸ”’
Helper function to create a JSON error response
order_rate_limit_middleware
Middleware to check order placement rate limits.
rate_limit_exceeded_response πŸ”’
Create a 429 Too Many Requests response with rate limit headers.
readiness_middleware
signature_and_agent_middleware
Middleware for signature-based authentication with agent authorization
signature_and_agent_middleware_inner πŸ”’
standby_is_caught_up_and_unpromoted πŸ”’
trace_context_middleware
Middleware that extracts W3C Trace Context from incoming HTTP headers.
write_route_rate_limit_middleware
Combined middleware for write routes that applies appropriate rate limit based on the request path and method.