#[non_exhaustive]pub struct AuthIdentity {
pub name: String,
pub role: String,
pub method: AuthMethod,
pub raw_token: Option<SecretString>,
pub sub: Option<String>,
}Expand description
Identity of an authenticated caller.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringHuman-readable identity name (e.g. API key label or cert CN).
role: StringRBAC role associated with this identity.
method: AuthMethodWhich authentication mechanism produced this identity.
raw_token: Option<SecretString>Raw bearer token from the Authorization header, wrapped in
SecretString so it is never accidentally logged or serialized.
Present for OAuth JWT; None for mTLS and API-key auth.
Tool handlers use this for downstream token passthrough via
crate::rbac::current_token.
sub: Option<String>JWT sub claim (stable user identifier, e.g. Keycloak UUID).
Used for token store keying. None for non-JWT auth.
Trait Implementations§
Source§impl Clone for AuthIdentity
impl Clone for AuthIdentity
Source§fn clone(&self) -> AuthIdentity
fn clone(&self) -> AuthIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthIdentity
impl RefUnwindSafe for AuthIdentity
impl Send for AuthIdentity
impl Sync for AuthIdentity
impl Unpin for AuthIdentity
impl UnsafeUnpin for AuthIdentity
impl UnwindSafe for AuthIdentity
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