pub struct Verifier { /* private fields */ }Expand description
Verifies OIDC access tokens (JWT) against the issuer’s JWKS. Cheap to clone; thread-safe.
Errors: Error::Authentication for every invalid token (the message names the failed check,
never the token), Error::Unavailable when discovery or the JWKS cannot be fetched and
Error::Config for invalid options.
Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn new(options: VerifierOptions) -> Result<Self>
pub fn new(options: VerifierOptions) -> Result<Self>
Validates options and builds a verifier (no network call).
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Builds a verifier from GROW_AUTH_ISSUER (required), GROW_AUTH_AUDIENCE (default
GROW_AUTH_CLIENT_ID), GROW_AUTH_JWKS_URL, GROW_AUTH_ROLES_CLAIM (default roles) and
GROW_AUTH_CLOCK_SKEW (duration, default 60s).
Sourcepub fn from_env_map(env: &HashMap<String, String>) -> Result<Self>
pub fn from_env_map(env: &HashMap<String, String>) -> Result<Self>
Verifier::from_env with an explicit environment map (tests).
Sourcepub fn roles_claim(&self) -> &str
pub fn roles_claim(&self) -> &str
The roles claim path.
Sourcepub fn clock_skew(&self) -> Duration
pub fn clock_skew(&self) -> Duration
The exp/nbf tolerance.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Drops the cached JWKS so the next verification refetches it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Verifier
impl !UnwindSafe for Verifier
impl Forget for Verifier
impl Freeze for Verifier
impl Move for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnsafeUnpin for Verifier
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