Expand description
Config discovery, load/save, selection, and the env overlay (research Pattern 2).
Discovery: IGNITION_CLI_CONFIG (explicit path — scripts and tests)
FIRST, the platform path second. macOS gotcha: directories ignores
XDG_CONFIG_HOME, which is exactly why every test drives the env
override.
Precedence (LOCKED): CLI flag > IGNITION_* env > profile value >
default. Each env concern has exactly one home: profile selection env
(IGNITION_PROFILE) is folded into --profile by the bin’s
apply_env_defaults; the URL env overlay lives here (apply_env_overlay);
auth env resolution lives in secret.
Re-exports§
pub use profile::AuthRef;pub use profile::Config;pub use profile::Profile;pub use profile::RigConfig;pub use profile::RigEntry;pub use profile::UiConfig;pub use secret::BasicEnvStore;pub use secret::Credential;pub use secret::EnvStore;pub use secret::KeyringStore;pub use secret::Secret;pub use secret::SecretStore;pub use secret::resolve_secret;
Modules§
- profile
- Config + Profile serde structs — the on-disk shape of
config.toml. - secret
- Secrets: the
Secretnewtype (type-level redaction), theSecretStoreseam, and env-first resolution (research Pattern 3 — the STATE.md keyring blocker resolution).
Functions§
- apply_
env_ overlay - Env overlay (the
IGNITION_*half of the LOCKED precedence): whenIGNITION_URLis set it overrides the selected profile’s URL. Profile selection env (IGNITION_PROFILE) is folded into the--profileflag by the bin; auth env resolution lives insecret— one concern per home. - config_
path - Config file location:
IGNITION_CLI_CONFIGenv override first, the platform config dir second. - load
- Load config from
path. A missing file is a fresh install, NOT an error (versionmust work day one). Unreadable or invalid TOML isCoreError::ConfigInvalid(exit 3) naming the path. Unknown keys WARN (tracing) and are otherwise tolerated — nodeny_unknown_fields, ever (Pitfall 7). Sub-secondpoll_interval_secsis REFUSED (exit 3,poll_interval_too_small) — the strict path. - load_
for_ tui - The TUI’s load entry point (08-01, TUIX-05): identical parse and
lenient extraction to
load, but a clamp violation confined to the NEW schema surface does NOT error — it warns carrying the samepoll_interval_too_smallslug/message, substitutes the default cadence, and returns Ok. - resolve_
selection - Resolve which profile a command targets: flag (which already contains
IGNITION_PROFILEvia the bin’s env-defaults step) >config.active. - save
- Persist config to
path, creating parent dirs. The file is written — and re-asserted — with 0600 permissions on unix (Pitfall 3.6 prevention, verified by test).