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§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§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 more