Expand description
Control plane trait and implementations for client lookup
§Control Plane Abstraction
Defines the ControlPlane trait for looking up client authentication and
authorization records. Implementations include:
RemoteControlPlane— reads client records from a remote control repository (the production source of truth).LocalControlPlane— resolves clients from a static in-memory list (useful for dev/test or as a fallback).FallbackControlPlane— chains a primary and secondary control plane: the primary is tried first and, on any error, the secondary is consulted. This lets you run the remote backend as the primary with local config as the fallback.
§Client record schema
Records live at clients/by-key/{sha256(api_key)}.json in the control
repository. The JSON schema is defined by [ClientRecord].
§Extending
To add a new backend (e.g. PostgreSQL, Redis, Vault), implement the
ControlPlane trait and wire it into the server’s AppState.
Modules§
Structs§
- Client
Record - Canonical client record stored in the control plane.
- Fallback
Control Plane - Chains a primary and secondary control plane.
- Local
Client - A client entry for local (in-memory) lookup.
- Local
Control Plane - Resolves clients from a static list — typically parsed from env vars.
Enums§
Traits§
- Control
Plane - Abstraction over the source of truth for client authentication and authorization.
Functions§
- hash_
api_ key - SHA-256 hash of an API key, returned as a lowercase hex string.