#[non_exhaustive]pub enum TokenRole {
User,
Client,
Workload,
Custom(String),
}Expand description
Which principal a raw inbound token represents. Lookups in
RawCredentialsExtension.inbound_tokens are by this key.
Custom(String) is the escape hatch for host-defined roles —
HashMap equality is by value, so callers must construct the same
Custom("foo".into()) for both insert and lookup.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
User
The user / subject token (e.g. id_token, X-User-Token).
Client
The OAuth client / gateway-access token (e.g. Authorization: Bearer ... from a session JWT).
Workload
A JWT-SVID presented by the inbound workload, when SPIFFE attestation is JWT-based instead of mTLS-based.
Custom(String)
Host-defined role.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TokenRole
impl<'de> Deserialize<'de> for TokenRole
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 TokenRole
impl StructuralPartialEq for TokenRole
Auto Trait Implementations§
impl Freeze for TokenRole
impl RefUnwindSafe for TokenRole
impl Send for TokenRole
impl Sync for TokenRole
impl Unpin for TokenRole
impl UnsafeUnpin for TokenRole
impl UnwindSafe for TokenRole
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.