Skip to content

Support Cached key set #535

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

Closed
wants to merge 2 commits into from
Closed

Conversation

swiffer
Copy link
Contributor

@swiffer swiffer commented May 14, 2022

This is meant to gather your thoughts on support for cachedKeySets.

Instead of providing an array with keys to jwks and URL could be passed which is then fetched and cached by php-jwt.
Configuration options still TBD.

This functionality has been added to php-jwt in 6.2: firebase/php-jwt#397

The revelant change would be among these lines: https://github.com/cakephp/authentication/pull/535/files#diff-ace0e7f81ad6600f2a672e7393458f22cc0f8c44e69bd76ef9be077e677c14fbR158

@swiffer swiffer force-pushed the cachedKeySet branch 2 times, most recently from 8c6aca1 to ff44a42 Compare May 14, 2022 08:52
@othercorey
Copy link
Member

This needs to be rebased.

@swiffer
Copy link
Contributor Author

swiffer commented May 14, 2022

This needs to be rebased.

Yes, Happy to do that once #507 is merged / decided and 2.x-next Up to date or 3.x ist existing

@othercorey
Copy link
Member

Merged 2.x into 2.next.

@swiffer
Copy link
Contributor Author

swiffer commented May 14, 2022

done - it's still containing the commit of #507

use Psr\Http\Message\ServerRequestInterface;
use RuntimeException;
use stdClass;
use Symfony\Component\Cache\Adapter\Psr16Adapter;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this Symfony adapter? Cake's cache engine are already PSR16 compliant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, php-jwt opted for PSR-6 based Cache. Psr16Adapter returns a PSR6 Cache.
See https://symfony.com/doc/current/components/cache/psr6_psr16_adapters.html#using-a-psr-16-cache-object-as-a-psr-6-cache

Copy link
Member

Choose a reason for hiding this comment

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

Should we write our own adapter instead?

Copy link
Member

Choose a reason for hiding this comment

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

The cake cache adapters already implement the PSR16 interfaces. We could implement a 6 to 16 adapter in cake to avoid adding another medium sized dependency.

@github-actions
Copy link

This pull request is stale because it has been open 30 days with no activity. Remove the stale label or comment on this issue, or it will be closed in 15 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants