Skip to content

swappable_policy

Module: authority_client::swappable_policy

Section titled “Module: authority_client::swappable_policy”

Structs


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 a CedarPolicyEvaluator snapshot’s
    • fn is_fresh(self: &Self) -> bool
    • fn is_available(self: &Self) -> bool
    • fn version(self: &Self) -> Option<String>