-
Notifications
You must be signed in to change notification settings - Fork 19
[Bug]: Token validator fetches JWKS on every validation #344
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Currently, the Token validator creates a new jwt.PyJWKClient on every validation, causing the JWKS to be fetched on every validation. The jwt.PyJWKClient should be created on init of the TokenValidator and re-used very time so that it can use its internal caching mechanism.
And https://github.com/jpadilla/pyjwt/blob/master/jwt/jwks_client.py#L16 for the cache options.
Steps to Reproduce
- Send a message to the bot
- Bots validates token
- TokenValidator fetches JWKS on every request
Expected Behavior
That it caches the JWKS
Actual Behavior
No caching
SDK Version
2.0.0a20
Python Version
3.14.2
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working