Expand description
Authentication middleware for the proxy.
Supports two modes:
- Simple mode: a single
proxy_api_keyorproxy_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§
- Agent
Role - Wrapper type stored in request extensions to carry the authenticated role.
- Auth
State - Auth configuration extracted from
ProxyConfig.
Functions§
- auth_
middleware - Axum middleware that authenticates every request.
- extract_
api_ key - Extracts the API key from request headers.