Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication middleware for the proxy.

Supports two modes:

  • Simple mode: a single proxy_api_key or proxy_token.
  • Role mapping mode: multiple keys, each mapped to an agent role.

The role (if any) is injected into the request extensions as AgentRole before the request reaches the handler.

Structs§

AgentRole
Wrapper type stored in request extensions to carry the authenticated role.
AuthState
Auth configuration extracted from ProxyConfig.

Functions§

auth_middleware
Axum middleware that authenticates every request.
extract_api_key
Extracts the API key from request headers.