pub struct Validator { /* private fields */ }Expand description
Primary interface used for validating JWTs.
Implementations§
Source§impl Validator
impl Validator
pub async fn new( oidc_issuer: impl AsRef<str>, http_client: Client, cache_strat: Strategy, validation: ValidationSettings, ) -> Result<Validator, FetchError>
Sourcepub async fn validate<T>(
&self,
token: impl AsRef<str>,
) -> Result<TokenData<T>, ValidationError>where
T: for<'de> Deserialize<'de>,
pub async fn validate<T>(
&self,
token: impl AsRef<str>,
) -> Result<TokenData<T>, ValidationError>where
T: for<'de> Deserialize<'de>,
Validates a JWT, Returning the claims serialized into type of T
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Validator
impl !RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl !UnwindSafe for Validator
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