pub struct VerifiedToken { /* private fields */ }Expand description
The successful outcome of OidcValidator::validate_token.
Wraps the sealed VerifiedUser proof together with the optional
plexus extension claims a backend may want for its AuthContext.
Sealed like the proof it carries: no public constructor, no public
fields — the only mint path is the validator.
Implementations§
Source§impl VerifiedToken
impl VerifiedToken
Sourcepub fn user(&self) -> &VerifiedUser
pub fn user(&self) -> &VerifiedUser
The sealed proof (claims: sub, iss, iat, exp, tenant).
Sourcepub fn tenant_id(&self) -> Option<&TenantId>
pub fn tenant_id(&self) -> Option<&TenantId>
The verified tenant identity from org_id, if the token carried
one. None ⇔ valid-but-tenantless (UT-S01 D3).
Sourcepub fn roles(&self) -> &[String]
pub fn roles(&self) -> &[String]
The roles extension claim (empty when absent — optional for
validation per the interchangeability bar).
Sourcepub fn claim(&self, name: &str) -> Option<&Value>
pub fn claim(&self, name: &str) -> Option<&Value>
Any other verified claim by name: nickname, email, or a
provider’s namespaced claim such as https://menger.example/roles.
The claims read into fields above (sub, iss, exp, iat,
org_id, sid, jti, roles, username) are not repeated here.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
The session identifier (sid, else jti, else the token’s
signature segment). Always non-empty, so the
AuthContext built from this token reports
is_authenticated() == true.
Sourcepub fn into_auth_context(self) -> AuthContext
pub fn into_auth_context(self) -> AuthContext
Build the per-connection AuthContext.
Metadata written:
org_idandtenant_id— the same value under both keys for one deprecation window (UT-S01 D3), so pre-cutoverClaimTenantResolverconfigurations keep resolving;iss— the verified issuer;username— when the extension claim was present;auth_method: "oidc"— parity with the API-key path’sauth_methodmarker in the trak reference;expires_at— the token’sexp, seconds since the epoch (IDENTITY-27).