Closed wuhaoyujerry closed 2 years ago
Hi @auvipy, this PR has been approved for a while. Any idea when it can be merged? Let me know if you have any questions.
Thx for merging the PR @auvipy, do you have an estimation time on when the new release will be published? My team want to use some features in the master branch and kinda been blocked right now.
Before releasing this I think we'd need an updated changelog and I think this probably deserves at least some docs.
I can add some docs about this functionality
Is there a timeline for when this feature will be released to production?
I can add some docs about this functionality
Where can the docs be found? Thanks for this feature.
Problem
The current PyJWT library only support caching of single signing key. Ref to https://github.com/jpadilla/pyjwt/pull/611
Even though it avoids the network call when the services periodically calling
get_signing_key
with samekid
, the current implementation doesn't have any TTL, so the cache is stored forever. Also, it still makes network call when differentkid
is provided.Solution & Implantation
JWKSetCache
object that stores jwk set with current timestampkid
from the jwk set, it will make a new network call to get a new jwk set and check again in new set. Raise error if still cannot find the signing key with matching kid.get_signing_key
by default as suggested from this comment https://github.com/jpadilla/pyjwt/pull/611#issuecomment-815807580