pub struct Verifier { /* private fields */ }Expand description
Single-issuer verifier: the original API, as a one-issuer
MultiIssuerVerifier. The issuer and audience pins are required; a blank
one fails closed at verification time, before any network call.
Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn new(issuer_url: impl Into<String>, audience: impl Into<String>) -> Self
pub fn new(issuer_url: impl Into<String>, audience: impl Into<String>) -> Self
Pin the exact issuer and the audience this resource server accepts. Both
are required (WP-09c): a verifier with no audience pin would accept any
token the issuer ever signed, for any resource. A blank issuer or
audience cannot be rejected here (the constructor is infallible), so
verify fails closed with a jwt error before any network call.
Sourcepub fn with_audience(self, aud: impl Into<String>) -> Self
pub fn with_audience(self, aud: impl Into<String>) -> Self
Accept one more audience in addition to the one given to new. Blank
values are ignored.
Sourcepub fn with_audiences(self, auds: Vec<String>) -> Self
pub fn with_audiences(self, auds: Vec<String>) -> Self
Accept several more audiences. Blank values are ignored.
pub fn with_jwks_uri(self, uri: impl Into<String>) -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
Sourcepub fn with_min_fetch_interval(self, interval: Duration) -> Self
pub fn with_min_fetch_interval(self, interval: Duration) -> Self
Minimum interval between JWKS fetches (the kid-miss DoS bound).
Duration::ZERO disables it — for tests and static-JWKS fixtures.
Sourcepub fn allow_legacy_typ(self) -> Self
pub fn allow_legacy_typ(self) -> Self
Compat window: accept access tokens without the at+jwt JOSE typ
(pre-WP-03b mints). Off by default — production consumers should
require the profile marker.
Sourcepub fn with_clock_skew(self, skew: Duration) -> Self
pub fn with_clock_skew(self, skew: Duration) -> Self
Tolerate this much clock difference when judging expiry. See MultiIssuerVerifier::with_clock_skew.
Sourcepub async fn verify_logout_token(
&self,
token: &str,
options: &LogoutTokenOptions,
) -> Result<LogoutToken, AuthError>
pub async fn verify_logout_token( &self, token: &str, options: &LogoutTokenOptions, ) -> Result<LogoutToken, AuthError>
Sourcepub async fn verify_claims(
&self,
token: &str,
policy: &ValidationPolicy,
) -> Result<Map<String, Value>, AuthError>
pub async fn verify_claims( &self, token: &str, policy: &ValidationPolicy, ) -> Result<Map<String, Value>, AuthError>
Sourcepub async fn verify_with(
&self,
token: &str,
audience: Option<Vec<String>>,
issuer: Option<String>,
) -> Result<CurrentUser, AuthError>
pub async fn verify_with( &self, token: &str, audience: Option<Vec<String>>, issuer: Option<String>, ) -> Result<CurrentUser, AuthError>
See MultiIssuerVerifier::verify_with; issuer may only name the
pinned issuer.