Skip to content

SidecarConfig

Functions

  • resolve - Validate schema against state, the state directory this process and

firma_sidecar::config::SidecarConfig::resolve

Section titled “firma_sidecar::config::SidecarConfig::resolve”

Function

Validate schema against state, the state directory this process and its children resolve their artifacts from.

This is the only way to build a [SidecarConfig]. Resolution and validation are one step because they are not independent: the validator rejects an https:// Authority on this host with no CA certificate, so an anchor adopted from the state directory has to be in place before the check runs. Splitting them is what let firma doctor reject configurations the Sidecar accepts.

What state supplies, for each field the config leaves unset:

FieldDefault
authority.public_key_pathauthority.pub, if present
authority.ca_cert_paths[tls/authority-ca.crt], if present and the Authority is on this host
ca.dirgenerated-firma-ca
audit.file_pathaudit.jsonl
audit.signing_key_pathaudit.key

Each is the path firma config generates, so a config that names nothing and a scaffolded one drive the same files.

Returns [SidecarConfigError] when any section fails validation.

fn resolve(schema: firma_config_schema::sidecar::SidecarConfig, state: &firma_runtime_state::RuntimeLayout) -> Result<Self, SidecarConfigError>