pub struct PolicySet { /* private fields */ }Expand description
An ordered list of policies evaluated left-to-right.
The first policy that produces a PolicyViolation short-circuits
evaluation. All policies must pass for the chain to be accepted.
Use PolicySet when a deployment has multiple policy layers —
for example a base org policy composed with a team-specific restriction.
Implementations§
Source§impl PolicySet
impl PolicySet
pub fn new() -> Self
pub fn add(self, policy: DelegationPolicy) -> Self
pub fn check_chain(&self, chain: &DyoloChain) -> Result<(), A1Error>
pub fn check_intent(&self, intent: &Intent) -> Result<(), A1Error>
Sourcepub fn from_yaml(yaml: &str) -> Result<Self, Error>
Available on crate feature policy-yaml only.
pub fn from_yaml(yaml: &str) -> Result<Self, Error>
policy-yaml only.Parse a YAML string into a PolicySet.
Requires the policy-yaml feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PolicySet
impl RefUnwindSafe for PolicySet
impl Send for PolicySet
impl Sync for PolicySet
impl Unpin for PolicySet
impl UnsafeUnpin for PolicySet
impl UnwindSafe for PolicySet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more