8000 Asynchronous JWKS cache by ItalyPaleAle · Pull Request #107 · auth0/idtoken-verifier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Asynchronous JWKS cache #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 19, 2020
Merged

Conversation

ItalyPaleAle
Copy link
Contributor

Changes

This PR includes the ability to support asynchronous JWKS caches. These are classes in which the has, get, and set methods (see the DummyCache contract) return a Promise. This is backwards-compatible, so the methods can either return a Promise (or, more correctly, a then-able object), or synchronously return a value.

This allows caching JWKS keys that are not synchronously available. For example, it could be possible for the application to request the keys and cache them (maybe even using a service worker).

Testing

Tests have been updated and are passing. Because the patch is backwards-compatible, tests that were not stubbing methods did not require any change. A couple of tests that were stubbing methods required minor tweaks. Additionally, a test has been added to use an asynchronous cache.

  • This change adds test coverage

Checklist

@ItalyPaleAle ItalyPaleAle requested a review from a team June 14, 2020 06:13
@ItalyPaleAle ItalyPaleAle changed the title Patch cache async Asynchronous JWKS cache Jun 14, 2020
Tests should now pass
@adamjmcgrath adamjmcgrath self-assigned this Jun 19, 2020
Copy link
Contributor
@adamjmcgrath adamjmcgrath left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @ItalyPaleAle

@adamjmcgrath adamjmcgrath merged commit f2ab98f into auth0:master Jun 19, 2020
@stevehobbsdev stevehobbsdev added this to the vNext milestone Sep 10, 2020
@stevehobbsdev stevehobbsdev mentioned this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0