pub struct OidcSessionValidator { /* private fields */ }Expand description
A SessionValidator that accepts RS256 OIDC tokens.
Extracts the token from the configured cookie in the upgrade request’s
Cookie header (or treats the input as a bare token when it contains no
=, matching the trak reference’s tolerance for raw -t <jwt>
invocations), validates it via OidcValidator, and converts the
result into an AuthContext (see
VerifiedToken::into_auth_context).
Per the SessionValidator contract, every rejection maps to None
(the connection proceeds as anonymous); the precise [OidcError]
(crate::oidc::OidcError) is logged at debug level under
target = "plexus::auth" — never surfaced to the wire.
Implementations§
Source§impl OidcSessionValidator
impl OidcSessionValidator
Sourcepub fn new(validator: OidcValidator) -> Self
pub fn new(validator: OidcValidator) -> Self
Wrap a validator; tokens are read from the access_token cookie.
Wrap a validator reading a custom cookie.
Sourcepub fn validator(&self) -> &OidcValidator
pub fn validator(&self) -> &OidcValidator
The wrapped validator (e.g. for direct validate_token calls on
non-cookie paths).
Trait Implementations§
Source§impl SessionValidator for OidcSessionValidator
impl SessionValidator for OidcSessionValidator
Source§fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
cookie_value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<AuthContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
cookie_value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<AuthContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn alive(&self, ctx: &AuthContext) -> Result<(), String>
fn alive(&self, ctx: &AuthContext) -> Result<(), String>
Err: why not, in words for the caller. Read more