Expand description
JWKS (JSON Web Key Set) fetching and caching.
Provides both synchronous and asynchronous functions to fetch JWKS from a
remote URL. Keys are cached globally in a OnceLock so that multiple
token validations reuse the same key set without redundant HTTP calls.
§Example
use usso::jwks::init_jwks_sync;
init_jwks_sync("https://sso.usso.io/website/jwks.json").unwrap();
let keys = usso::jwks::get_jwk_keys().unwrap();
println!("Loaded {} keys", keys.keys.len());Functions§
- fetch_
jwks_ async - Fetch JWKS from the given URL (async) without caching.
- fetch_
jwks_ sync - Fetch JWKS from the given URL (blocking) without caching.
- get_
jwk_ keys - Get a reference to the globally cached JWKS key set.
- init_
jwks_ async - Fetch JWKS from a URL and store it in the global cache (async).
- init_
jwks_ sync - Fetch JWKS from a URL and store it in the global cache (blocking).