Struct compact_jwt::jwt::Jwt
source · pub struct Jwt<V>where
V: Clone,{
pub iss: Option<String>,
pub sub: Option<String>,
pub aud: Option<String>,
pub exp: Option<i64>,
pub nbf: Option<i64>,
pub iat: Option<i64>,
pub jti: Option<String>,
pub extensions: V,
pub claims: BTreeMap<String, Value>,
}
Expand description
A Jwt that is being created or has succeeded in being validated
Fields§
§iss: Option<String>
The issuer of this token
sub: Option<String>
Unique id of the subject
aud: Option<String>
client_id of the oauth2 rp
exp: Option<i64>
Expiry in utc epoch seconds
nbf: Option<i64>
Not valid before.
iat: Option<i64>
Issued at time.
jti: Option<String>
– not used.
extensions: V
If you wish to include extensions as a struct, you can use this struct. If you do
not have extensions, set this type to () with Jwt<()>
and it will be skipped.
claims: BTreeMap<String, Value>
Arbitrary custom claims can be inserted or decoded here. These allow you to add or detect other claims that may or may not be in your extension struct
Trait Implementations§
source§impl<'de, V> Deserialize<'de> for Jwt<V>where
V: Clone + Deserialize<'de>,
impl<'de, V> Deserialize<'de> for Jwt<V>where
V: Clone + Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<V> JwsSignable for Jwt<V>
impl<V> JwsSignable for Jwt<V>
source§fn data(&self) -> Result<JwsCompactSign2Data, JwtError>
fn data(&self) -> Result<JwsCompactSign2Data, JwtError>
Retrieve the inner data from the Jws that is to be signed.
source§fn post_process(&self, jwsc: JwsCompact) -> Result<Self::Signed, JwtError>
fn post_process(&self, jwsc: JwsCompact) -> Result<Self::Signed, JwtError>
After the signature is complete, allow post-processing of the compact jws
Auto Trait Implementations§
impl<V> Freeze for Jwt<V>where
V: Freeze,
impl<V> RefUnwindSafe for Jwt<V>where
V: RefUnwindSafe,
impl<V> Send for Jwt<V>where
V: Send,
impl<V> Sync for Jwt<V>where
V: Sync,
impl<V> Unpin for Jwt<V>where
V: Unpin,
impl<V> UnwindSafe for Jwt<V>where
V: UnwindSafe,
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