Skip to main content

Module auth

Module auth 

Source
Expand description

Identity-in-context authentication.

authenticate is an additive middleware: it attaches an Identity to the request context when a valid Authorization: Bearer token is provided, and does nothing otherwise. Handlers enforce their own requirement with require_auth / require_admin.

The built-in token mapping is for development only — replace it with your own middleware before deploying.

Structs§

Identity

Functions§

authenticate
bearer_token
identity
require_admin
require_auth