Skip to main content

api_rate_limit_middleware

Function api_rate_limit_middleware 

Source
pub async fn api_rate_limit_middleware(
    __arg0: State<RateLimitState>,
    req: Request,
    next: Next,
) -> Response
Expand description

Middleware to check general API rate limits.

This can be applied to any endpoint. For authenticated endpoints, it uses the wallet from SignerContext. For public endpoints, it attempts to extract wallet from query parameters.