-
Notifications
You must be signed in to change notification settings - Fork 236
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
[SDK-1221] Modify Cache Defaults #123
Conversation
cf941c9
to
88f7295
Compare
@@ -14,6 +14,7 @@ describe('JwksClient (cache)', () => { | |||
describe('#getSigningKeys', () => { | |||
it('should prevent too many requests', (done) => { | |||
const client = new JwksClient({ | |||
cache: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the cache was off by default for this test, turning off the cache to not change functionality in this test
88f7295
to
f1a6324
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, the README just needs a little updating for clarity.
README.md
Outdated
@@ -39,15 +39,15 @@ Integrations are also provided with: | |||
|
|||
### Caching | |||
|
|||
In order to prevent a call to be made each time a signing key needs to be retrieved you can also configure a cache as follows. If a signing key matching the `kid` is found, this will be cached and the next time this `kid` is requested the signing key will be served from the cache instead of calling back to the JWKS endpoint. | |||
In order to prevent a call to be made each time a signing key needs to be retrieved a cache is implemented. If a signing key matching the `kid` is found, this will be cached and the next time this `kid` is requested the signing key will be served from the cache instead of calling back to the JWKS endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first sentence reads a bit awkwardly. Perhaps something like By default, signing keys are cached to prevent...
.
f1a6324
to
f1d408c
Compare
- enables cache by default (previously not) - changes cache time from 10h to 10m - updated tests to reflect the intent of the cache
f1d408c
to
17e83df
Compare
Description
In order to allow for better expiration of keys after a signing key rotation the following changes have been made to the cache:
Testing
Updated the tests to more properly reflect the caching mechanism.
Checklist
master