Open jordan-dimov opened 3 years ago
Hi @jordan-dimov I was following this issue as I am dealing with edge devices and this is definitely an issue at the moment. Did you close because you found a workaround? If so, could you share?
@Minipada Oh, good to know it's not just me. I thought maybe I wasn't using it correctly. Ended up creating a fake Cognito class just for my unit tests, and switching between those with an environment variable. Happy to re-open this though.
I've faced with the same issue trying to write unittests using moto
to fake Cognito resources. And in my case there is no straightforward way to pre-configure environment variable, since I create AWS Cognito resources using fixtures (pytest). Any good ideas how to overcome this?
I have faced the same issue and found a good solution mentioned on another issue here: https://github.com/tokusumi/fastapi-cloudauth/issues/32
Because of code like
jwks = JWKS.fromurl(url)
in the__init__()
, it is impossible to import modules without them trying to connect to AWS Cognito at import time. This can cause a variety of problems, e.g. - unable to run unit tests without an Internet connection.