-
-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mypy. Key can be cryptography.hazmat.backends.openssl.rsa._RSAPublicKey not only string #848
Comments
This tripped us up as well. MyPy suggested we pass a string, but the acceptable type depends on the algorithm, as algorith.prepare_key is called. This appears to have been discussed in #605, #602 and the type annotation might have been changed to Any. There is more related work happening in #843 and #845 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
is it fixed now? |
I'll probably try to find some time to work on it, but as I said here #848 (comment), it might be tricky But this is a duplicate, so I think it can be closed |
Summary.
jwt.decode can accept cryptography.hazmat.backends.openssl.rsa._RSAPublicKey or private key or string.
Expected Result
Allow to pass not only string.
Actual Result
Warning from mypy while only string is expected but actually public key is expected.
Reproduction Steps
jwk_set = PyJWKSet.from_json(data)
jwt.decode("", key= jwk_set.keys[0].key);
System Information
The text was updated successfully, but these errors were encountered: