This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I understand that these seem like drastic changes, but this maintains existing functionality, while significantly improving performance. *Removing metadata retrieval in JwtVerifier constructor* The Okta documentation clearly indicates that the keys endpoint is not dynamic (see here: https://developer.okta.com/docs/reference/api/oidc/#keys). Retrieving the metadata every time the model is instantiated is unnessesary network overhead, process latency, and app complexity. There really just isn't a good reason for doing so. In order to preserve backwards compatibility, that request process has been moved into the `getMeaData()` function, and a `@deprecated` tag added. *Adding caching functionality* Okta's own documentation strongly suggests caching the retrieved keys (see https://developer.okta.com/docs/reference/api/oidc/#best-practices). In an effort to improve upon this, you can now pass an implementation of `\Psr\SimpleCache\CacheInterface`. The ttl is hardcoded at 24 hours, though okta suggests caching for up to 90 days. NOTE: If no implemenation is passed, an instance will be created only using an in-memory store that is only valid for the lifecycle of the request. *various code cleanup* - Return types added to modified methods - unused imports removed - removed irrelivent checks in validation methods - bringing in mockery library to facilitate tests - added missing `ext-json` dependency
I understand that these seem like drastic changes, but this maintains existing functionality, while significantly improving performance. *Removing metadata retrieval in JwtVerifier constructor* The Okta documentation clearly indicates that the keys endpoint is not dynamic (see here: https://developer.okta.com/docs/reference/api/oidc/#keys). Retrieving the metadata every time the model is instantiated is unnessesary network overhead, process latency, and app complexity. There really just isn't a good reason for doing so. In order to preserve backwards compatibility, that request process has been moved into the `getMeaData()` function, and a `@deprecated` tag added. *Adding caching functionality* Okta's own documentation strongly suggests caching the retrieved keys (see https://developer.okta.com/docs/reference/api/oidc/#best-practices). In an effort to improve upon this, you can now pass an implementation of `\Psr\SimpleCache\CacheInterface`. The ttl is hardcoded at 24 hours, though okta suggests caching for up to 90 days. NOTE: If no implemenation is passed, an instance will be created only using an in-memory store that is only valid for the lifecycle of the request. *various code cleanup* - Return types added to modified methods - unused imports removed - removed irrelivent checks in validation methods - bringing in mockery library to facilitate tests - added missing `ext-json` dependency
0e94091
to
5db544c
Compare
laura-rodriguez
approved these changes
Mar 1, 2022
laurarodriguez-okta
approved these changes
Mar 1, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #94
Resolves #93
I understand that these seem like drastic changes, but this maintains
existing functionality, while significantly improving performance.
Removing metadata retrieval in JwtVerifier constructor
The Okta documentation clearly indicates that the keys endpoint is not
dynamic (see here: https://developer.okta.com/docs/reference/api/oidc/#keys).
Retrieving the metadata every time the model is instantiated is
unnessesary network overhead, process latency, and app complexity.
There really just isn't a good reason for doing so.
In order to preserve backwards compatibility, that request process has
been moved into the
getMeaData()
function, and a@deprecated
tagadded.
Adding caching functionality
Okta's own documentation strongly su