swappable_policy
Module: authority_client::swappable_policy
Section titled “Module: authority_client::swappable_policy”Contents
Section titled “Contents”Structs
RuntimeSnapshot- A complete compiled enforcement generation.SwappablePolicyEvaluation- Policy evaluator backed by an atomically swappable snapshot.
firma_sidecar::authority_client::swappable_policy::RuntimeSnapshot
Section titled “firma_sidecar::authority_client::swappable_policy::RuntimeSnapshot”Struct
A complete compiled enforcement generation.
The evaluator owns its compiled entity schema, and the normalizer owns the mapping table and protection posture. Producers must compile both from the same generation before publication. Freshness starts when published, not when compilation completes.
Methods:
fn new(normalizer: IntentNormalizer, policy: Arc<dyn PolicyEvaluation>, ttl_seconds: u32, version: Option<String>) -> Self- Assemble already compiled components for one generation.
firma_sidecar::authority_client::swappable_policy::SwappablePolicyEvaluation
Section titled “firma_sidecar::authority_client::swappable_policy::SwappablePolicyEvaluation”Struct
Policy evaluator backed by an atomically swappable snapshot.
Methods:
fn from_snapshot(snapshot: RuntimeSnapshot) -> Self- Publish an initial complete generation.fn swap_snapshot(self: &Self, snapshot: RuntimeSnapshot)- Replace all compiled components and freshness metadata in one store.
Trait Implementations:
- PolicyEvaluation
fn evaluate(self: &Self, principal: &AgentId, action: &str, resource: &str, context: serde_json::Value) -> Result<bool, String>- Evaluate against the currently published generation.fn evaluate_verdict(self: &Self, principal: &AgentId, action: &str, resource: &str, context: serde_json::Value) -> Result<PolicyVerdict, String>- Delegate to the inner evaluator so aCedarPolicyEvaluatorsnapshot’sfn is_fresh(self: &Self) -> boolfn is_available(self: &Self) -> boolfn version(self: &Self) -> Option<String>