pycognito
pycognito copied to clipboard
Cache request to .../.well-known/jwks.json
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?
sure, I'm fine with adding cache for it
This data is cached unless you recreate the Cognito
object each time.
https://github.com/NabuCasa/pycognito/blob/fffafc95e320403f51f65c19e4eb2e67832a8baf/pycognito/init.py#L218-L232