pub struct RemoteJwksDecoder { /* private fields */ }Expand description
Remote JWKS decoder. It fetches the JWKS from the given URL and caches it for the given duration. It uses the cached JWKS to decode the JWT tokens.
Implementations§
Source§impl RemoteJwksDecoder
impl RemoteJwksDecoder
pub fn new(jwks_url: String) -> Self
Sourcepub async fn refresh_keys_periodically(&self)
pub async fn refresh_keys_periodically(&self)
Refreshes the JWKS cache periodically.
It runs in a loop and never returns, so it should be run in a separate tokio task
using tokio::spawn. If the JWKS refresh fails after multiple attemps,
it logs the error and continues. The decoder will use the stale keys until the next refresh
succeeds or the universe ends, whichever comes first.
Trait Implementations§
Source§impl From<RemoteJwksDecoder> for Decoder
impl From<RemoteJwksDecoder> for Decoder
Source§fn from(decoder: RemoteJwksDecoder) -> Self
fn from(decoder: RemoteJwksDecoder) -> Self
Converts to this type from the input type.
Source§impl<T> JwtDecoder<T> for RemoteJwksDecoderwhere
T: for<'de> DeserializeOwned,
impl<T> JwtDecoder<T> for RemoteJwksDecoderwhere
T: for<'de> DeserializeOwned,
Auto Trait Implementations§
impl !Freeze for RemoteJwksDecoder
impl !RefUnwindSafe for RemoteJwksDecoder
impl Send for RemoteJwksDecoder
impl Sync for RemoteJwksDecoder
impl Unpin for RemoteJwksDecoder
impl !UnwindSafe for RemoteJwksDecoder
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