Expand description
Account references for multi-account OAuth credentials.
An account is a (provider, label) pair. The bare provider storage key
("openai-codex") is the default account; every other account is stored
under "<provider>@<label>". Nothing that already exists moves or needs
migration.
Labels are validated at every boundary (CLI, env, config, HTTP query, proxy body) before they are used as a JSON key, a file-name fragment, a URL parameter, or a log field. A label that fails the grammar never reaches the filesystem.
Structs§
- Account
Label - Validated account label. Grammar:
^[a-z0-9][a-z0-9._-]{0,31}$; the wordsdefaultandautoare reserved and rejected. - Account
Policy - Per-provider account selection. Built once from config (+ env overlay); never mutates the process environment or the active profile.
- Account
Summary - Non-secret listing row for one stored account. Never carries token
material;
account_id_prefixis at most 8 characters. - Credential
Ref - A fully addressed OAuth credential: provider + account slot.
- Seat
Identity - Identity of the credential material currently stored in one slot. Scopes
per-slot caches and pairs a proven-capacity reading with the token vended
for it: the provider seat (via
seat_fingerprint) when the credential carries an account id — stable across token rotation — otherwise a digest of the refresh material, which changes on re-login and on rotation. An opaque digest: not reversible, never logged with token material.
Enums§
- Account
- A concrete account slot for a provider.
- Account
Selector - What a caller asks for when no explicit account is given.
Constants§
- AUTO_
ACCOUNT_ NAME - Reserved selector word for opt-in automatic selection (G5).
- DEFAULT_
ACCOUNT_ NAME - Reserved word for the bare provider slot. Never a label.
Functions§
- account_
config_ key - Config key carrying the selected account for a provider.
- account_
env_ var - Environment variable that selects the account for a provider:
SYNAPS_ACCOUNT_<PROVIDER>with-→_, upper-cased. - seat_
fingerprint - Stable, opaque seat fingerprint: hex SHA-256 over a domain tag, the
provider id and the provider’s FULL account id (e.g. the Codex
chatgpt_account_idclaim). Deterministic across processes and hosts, so a consumer holding a vended token can derive the same value from that token’s claim and compare it withAccountSummary::seat_fingerprintbefore spending on the listed seat. Never derived from token material.