Expand description
Bearer token sources.
A TokenSource loads (actor_id, token) pairs that the server uses to
authenticate incoming bearer tokens. Plaintext tokens returned here are
hashed immediately by AppState on ingest — see hash_bearer_token —
and never persist past startup/refresh.
The trait exists so that additional backends (AWS Secrets Manager, HashiCorp Vault, etc.) can plug in behind feature flags without touching the server wiring.
Structs§
- EnvOr
File Token Source - Reads bearer tokens from environment variables and / or files, matching the long-standing server configuration:
Constants§
- AWS_
SECRET_ ENV - Environment variable that, when set, selects AWS Secrets Manager as the
token source. Its value is the secret ID or ARN. Only honored when the
binary is compiled with
--features aws.
Traits§
- Token
Source - A source of bearer tokens, returned as
(actor_id, token)pairs in plaintext. The caller is expected to hash tokens before storing them.
Functions§
- resolve_
token_ source - Pick the token source based on configuration.