pub struct PolicyMatcherSet { /* private fields */ }Expand description
A set of staged, active policies with their glob predicates compiled.
Implementations§
Source§impl PolicyMatcherSet
impl PolicyMatcherSet
Sourcepub fn from_records(records: &[Record]) -> Result<Self>
pub fn from_records(records: &[Record]) -> Result<Self>
Compile active, non-off policy records from universal store records.
Sourcepub fn from_records_lenient(records: &[Record]) -> Self
pub fn from_records_lenient(records: &[Record]) -> Self
Compile active, non-off policy records while isolating bad records.
A malformed policy must not prevent the daemon from evaluating every other policy at boot or after a live refresh.
Sourcepub fn from_policies<I>(policies: I) -> Result<Self>
pub fn from_policies<I>(policies: I) -> Result<Self>
Compile keyed policy payloads. This is useful to pure callers that have already separated the universal record envelope.
Sourcepub fn matches(&self, action: &Action) -> Vec<MatchedPolicy<'_>>
pub fn matches(&self, action: &Action) -> Vec<MatchedPolicy<'_>>
Return every policy whose present predicates all match the action.
Sourcepub fn detect_unclassified_literal_bypass(
&self,
action: &Action,
raw_command: &str,
) -> Option<&str>
pub fn detect_unclassified_literal_bypass( &self, action: &Action, raw_command: &str, ) -> Option<&str>
Detect a record-only signal when an unclassified command mentions a meaningful literal from an active host/path trigger; this is intentionally false-positive because raw text alone cannot prove use.
Auto Trait Implementations§
impl Freeze for PolicyMatcherSet
impl RefUnwindSafe for PolicyMatcherSet
impl Send for PolicyMatcherSet
impl Sync for PolicyMatcherSet
impl Unpin for PolicyMatcherSet
impl UnsafeUnpin for PolicyMatcherSet
impl UnwindSafe for PolicyMatcherSet
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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