Skip to main content

Module identity_auth_dirs

Module identity_auth_dirs 

Source
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).

Functions§

caller_auth_dir
The account directory a caller already chose, as auth_env names it under the provider’s auth_config_dir_env_var: the key that keeps a login the caller persists itself (not direct_account) to one live session per directory. None for a provider without one, or when it isn’t set.
compute_and_ensure_account_dir
Returns (account_id, dir) — account_id is always populated (even on a dir-resolution failure, so the caller can still log/track it); dir is None on the same gate/registry/fs failures compute_and_ensure_bundle_dir treats as soft failures — never abort auth.start over 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_var entry in auth_env.