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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding cache driver and depricating metadata
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
- Loading branch information
1 parent
cc12ae3
commit ec3c827
Showing
6 changed files
with
118 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
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
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
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