Skip to main content

Module accounts

Module accounts 

Source
Expand description

The account RPCs (listidentityaccounts, getidentityaccount, upsertidentityaccount, account.key.verify), moved out of identity::register unchanged as named functions.

Structs§

KeyProbe 🔒
What the optional live probe learned about a key.
StoredSecret 🔒

Functions§

allocate_numbers 🔒
#4936 §3.3: give each account that shares a provider and email with another a number that stays its own. Computed over the unfiltered list, so a provider filter can’t renumber a group. One allocation at a time, from a fresh read: two overlapping lists must not both plan the same number, or the one written last renumbers what the first returned.
backfill_emails 🔒
SPEC_ACCOUNT_EMAIL_IN_ARMORY_2026_09_23.md §4: backfill each OAuth account’s login email from its own config dir, so accounts signed in before #3541, and every Claude login (whose transcript prints no email), show it. Written only when it changed, and only that one field, in this store and the global mirror (a full upsert here could re-create an account deleted since the list, undo a status written meanwhile, or repoint the mirror’s secret_ref). A failed write still returns the email.
copy_stored_numbers 🔒
Each listed account carries the seq and seqmax the store holds now, or neither.
drop_orphaned_secret 🔒
A new account whose row could not be saved leaves nothing behind that points at no account.
get_identity_account 🔒
key_account_row 🔒
The row a stored key is saved as. Its non-secret context is merged so nothing the user set is lost: existing context, then user-entered context, then validation metadata, then the masked tail.
list_identity_accounts 🔒
On the blocking pool: the email backfill reads each OAuth account’s .claude.json and canonicalizes its dir (#3617), like this module’s other fs/keyring calls.
list_with_numbers 🔒
probe_key 🔒
The single outbound probe, fired only when the user clicked “Validate” (validate = true). An invalid key comes back as the result to answer with.
store_secret 🔒
Where the key is kept: a key added to a new account goes into the Vault, as an api-key entry the account row points at. An account that already keeps its key in the OS keychain keeps it there (a replaced key goes to the same place), and one whose Vault entry is gone gets a new entry. Both are blocking (the keychain’s sync D-Bus on Linux, the Vault’s database), so they run off the async runtime worker. Returns the pointer and whether a new entry was created.
upsert_identity_account 🔒
Accepts the full IdentityAccount payload. A missing id mints a fresh UUID; created_at and updated_at are server-set so callers don’t have to know the current time.
verify_account_key 🔒
Connectors → Accounts: validate (optional) and securely store an API key. The plaintext goes to the Vault (an account that already keeps its key in the OS keychain keeps it there); the DB row keeps only the SecretRef pointer, the masked tail and non-secret metadata. See docs/specs/archive/SPEC_TRUST_CENTER_2026_06_15.md §5/§6.