Struct AuthContext
pub struct AuthContext {
pub sub: String,
pub actor_key: Option<Arc<str>>,
pub scopes: Vec<String>,
pub issuer: String,
pub via_session: bool,
pub csrf_token: Option<String>,
pub email: Option<String>,
}Expand description
Stored in request extensions by the HTTP auth middleware (see
[crate::middleware::AuthLayer]).
Fields§
§sub: StringJWT sub claim (or "static-bearer" for static-token requests).
actor_key: Option<Arc<str>>Optional opaque actor key (lab-specific observability hook); produced
by the [crate::middleware::ActorKeyDeriver] closure when one is
installed on the layer. Consumers without an actor-key concept
(cortex etc.) leave this None.
scopes: Vec<String>Effective scopes for this request.
issuer: StringJWT iss claim (or "local" / "browser-session" sentinel).
via_session: booltrue when the request was authenticated via the browser session
cookie rather than a bearer token.
csrf_token: Option<String>Browser-session CSRF token, when the request was authenticated via
session cookie. Echoed back to handlers that need to mint a fresh
x-csrf-token for follow-up state-changing requests.
email: Option<String>Verified Google email tied to the browser session, when known.
Trait Implementations§
§impl Clone for AuthContext
impl Clone for AuthContext
§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AuthContext
impl RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnsafeUnpin for AuthContext
impl UnwindSafe for AuthContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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