Skip to main content

auth_middleware

Function auth_middleware 

Source
pub async fn auth_middleware(
    __arg0: Extension<AuthConfig>,
    request: Request<Body>,
    next: Next,
) -> Response
Expand description

Authentication middleware that checks for valid API key or JWT.

Checks for credentials in:

  1. Authorization: Bearer <key_or_jwt> header
  2. X-API-Key: <key> header