Skip to content

Conversation

vishalg0wda
Copy link

  • feat: add caching to JWKs
  • chore: add skipjwkscache option
  • refactor: improve JWKS cache readability with supplier pattern

@vishalg0wda vishalg0wda force-pushed the subomi/feat/add-jwks-caching branch 3 times, most recently from 1d21595 to 8350f96 Compare October 13, 2025 10:36
Refactored the cache-aside pattern in JwtSessionTokenVerifier to use a
more declarative approach with a CheckedSupplier interface. The cache
now transparently handles lookup and population through getOrCompute(),
making the code more readable and maintainable.

Changes:
- Added CheckedSupplier functional interface for exception-safe suppliers
- Updated Cache.getOrCompute() to accept CheckedSupplier for checked exceptions
- Simplified getRemoteJwtKey() to use declarative cache-aside pattern
- Removed manual cache checking and setting logic from fetchAndConvertJwk()
@vishalg0wda vishalg0wda force-pushed the subomi/feat/add-jwks-caching branch from 8350f96 to 29aa1da Compare October 13, 2025 10:37
/**
* Retrieves the RSA public key used to sign the token from Clerk's Backend API.
*
* <p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants