pub struct AuthenticatedPrincipal {
pub subject: String,
pub tenant_claim: Option<TenantId>,
pub scopes: Vec<String>,
pub claims: Value,
}Expand description
Result of a successful auth check, attached to the request as an
axum::Extension. The TenantExtractor in http.rs reads this to
resolve the request’s target tenant ahead of the X-Solo-Tenant
header. P4 (audit log) reads principal.subject for the
audit-log “who” field.
Fields§
§subject: StringJWT sub claim, or "bearer" for bearer-mode requests.
tenant_claim: Option<TenantId>Tenant claimed by the JWT (tenant_claim_name), if any. In
bearer mode this is set to the daemon’s default tenant. In OIDC
mode it’s the validated value of the configured custom claim.
scopes: Vec<String>Scopes advertised by the JWT (scope claim, space-split).
Empty for bearer-mode principals.
claims: ValueRaw JWT claims (serde_json::Value) for downstream inspection.
Null for bearer-mode principals.
Implementations§
Trait Implementations§
Source§impl Clone for AuthenticatedPrincipal
impl Clone for AuthenticatedPrincipal
Source§fn clone(&self) -> AuthenticatedPrincipal
fn clone(&self) -> AuthenticatedPrincipal
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 moreAuto Trait Implementations§
impl Freeze for AuthenticatedPrincipal
impl RefUnwindSafe for AuthenticatedPrincipal
impl Send for AuthenticatedPrincipal
impl Sync for AuthenticatedPrincipal
impl Unpin for AuthenticatedPrincipal
impl UnsafeUnpin for AuthenticatedPrincipal
impl UnwindSafe for AuthenticatedPrincipal
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,
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