pub enum Applicability {
Write {
kinds: KindSet,
collections: Scope<String>,
actions: ActionSet,
path_prefixes: Scope<String>,
},
Blob,
Grant {
client_ids: Scope<String>,
},
Token {
client_ids: Scope<String>,
},
Create,
}Expand description
The core’s own types, re-exported: every field of
record::ParsedPolicy is one of these, so a caller that declares a
policy reaches them through this crate rather than depending on
didbot-policy for the names alone.
What a policy statically applies to — the data the tree indexes on.
One variant per subject shape, matching Subject.
This is used twice per policy: once as its decision surface (what
evaluate may ask it about) and once,
independently, as its observation surface (what
Evaluator::observe is told
about) — see PolicyDeclaration.
Variants§
Write
Applies to writes.
Fields
kinds: KindSetWhich account kinds. A policy that only makes sense for agents
declares that here, and a host’s or a service’s write never
reaches its evaluator. See KindSet.
collections: Scope<String>Which collections (NSIDs). Any for a policy that is not
collection-specific — an application denial, for instance.
actions: ActionSetWhich actions. A policy declaring only WriteAction::Delete
never sees a create or update, and vice versa.
path_prefixes: Scope<String>Which changed-path prefixes, matched by splitting on . — this
crate’s own routing convention, kept separate from whatever
segmentation meaning an evaluator’s engine gives
Change::path itself; see that
field’s doc comment. Any matches the write regardless of its
diff, including one with no changed paths at all.
Blob
Applies to blob uploads.
Grant
Applies to pushed authorization requests.
Fields
Token
Applies to tokens about to be issued: a code exchanged, a refresh rotated.
Fields
Create
Applies to where a new account lands.
Trait Implementations§
Source§impl Clone for Applicability
impl Clone for Applicability
Source§fn clone(&self) -> Applicability
fn clone(&self) -> Applicability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Applicability
impl Debug for Applicability
Source§impl PartialEq for Applicability
impl PartialEq for Applicability
Source§fn eq(&self, other: &Applicability) -> bool
fn eq(&self, other: &Applicability) -> bool
self and other values to be equal, and is used by ==.impl Eq for Applicability
impl StructuralPartialEq for Applicability
Auto Trait Implementations§
impl Freeze for Applicability
impl RefUnwindSafe for Applicability
impl Send for Applicability
impl Sync for Applicability
impl Unpin for Applicability
impl UnsafeUnpin for Applicability
impl UnwindSafe for Applicability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
§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
key and return true if they are equal.§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>
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>
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