pub struct PolicyDecisionPoint { /* private fields */ }Expand description
Policy Decision Point — evaluates requests against a rule set.
Implementations§
Source§impl PolicyDecisionPoint
impl PolicyDecisionPoint
Sourcepub fn new(rules: Vec<PolicyRule>) -> Self
pub fn new(rules: Vec<PolicyRule>) -> Self
Creates a decision point backed by the supplied rules.
Sourcepub fn from_config() -> Self
pub fn from_config() -> Self
Loads policy rules from the lean-ctx configuration directory.
Missing or invalid configuration produces an empty, permissive rule set.
Sourcepub fn evaluate(&self, request: &PolicyEvalRequest) -> PolicyDecision
pub fn evaluate(&self, request: &PolicyEvalRequest) -> PolicyDecision
Evaluates matching rules at the highest governing hierarchy level.
Sourcepub fn add_rule(&mut self, rule: PolicyRule)
pub fn add_rule(&mut self, rule: PolicyRule)
Adds a rule to the decision point.
Sourcepub fn rules_at_level(&self, level: PolicyLevel) -> Vec<&PolicyRule>
pub fn rules_at_level(&self, level: PolicyLevel) -> Vec<&PolicyRule>
Returns rules defined at one hierarchy level.
Auto Trait Implementations§
impl Freeze for PolicyDecisionPoint
impl RefUnwindSafe for PolicyDecisionPoint
impl Send for PolicyDecisionPoint
impl Sync for PolicyDecisionPoint
impl Unpin for PolicyDecisionPoint
impl UnsafeUnpin for PolicyDecisionPoint
impl UnwindSafe for PolicyDecisionPoint
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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