Skip to content

swappable_policy

Module: authority_client::swappable_policy

Section titled “Module: authority_client::swappable_policy”

Structs


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 new(initial: Box<dyn PolicyEvaluation>) -> Self - Create a new swappable evaluator with the supplied initial snapshot.
  • fn swap(self: &Self, new_eval: Box<dyn PolicyEvaluation>, ttl_seconds: u32, version: Option<String>) - Swap in a new policy evaluator and refresh its TTL deadline.

Trait Implementations:

  • PolicyEvaluation
    • fn evaluate(self: &Self, principal: &AgentId, action: &str, resource: &str, context: &serde_json::Value) -> Result<bool, String>
    • fn is_fresh(self: &Self) -> bool
    • fn version(self: &Self) -> Option<String>