startup
Module: startup
Section titled “Module: startup”Contents
Section titled “Contents”Modules
audit- Audit subsystem startup.authority- Authority stream client spawn helper.capability- Build the runtime [CapabilityMap] and [TokenVerifier] from theconnector- Build the connector [ConnectorRegistry] from[sidecar.connector]config.interceptor- Interceptor spawn dispatch.local_exec- Startup builder for the local-exec governance endpoint.log_contract- Standalone-startup log contract.pipeline- Enforcement pipeline construction.
Module: audit
Section titled “Module: audit”Audit subsystem startup.
Covers three responsibilities:
- [
load_audit_event_builder] — reads the ECDSA signing key from file or environment and constructs anEventBuilder. - [
spawn_audit_sink] — spawns the signing adapter plus the concrete sink (stdout/file/gRPC) as background tokio tasks. - internal
run_signing_adapter— sits between the pipeline and the concrete sink, signingAuditPayloads intoExecutionEvents on their way out.
Module: authority
Section titled “Module: authority”Authority stream client spawn helper.
Wires the shared tonic channel and spawns the background
WatchPolicyBundle / WatchRevocations tasks for the required Authority
endpoint. Production readiness depends on both streams hydrating.
Module: capability
Section titled “Module: capability”Build the runtime [CapabilityMap] and [TokenVerifier] from the
sidecar’s [sidecar.capability_seed] and
[sidecar.authority].public_key_path config.
Each configured path contains canonical [firma_core::CapabilitySeed] TOML.
Before any read or watcher registration, the Sidecar resolves every path and
requires it to remain beneath the canonical runtime capabilities directory.
It then verifies every raw token and checks its signed claims against the
file before adding it to the runtime map.
Module: connector
Section titled “Module: connector”Build the connector [ConnectorRegistry] from [sidecar.connector] config.
The registry default is built from default_timeout (30s uses
the [GenericHttpConnector::default_for_unconfigured] shortcut);
every host connector entry becomes a
[GenericHttpConnector] registered under its host string.
Module: interceptor
Section titled “Module: interceptor”Interceptor spawn dispatch.
Selects the concrete interceptor implementation based on the
[InterceptorMode] in config and
returns a [tokio::task::JoinHandle] that resolves when the
interceptor shuts down.
Module: local_exec
Section titled “Module: local_exec”Startup builder for the local-exec governance endpoint.
[spawn_local_exec_endpoint] reads [LocalExecConfig] from
[SidecarConfig], builds the handler and endpoint, and spawns them as a
background tokio task. Returns None when local_exec is not configured.
Module: log_contract
Section titled “Module: log_contract”Standalone-startup log contract.
Locks the six-line INFO sequence the sidecar emits on every
successful start. The contract is part of the operator-facing
interface: examples/demo/ uses these lines to detect readiness, so
the order, prefix, and field surface are all stable.
The six lines, in order, are:
config loaded path="…"connector registry built hosts=N default_timeout_ms=Tinterceptor listening addr="…"authority stream connected endpoint="…"policy bundle loaded version="…" ttl_seconds=Nsidecar ready
Lines 4 and 5 are emitted only after both Authority streams have hydrated,
so they report a real connection and the Authority bundle version actually
enforced. The per-stream authority stream connected stream=… lines are
connection diagnostics, not contract lines.
Module: pipeline
Section titled “Module: pipeline”Enforcement pipeline construction.
Assembles an initially protected empty normalizer, both
enforcement stages, and the credential injector, and wraps them in
an EnforcementPipeline.