pycognito icon indicating copy to clipboard operation
pycognito copied to clipboard

Cache request to .../.well-known/jwks.json

Open Quasarman opened this issue 1 year ago • 1 comments

Would it make sense to cache requests made to https://cognito-idp.{aws-region}.amazonaws.com/{user-pool-id}/.well-known/jwks.json since otherwise we would always make an request to get basically static data.

I know about the env variable COGNITO_JWKS but it does not feel right to hardcode this information inside an env variable. Ofcourse I could implement the caching outside of the Cognito class und set the env variable but why not have it directly inside instead?

Quasarman avatar Jun 03 '23 08:06 Quasarman

sure, I'm fine with adding cache for it

pvizeli avatar Jun 05 '23 14:06 pvizeli

This data is cached unless you recreate the Cognito object each time. https://github.com/NabuCasa/pycognito/blob/fffafc95e320403f51f65c19e4eb2e67832a8baf/pycognito/init.py#L218-L232

ludeeus avatar May 13 '24 13:05 ludeeus