Skip to content

bootstrap

Functions

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.

  • [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.

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.

  • [RunError::AuthorityBootstrapNoTty] when stdin/stderr is not a TTY.
  • [RunError::AuthorityBootstrapDeclined] when the user answers N.
  • [RunError::Internal] on terminal I/O failure.
fn run_prompt(prompt: & mut dyn AuthorityPromptIo) -> Result<(), crate::error::RunError>