Skip to content

config

Structs

Functions


firma_run::authority::config::AuthoritySection

Section titled “firma_run::authority::config::AuthoritySection”

Struct

Persisted [authority] table.

Fields:

  • type: Option<String> - "local" or "remote".
  • url: Option<String> - Required when type = "remote".

Traits: Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>
  • Clone
    • fn clone(self: &Self) -> AuthoritySection
  • PartialEq
    • fn eq(self: &Self, other: &AuthoritySection) -> bool
  • Default
    • fn default() -> AuthoritySection

firma_run::authority::config::canonical_write_path

Section titled “firma_run::authority::config::canonical_write_path”

Function

The canonical path to create when persisting [authority] and no config file exists yet.

Delegates to the shared firma-config discovery ($FIRMA_CONFIG_DIR$XDG_CONFIG_HOME/firma~/.config/firma → platform config dir), then appends the canonical file name. None only if no config dir is resolvable.

fn canonical_write_path() -> Option<std::path::PathBuf>

firma_run::authority::config::default_user_config_path

Section titled “firma_run::authority::config::default_user_config_path”

Function

Resolve the discovered firma.toml path (no explicit override), or None when no candidate exists on this platform.

fn default_user_config_path() -> Option<std::path::PathBuf>

firma_run::authority::config::persist_local

Section titled “firma_run::authority::config::persist_local”

Function

Persist [authority].type = "local" (creating parent dirs as needed).

Atomic via tempfile + rename. Sets 0700 on the parent dir and 0600 on the file on Unix. Preserves any other sections already in the file if it exists.

Returns an error on I/O failure or serialization failure.

fn persist_local(path: &std::path::Path) -> Result<(), crate::error::RunError>

firma_run::authority::config::read_authority

Section titled “firma_run::authority::config::read_authority”

Function

Read the [authority] section if the file exists and is parseable.

Returns Ok(None) when the file does not exist or the section is absent. Parse errors propagate as [RunError::ConfigParse].

Returns an error on I/O failure (other than NotFound) or TOML parse failure.

fn read_authority(path: &std::path::Path) -> Result<Option<AuthoritySection>, crate::error::RunError>