Skip to content

audit

Functions


firma_sidecar::startup::audit::load_audit_event_builder

Section titled “firma_sidecar::startup::audit::load_audit_event_builder”

Function

Loads the ECDSA signing key PEM named by the resolved audit configuration and constructs an [audit::builder::EventBuilder].

Returns an error if the file cannot be read or the PEM is invalid.

fn load_audit_event_builder(config: &config::AuditConfig) -> anyhow::Result<audit::builder::EventBuilder>

firma_sidecar::startup::audit::spawn_audit_sink

Section titled “firma_sidecar::startup::audit::spawn_audit_sink”

Function

Spawns the audit sink pipeline. A network sink to the Authority’s own audit service uses authority_tls, the TLS material read from config.

The pipeline is a signing adapter that receives AuditPayloads, signs them into ExecutionEvents, and forwards to the concrete AuditSink.

A WAL sink whose run the Authority rejects ends it through rejection.

Returns a [tokio::task::JoinHandle] that resolves when the sink shuts down.

Returns an error when the sink fails to initialize (invalid config, inability to open the audit log, unusable TLS settings for an external sink).

fn spawn_audit_sink(config: &config::SidecarConfig, authority_tls: &crate::authority_tls::AuthorityTls, payload_rx: mpsc::Receiver<audit::AuditPayload>, event_builder: audit::builder::EventBuilder, exit: tokio_util::sync::CancellationToken, rejection: crate::authority_client::RunRejection) -> anyhow::Result<tokio::task::JoinHandle<Result<(), audit::AuditSinkError>>>