Skip to main content

Module account

Module account 

Source
Expand description

Named Gmail account resolution (issue #1500, ADR-0066).

A second, Gmail-specific multi-tenancy axis, orthogonal to --profile (ADR-0045): named accounts in the gmail block of settings.json, selected per invocation via --account / GMAIL_ACCOUNT_ENV. resolve_account (reads) and resolve_account_for_write (account-creating writes: login, import) are the two entry points the credential CRUD layer (crate::gmail::auth, crate::gmail::import) and the CLI/MCP surfaces route through.

Structs§

AccountSummary
One row of gmail account list / the gmail_account_list MCP tool. Never carries a secret — only what’s safe to render.

Enums§

ResolvedAccount
Which credential source a Gmail command should read from, as decided by resolve_account.

Constants§

GMAIL_ACCOUNT_ENV
Selects the active Gmail account for every command, mirroring OMNI_DEV_PROFILE. Propagated by the global --account flag in Cli::propagate_global_flags.

Functions§

active_gmail_account_from
Returns the account named by GMAIL_ACCOUNT_ENV in raw, or None when unset or empty.
is_first_legacy_to_named_transition
Whether the write about to happen would be the first time a named Gmail account is configured while legacy (pre-migration) credentials still exist.
list_accounts
Lists configured Gmail accounts, sorted by name.
resolve_account
Resolves which Gmail account a read command (credential load, status, client construction, MCP tools, …) should use.
resolve_account_for_write
Resolves which Gmail account a write command that can create a new account (gmail auth login, gmail auth import) should target.
validate_account
Validates that name is a known Gmail account.