Skip to main content

signed_request

Function signed_request 

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

Middleware factory that:

  1. Reads the body bytes (so the canonical request hash can be computed).
  2. Reads the four X-RE-* signature headers + Authorization: Bearer.
  3. Runs auth::verify_signed_request.
  4. On success, re-attaches the body and inserts SignedSession into request.extensions() so handlers can pull it out.
  5. On failure, audits the reason and returns 401.