Struct jwt_simple::common::VerificationOptions
source · [−]pub struct VerificationOptions {
pub reject_before: Option<UnixTimeStamp>,
pub accept_future: bool,
pub required_subject: Option<String>,
pub required_key_id: Option<String>,
pub required_public_key: Option<String>,
pub required_nonce: Option<String>,
pub allowed_issuers: Option<HashSet<String>>,
pub allowed_audiences: Option<HashSet<String>>,
pub time_tolerance: Option<Duration>,
pub max_validity: Option<Duration>,
}
Expand description
Additional features to enable during verification. Signatures and token expiration are already automatically verified.
Fields
reject_before: Option<UnixTimeStamp>
Reject tokens created before the given date
For a given user, the time of the last successful authentication can be kept in a database,
and reject_before
can then be used to reject older (replayed) tokens.
accept_future: bool
Accept tokens created with a date in the future
required_subject: Option<String>
Require a specific subject to be present
required_key_id: Option<String>
Require a specific key identifier to be present
required_public_key: Option<String>
Require a specific public key to be present
required_nonce: Option<String>
Require a specific nonce to be present
allowed_issuers: Option<HashSet<String>>
Require the issuer to be present in the set
allowed_audiences: Option<HashSet<String>>
Require the audience to be present in the set
time_tolerance: Option<Duration>
Time tolerance for validating expiration dates
max_validity: Option<Duration>
Reject tokens created more than max_validity
ago
Trait Implementations
sourceimpl Clone for VerificationOptions
impl Clone for VerificationOptions
sourcefn clone(&self) -> VerificationOptions
fn clone(&self) -> VerificationOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VerificationOptions
impl Debug for VerificationOptions
sourceimpl Default for VerificationOptions
impl Default for VerificationOptions
sourceimpl PartialEq<VerificationOptions> for VerificationOptions
impl PartialEq<VerificationOptions> for VerificationOptions
sourcefn eq(&self, other: &VerificationOptions) -> bool
fn eq(&self, other: &VerificationOptions) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VerificationOptions) -> bool
fn ne(&self, other: &VerificationOptions) -> bool
This method tests for !=
.
impl Eq for VerificationOptions
impl StructuralEq for VerificationOptions
impl StructuralPartialEq for VerificationOptions
Auto Trait Implementations
impl RefUnwindSafe for VerificationOptions
impl Send for VerificationOptions
impl Sync for VerificationOptions
impl Unpin for VerificationOptions
impl UnwindSafe for VerificationOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more