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>,
    pub max_token_length: Option<usize>,
}
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

max_token_length: Option<usize>

Maximum token length to accept

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.