pub enum PrincipalSet {
Wildcard,
Specific(Vec<String>),
}Expand description
v0.8.4 #75 (audit H-5): Principal set is parsed by hand from
serde_json::Value so we can reject silently-permissive shapes (a
bare string that isn’t "*", an empty {"AWS": []} list, or any
Service / Federated / CanonicalUser Principal type that we
don’t support).
Variants§
Wildcard
"Principal": "*" — match any caller (incl. anonymous / unauth).
The bare string must be exactly "*"; any other string form is a
parse error.
Specific(Vec<String>)
"Principal": {"AWS": ["AKIA...", ...]} — match those access key
ids. Guaranteed non-empty after parse.
Implementations§
Source§impl PrincipalSet
impl PrincipalSet
Sourcepub fn parse(value: &Value) -> Result<Self, PolicyParseError>
pub fn parse(value: &Value) -> Result<Self, PolicyParseError>
Parse the JSON value attached to a Statement’s Principal field.
Trait Implementations§
Source§impl Clone for PrincipalSet
impl Clone for PrincipalSet
Source§fn clone(&self) -> PrincipalSet
fn clone(&self) -> PrincipalSet
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 PrincipalSet
impl Debug for PrincipalSet
Source§impl PartialEq for PrincipalSet
impl PartialEq for PrincipalSet
Source§fn eq(&self, other: &PrincipalSet) -> bool
fn eq(&self, other: &PrincipalSet) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PrincipalSet
impl StructuralPartialEq for PrincipalSet
Auto Trait Implementations§
impl Freeze for PrincipalSet
impl RefUnwindSafe for PrincipalSet
impl Send for PrincipalSet
impl Sync for PrincipalSet
impl Unpin for PrincipalSet
impl UnsafeUnpin for PrincipalSet
impl UnwindSafe for PrincipalSet
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> 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§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.