pub struct Parser { /* private fields */ }
Expand description
Parse & Validate Google JWT token. Use public key from http(s) server.
Implementations§
Source§impl Parser
impl Parser
pub const GOOGLE_CERT_URL: &'static str = "https://www.googleapis.com/oauth2/v3/certs"
pub fn new(client_id: &str) -> Self
pub fn new_with_custom_cert_url(client_id: &str, public_key_url: &str) -> Self
Sourcepub async fn parse<T: DeserializeOwned>(
&self,
token: &str,
) -> Result<T, ParserError>
pub async fn parse<T: DeserializeOwned>( &self, token: &str, ) -> Result<T, ParserError>
Parse and validate token. Download and cache public keys from http(s) server. Use expire time header for reload keys.
Auto Trait Implementations§
impl !Freeze for Parser
impl !RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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