jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
5.05k stars 676 forks source link

Raise exception when required cryptography dependency is missing #963

Closed tobloef closed 1 month ago

tobloef commented 1 month ago

We recently ran into this when deploying an app with Docker. Locally everything worked fine but the dependency was missing in the container's environment. We had seen the note about it in the docs, but (wrongly) assumed that pyjwt would complain if it tried to use the missing dependency.

My hope with this PR is that it might prevent other people from being stuck on this in the future.

tobloef commented 1 month ago

Thanks, can you add a test?

Done!