[][src]Struct biscuit::RegisteredClaims

pub struct RegisteredClaims {
    pub issuer: Option<StringOrUri>,
    pub subject: Option<StringOrUri>,
    pub audience: Option<SingleOrMultiple<StringOrUri>>,
    pub expiry: Option<Timestamp>,
    pub not_before: Option<Timestamp>,
    pub issued_at: Option<Timestamp>,
    pub id: Option<String>,
}

Registered claims defined by RFC7519#4.1

Fields

issuer: Option<StringOrUri>

Token issuer. Serialized to iss.

subject: Option<StringOrUri>

Subject where the JWT is referring to. Serialized to sub

audience: Option<SingleOrMultiple<StringOrUri>>

Audience intended for the JWT. Serialized to aud

expiry: Option<Timestamp>

Expiration time in seconds since Unix Epoch. Serialized to exp

not_before: Option<Timestamp>

Not before time in seconds since Unix Epoch. Serialized to nbf

issued_at: Option<Timestamp>

Issued at Time in seconds since Unix Epoch. Serialized to iat

id: Option<String>

Application specific JWT ID. Serialized to jti

Methods

impl RegisteredClaims[src]

pub fn validate_claim_presence(
    &self,
    options: ClaimPresenceOptions
) -> Result<(), ValidationError>
[src]

Validates that the token contains the claims defined as required

pub fn validate_exp(
    &self,
    validation: Validation<TemporalOptions>
) -> Result<(), ValidationError>
[src]

Validates that if the token has an exp claim, it has not passed.

pub fn validate_nbf(
    &self,
    validation: Validation<TemporalOptions>
) -> Result<(), ValidationError>
[src]

Validates that if the token has an nbf claim, it has passed.

pub fn validate_iat(
    &self,
    validation: Validation<(Duration, TemporalOptions)>
) -> Result<(), ValidationError>
[src]

Validates that if the token has an iat claim, it is not in the future and not older than the Duration

pub fn validate_aud(
    &self,
    validation: Validation<StringOrUri>
) -> Result<(), ValidationError>
[src]

Validates that if the token has an aud claim, it contains an entry which matches the expected audience

pub fn validate_iss(
    &self,
    validation: Validation<StringOrUri>
) -> Result<(), ValidationError>
[src]

Validates that if the token has an iss claim, it matches the expected issuer

pub fn validate(
    &self,
    options: ValidationOptions
) -> Result<(), ValidationError>
[src]

Performs full validation of the token according to the ValidationOptions supplied

First it validates that all claims marked as required are present Then it validates each claim marked to be validated if they are present in the token (even those that are not marked as required, but are present).

Trait Implementations

impl PartialEq<RegisteredClaims> for RegisteredClaims[src]

impl Default for RegisteredClaims[src]

impl Clone for RegisteredClaims[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for RegisteredClaims[src]

impl Debug for RegisteredClaims[src]

impl Serialize for RegisteredClaims[src]

impl<'de> Deserialize<'de> for RegisteredClaims[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]