pub struct JwkClient { /* private fields */ }Expand description
§Defaults
- If public keys are older than
auto_refresh_interval, the keys are refreshed before token validation. Defaults to an hour. - Reactively refreshes public keys and retries token validation on validation failure, limited to once per
retry_rate_limit. Defaults to 5 minutes.
Implementations§
Source§impl JwkClient
impl JwkClient
pub fn new( jwks_uri: impl Into<String>, issuer: impl Into<String>, audience: impl Into<String>, ) -> Self
pub fn set_auto_refresh_interval(&mut self, duration: Duration)
pub fn set_retry_rate_limit(&mut self, duration: Duration)
pub async fn validate_token<T>(
&mut self,
token: &str,
) -> Result<JWTClaims<T>, JwkClientErr>where
for<'de> T: Serialize + Deserialize<'de>,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JwkClient
impl RefUnwindSafe for JwkClient
impl Send for JwkClient
impl Sync for JwkClient
impl Unpin for JwkClient
impl UnwindSafe for JwkClient
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