bootstrap
Module: authority::bootstrap
Section titled “Module: authority::bootstrap”Contents
Section titled “Contents”Functions
persist_authority_section- Merge an[authority]table intopathvia a toml round-trip.resolve_persist_target- Decide where to persist the generated[authority]section.run_prompt- Run the y/N prompt and surface the answer as typed errors.
Constants
PROMPT_TEXT- User-visible prompt text. Mirrors spec §4 step 4.
firma_run::authority::bootstrap::PROMPT_TEXT
Section titled “firma_run::authority::bootstrap::PROMPT_TEXT”Constant: &str
User-visible prompt text. Mirrors spec §4 step 4.
firma_run::authority::bootstrap::persist_authority_section
Section titled “firma_run::authority::bootstrap::persist_authority_section”Function
Merge an [authority] table into path via a toml round-trip.
Existing sections/comments survive the round-trip; parent directories
and the file are created when missing. Idempotent: an existing
[authority] table is left untouched.
Errors
Section titled “Errors”- [
RunError::ConfigParse] when the existing file is not valid TOML. - [
RunError::Internal] on I/O or serialization failure.
fn persist_authority_section(path: &std::path::Path) -> Result<(), crate::error::RunError>firma_run::authority::bootstrap::resolve_persist_target
Section titled “firma_run::authority::bootstrap::resolve_persist_target”Function
Decide where to persist the generated [authority] section.
Reuses an existing firma.toml when one was discovered by config
resolution; otherwise targets <cwd>/.firma/firma.toml.
Errors
Section titled “Errors”Returns [RunError::Internal] if the current working directory
cannot be read.
fn resolve_persist_target(existing_config: Option<&std::path::Path>) -> Result<std::path::PathBuf, crate::error::RunError>firma_run::authority::bootstrap::run_prompt
Section titled “firma_run::authority::bootstrap::run_prompt”Function
Run the y/N prompt and surface the answer as typed errors.
Returns Ok(()) on Y so the caller can proceed to persist + spawn.
Errors
Section titled “Errors”- [
RunError::AuthorityBootstrapNoTty] when stdin/stderr is not a TTY. - [
RunError::AuthorityBootstrapDeclined] when the user answersN. - [
RunError::Internal] on terminal I/O failure.
fn run_prompt(prompt: & mut dyn AuthorityPromptIo) -> Result<(), crate::error::RunError>