Struct kanidmd_lib::filter::Filter
source · pub struct Filter<STATE> { /* private fields */ }
Expand description
A Filter
is a logical set of assertions about the state of an Entry
and
it’s avas. Filter
s are built from a set of possible assertions.
Pres
ence. An ava of that attribute’s name exists, with any value on theEntry
.Eq
uality. An ava of the attribute exists and contains this matching value.Sub
string. An ava of the attribute exists and has a substring containing the requested value.Or
. Contains multiple filters and asserts at least one is true.And
. Contains multiple filters and asserts all of them are true.AndNot
. This is different to a “logical not” operation. This asserts that a condition is not true in the current candidate set. A search ofAndNot
alone will yield not results, but anAndNot
in anAnd
query will assert that a condition can not hold.
Filter
s for security reasons are validated by the schema to assert all requested attributes
are valid and exist in the schema so that they can have their indexes correctly used. This avoids
a denial of service attack that may lead to full-table scans.
This Filter
validation state is in the STATE
attribute and will be either FilterInvalid
or FilterValid
. The Filter
must be checked by the schema to move to FilterValid
. This
helps to prevent errors at compile time to assert Filters
are securely checked
Implementations§
source§impl Filter<FilterValidResolved>
impl Filter<FilterValidResolved>
pub fn to_inner(&self) -> &FilterResolved
source§impl Filter<FilterValid>
impl Filter<FilterValid>
pub fn invalidate(self) -> Filter<FilterInvalid>
pub fn resolve( &self, ev: &Identity, idxmeta: Option<&IdxMeta>, rsv_cache: Option<&mut ResolveFilterCacheReadTxn<'_>>, ) -> Result<Filter<FilterValidResolved>, OperationError>
pub fn get_attr_set(&self) -> BTreeSet<Attribute>
pub fn into_recycled(self) -> Self
source§impl Filter<FilterInvalid>
impl Filter<FilterInvalid>
pub fn new(inner: FC) -> Self
pub fn new_recycled(inner: FC) -> Self
pub fn join_parts_and(a: Self, b: Self) -> Self
pub fn validate( &self, schema: &dyn SchemaTransaction, ) -> Result<Filter<FilterValid>, SchemaError>
pub fn from_ro( ev: &Identity, f: &ProtoFilter, qs: &mut QueryServerReadTransaction<'_>, ) -> Result<Self, OperationError>
pub fn from_rw( ev: &Identity, f: &ProtoFilter, qs: &mut QueryServerWriteTransaction<'_>, ) -> Result<Self, OperationError>
pub fn from_ldap_ro( ev: &Identity, f: &LdapFilter, qs: &mut QueryServerReadTransaction<'_>, ) -> Result<Self, OperationError>
Trait Implementations§
source§impl Debug for Filter<FilterInvalid>
impl Debug for Filter<FilterInvalid>
source§impl Debug for Filter<FilterValid>
impl Debug for Filter<FilterValid>
source§impl Debug for Filter<FilterValidResolved>
impl Debug for Filter<FilterValidResolved>
source§impl FromStr for Filter<FilterInvalid>
impl FromStr for Filter<FilterInvalid>
source§impl<STATE: Ord> Ord for Filter<STATE>
impl<STATE: Ord> Ord for Filter<STATE>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<STATE: PartialOrd> PartialOrd for Filter<STATE>
impl<STATE: PartialOrd> PartialOrd for Filter<STATE>
impl<STATE: Eq> Eq for Filter<STATE>
impl<STATE> StructuralPartialEq for Filter<STATE>
Auto Trait Implementations§
impl<STATE> Freeze for Filter<STATE>where
STATE: Freeze,
impl<STATE> RefUnwindSafe for Filter<STATE>where
STATE: RefUnwindSafe,
impl<STATE> Send for Filter<STATE>where
STATE: Send,
impl<STATE> Sync for Filter<STATE>where
STATE: Sync,
impl<STATE> Unpin for Filter<STATE>where
STATE: Unpin,
impl<STATE> UnwindSafe for Filter<STATE>where
STATE: UnwindSafe,
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request