Skip to main content

Module auth

Module auth 

Source
Expand description

API-key authentication for the /mcp mount.

Structs§

ApiKey
One configured API key plus the subject it authenticates.
AuthState
Shared state the middleware needs, cloneable and cheap.
Caller
Marker extension carrying the authenticated caller’s subject.
Principal
Marker extension identifying which configured key authenticated the request.

Enums§

AuthOutcome
Outcome of authenticating one request.

Functions§

authenticate
Authenticate one request against the configured keys. Pure: no I/O, no logging.
caller
The authenticated subject of the request, if this layer authenticated one.
principal
The authenticating key’s identity, if this layer authenticated one.
require
Middleware entry point, shaped for axum::middleware::from_fn_with_state.