pub struct ClassificationBased {
pub maximum_allowed: SecurityClassification,
pub rules: Vec<PolicyRule>,
}Expand description
Deterministic policy evaluator that applies a maximum classification and optional evidence rules.
Fields§
§maximum_allowed: SecurityClassificationHighest classification allowed without a deny decision.
rules: Vec<PolicyRule>Additional action/evidence rules.
Implementations§
Source§impl ClassificationBased
impl ClassificationBased
Sourcepub fn new(maximum_allowed: SecurityClassification) -> Self
pub fn new(maximum_allowed: SecurityClassification) -> Self
Creates a classification gate with the supplied maximum level.
Sourcepub fn from_rules(
maximum_allowed: SecurityClassification,
rules: Vec<PolicyRule>,
) -> Self
pub fn from_rules( maximum_allowed: SecurityClassification, rules: Vec<PolicyRule>, ) -> Self
Creates a gate with an initial rule set.
Sourcepub fn with_rule(self, rule: PolicyRule) -> Self
pub fn with_rule(self, rule: PolicyRule) -> Self
Adds a rule in builder style.
Sourcepub fn add_rule(&mut self, rule: PolicyRule)
pub fn add_rule(&mut self, rule: PolicyRule)
Adds a rule to the evaluator.
Trait Implementations§
Source§impl Clone for ClassificationBased
impl Clone for ClassificationBased
Source§impl Debug for ClassificationBased
impl Debug for ClassificationBased
Source§impl<'de> Deserialize<'de> for ClassificationBased
impl<'de> Deserialize<'de> for ClassificationBased
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ClassificationBased
Source§impl PartialEq for ClassificationBased
impl PartialEq for ClassificationBased
Source§impl PolicyEvaluator for ClassificationBased
impl PolicyEvaluator for ClassificationBased
Source§fn evaluate(&self, context: &dyn PolicyContext, action: &str) -> PolicyDecision
fn evaluate(&self, context: &dyn PolicyContext, action: &str) -> PolicyDecision
Evaluates
action against the supplied portable context.Source§impl Serialize for ClassificationBased
impl Serialize for ClassificationBased
impl StructuralPartialEq for ClassificationBased
Auto Trait Implementations§
impl Forget for ClassificationBased
impl Freeze for ClassificationBased
impl Move for ClassificationBased
impl RefUnwindSafe for ClassificationBased
impl Send for ClassificationBased
impl Sync for ClassificationBased
impl Unpin for ClassificationBased
impl UnsafeUnpin for ClassificationBased
impl UnwindSafe for ClassificationBased
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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