Expand description
Filesystem/directory provisioning for the pre-launch OAuth flow.
Split out of identity_handlers.rs (module-organization pass, see
docs/specs/PLAN_LOGIN_SINGLE_PATH_CONSOLIDATION_2026_07_20.md) —
owns compute_and_ensure_bundle_dir (vestigial, bundle mode was
retired in Phase 4c of SPEC_PRESET_TO_BUNDLE_REFACTOR_2026_07_02.md,
kept only so the wire shape and its one call site in
identity_handlers::register_identity_handlers don’t need touching)
and compute_and_ensure_account_dir (the live direct-account path).
Constants§
- ORPHAN_
SWEEP_ 🔒MIN_ AGE_ SECS - Direct-account sibling of
compute_and_ensure_bundle_dir(issue #1624 PR-C Part B) — bypasses the bundle system entirely. Mints a freshaccount_idwhenexisting_account_idis empty (first-time OAuth connect from the launch modal); reuses it when non-empty (Reconnect — refresh tokens in place, same isolation dir, same account row updated in place).
Functions§
- caller_
auth_ 🔒dir - The account directory a caller already chose, as
auth_envnames it under the provider’sauth_config_dir_env_var: the key that keeps a login the caller persists itself (notdirect_account) to one live session per directory.Nonefor a provider without one, or when it isn’t set. - compute_
and_ 🔒ensure_ account_ dir - Returns
(account_id, dir)—account_idis always populated (even on a dir-resolution failure, so the caller can still log/track it);dirisNoneon the same gate/registry/fs failurescompute_and_ensure_bundle_dirtreats as soft failures — never abortauth.startover a config-dir issue. - compute_
and_ 🔒ensure_ bundle_ dir - Compute the per-bundle OAuth config dir + ensure it exists +
override the provider’s
auth_config_dir_env_varentry inauth_env. - link_
history_ 🔒if_ isolated - Best-effort: if
providerhas a linkable native history directory (ProviderConfig::history_native_subdir,Nonefor providers with no fixed on-disk history to redirect) and credential isolation is currently on, ensuredir/<subdir>is linked to the always-global history location forentity_id(a bundle id or account id — same namespace, see [DataPaths::identity_dir]). No-op when isolation is off (diris already inside the global tree, sodir/<subdir>already IS the global location) or the provider has no linkable subdir. Never fails the caller — logs and continues, same philosophy as every other soft-fail in this module.