Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication middleware helpers for HTTP routes.

Functionsยง

check_auth
Check that the request carries a valid key with the given permission. Returns Err((StatusCode::UNAUTHORIZED, message)) on failure.
extract_bearer
Extract the raw key from Authorization: Bearer <key>.
resolve_principal
Resolve the requesting Principal from the request headers.