pub struct PolicyEngine { /* private fields */ }Expand description
Cedar-based policy engine for Converge gate decisions.
Implementations§
Source§impl PolicyEngine
impl PolicyEngine
Sourcepub fn from_policy_str(policy_text: &str) -> Result<Self, EngineError>
pub fn from_policy_str(policy_text: &str) -> Result<Self, EngineError>
Create an engine from a Cedar policy source string.
§Errors
Returns Err if the Cedar policy text fails to parse.
Sourcepub fn evaluate(
&self,
req: &DecideRequest,
) -> Result<PolicyDecision, EngineError>
pub fn evaluate( &self, req: &DecideRequest, ) -> Result<PolicyDecision, EngineError>
Evaluate a policy decision.
Builds Cedar principal (Agent::Persona), resource (Flow::Commitment),
and context from the request, then evaluates the loaded policies.
§Errors
Returns Err if entity or context construction fails.
Auto Trait Implementations§
impl Freeze for PolicyEngine
impl !RefUnwindSafe for PolicyEngine
impl Send for PolicyEngine
impl Sync for PolicyEngine
impl Unpin for PolicyEngine
impl UnsafeUnpin for PolicyEngine
impl !UnwindSafe for PolicyEngine
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more