pub struct VerifyOptions {
pub validate_times: bool,
pub leeway: Leeway,
pub expected_iss: Option<String>,
pub expected_aud: Option<String>,
pub expected_alg: Option<Algorithm>,
pub now_ts: Option<i64>,
}
Expand description
Options for JWT verification
Fields§
§validate_times: bool
Whether to validate time-based claims (exp, nbf)
leeway: Leeway
Leeway in seconds for time-based claim validation
expected_iss: Option<String>
Expected issuer claim value
expected_aud: Option<String>
Expected audience claim value
expected_alg: Option<Algorithm>
Expected algorithm (prevents algorithm confusion attacks)
now_ts: Option<i64>
Current timestamp for time validation (defaults to current time)
Implementations§
Source§impl VerifyOptions
impl VerifyOptions
Sourcepub fn validate_times(self, v: bool) -> Self
pub fn validate_times(self, v: bool) -> Self
Set whether to validate time-based claims
Sourcepub fn expect_iss(self, iss: impl Into<String>) -> Self
pub fn expect_iss(self, iss: impl Into<String>) -> Self
Set the expected issuer claim value
Sourcepub fn expect_aud(self, aud: impl Into<String>) -> Self
pub fn expect_aud(self, aud: impl Into<String>) -> Self
Set the expected audience claim value
Sourcepub fn expect_alg(self, alg: Algorithm) -> Self
pub fn expect_alg(self, alg: Algorithm) -> Self
Set the expected algorithm (prevents algorithm confusion attacks)
Trait Implementations§
Source§impl Clone for VerifyOptions
impl Clone for VerifyOptions
Source§fn clone(&self) -> VerifyOptions
fn clone(&self) -> VerifyOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VerifyOptions
impl Debug for VerifyOptions
Auto Trait Implementations§
impl Freeze for VerifyOptions
impl RefUnwindSafe for VerifyOptions
impl Send for VerifyOptions
impl Sync for VerifyOptions
impl Unpin for VerifyOptions
impl UnwindSafe for VerifyOptions
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