enforcement_state
Module: enforcement_state
Section titled “Module: enforcement_state”Contents
Section titled “Contents”Structs
EnforcementState- On-disk schema of the enforcement state file.
Functions
daemon_path- Return the daemon Sidecar’s enforcement state path.read- Read the enforcement state, orNonewhen it is missing or unparseable.remove- Remove a previous process’s enforcement state.run_path- Return the enforcement state path inside a per-run marker directory.write- Replace the enforcement state file atomically.
firma_runtime_state::enforcement_state::EnforcementState
Section titled “firma_runtime_state::enforcement_state::EnforcementState”Struct
On-disk schema of the enforcement state file.
Fields:
version: String- Authority bundle version the Sidecar enforces.ttl_seconds: u32- TTL the bundle was accepted with.swapped_at: String- RFC 3339 UTC time the bundle was swapped in.expires_at: String- RFC 3339 UTC time after which the bundle is stale unless refreshed.
Traits: Eq
Trait Implementations:
- Serialize
fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private229::Result<<__S as >::Ok, <__S as >::Error>
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Deserialize
fn deserialize<__D>(__deserializer: __D) -> _serde::__private229::Result<Self, <__D as >::Error>
- PartialEq
fn eq(self: &Self, other: &Self) -> bool
- Clone
fn clone(self: &Self) -> Self
firma_runtime_state::enforcement_state::daemon_path
Section titled “firma_runtime_state::enforcement_state::daemon_path”Function
Return the daemon Sidecar’s enforcement state path.
fn daemon_path(state_dir: &std::path::Path) -> std::path::PathBuffirma_runtime_state::enforcement_state::read
Section titled “firma_runtime_state::enforcement_state::read”Function
Read the enforcement state, or None when it is missing or unparseable.
fn read(path: &std::path::Path) -> Option<EnforcementState>firma_runtime_state::enforcement_state::remove
Section titled “firma_runtime_state::enforcement_state::remove”Function
Remove a previous process’s enforcement state.
Errors
Section titled “Errors”Returns filesystem errors other than not-found.
fn remove(path: &std::path::Path) -> crate::Result<()>firma_runtime_state::enforcement_state::run_path
Section titled “firma_runtime_state::enforcement_state::run_path”Function
Return the enforcement state path inside a per-run marker directory.
fn run_path(marker_dir: &std::path::Path) -> std::path::PathBuffirma_runtime_state::enforcement_state::write
Section titled “firma_runtime_state::enforcement_state::write”Function
Replace the enforcement state file atomically.
The content is written to a flushed owner-only temporary file in the same
directory and renamed over path, so readers observe the previous or the
complete new state.
Errors
Section titled “Errors”Returns serialization or filesystem errors.
fn write(path: &std::path::Path, state: &EnforcementState) -> crate::Result<()>