pub struct AccessRule {
pub id: String,
pub description: Option<String>,
pub effect: AccessEffect,
pub subjects: Vec<String>,
pub groups: Vec<String>,
pub actions: Vec<String>,
pub agents: Vec<String>,
pub roles: Vec<String>,
pub match_labels: BTreeMap<String, String>,
}Expand description
One attribute rule.
Dimension semantics:
subjects/groups: the rule applies to a principal when its subject is listed insubjects(orsubjectscontains"*"), or it belongs to any listed group. When both lists are empty the rule applies to every principal, including unauthenticated ones.actions: required, non-empty. Entries are exact action names,"prefix.*"wildcards, or"*".agents/roles/match_labels: resource selectors. Each specified selector must match (logical AND across dimensions); withinagentsandrolesany listed value matches (logical OR), and"*"matches every value. Empty selectors leave that dimension unconstrained. A rule with all three empty matches every resource, including action checks that have no resource at all (e.g.gating.decide).
Fields§
§id: String§description: Option<String>§effect: AccessEffect§subjects: Vec<String>§groups: Vec<String>§actions: Vec<String>§agents: Vec<String>§roles: Vec<String>§match_labels: BTreeMap<String, String>Implementations§
Source§impl AccessRule
impl AccessRule
Sourcepub fn has_resource_selector(&self) -> bool
pub fn has_resource_selector(&self) -> bool
True when the rule constrains the resource in any way.
Trait Implementations§
Source§impl Clone for AccessRule
impl Clone for AccessRule
Source§fn clone(&self) -> AccessRule
fn clone(&self) -> AccessRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccessRule
impl Debug for AccessRule
Source§impl Default for AccessRule
impl Default for AccessRule
Source§fn default() -> AccessRule
fn default() -> AccessRule
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AccessRule
impl<'de> Deserialize<'de> for AccessRule
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 AccessRule
Source§impl PartialEq for AccessRule
impl PartialEq for AccessRule
Source§impl Serialize for AccessRule
impl Serialize for AccessRule
impl StructuralPartialEq for AccessRule
Auto Trait Implementations§
impl Freeze for AccessRule
impl RefUnwindSafe for AccessRule
impl Send for AccessRule
impl Sync for AccessRule
impl Unpin for AccessRule
impl UnsafeUnpin for AccessRule
impl UnwindSafe for AccessRule
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> CoreExecutorTurnFinalizationGuard for Twhere
T: Send,
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§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<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