You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a change in the 2.10.0 update where passing None to the algorithm parameter in jwt.encode() would result in the algoritm_ class member being set to "HS256" instead of "none".
After investigating, I found that pyjwt sets the algorithm to "HS256" when I set it to None, where before it was set to "none". This means I need to specify algorithm="none" for the test to pass.
Conclusion
I think this change from jwt.encode(..., algorithm=None) to jwt.encode(..., algorithm="none") is a lot less intuitive. If HS256 is going to be a default that's applied when algorithm is specified as None, I think this should also be documented.
The text was updated successfully, but these errors were encountered:
After investigating, I found that pyjwt sets the algorithm to "HS256" when I set it to None, where before it was set to "none". This means I need to specify algorithm="none" for the test to pass.
I ran into the same issue. This is effectively a breaking change that should have been shipped with a major version bump.
There was a change in the 2.10.0 update where passing
None
to thealgorithm
parameter injwt.encode()
would result in thealgoritm_
class member being set to "HS256" instead of "none".File: jwt/api_jws.py:118-124
Expected Result
I have a test where I run something like:
This test used to pass with pyjwt version 2.9.0.
Actual Result
After the update to 2.10.0 this test fails.
After investigating, I found that pyjwt sets the algorithm to "HS256" when I set it to
None
, where before it was set to "none". This means I need to specifyalgorithm="none"
for the test to pass.Conclusion
I think this change from
jwt.encode(..., algorithm=None)
tojwt.encode(..., algorithm="none")
is a lot less intuitive. If HS256 is going to be a default that's applied when algorithm is specified asNone
, I think this should also be documented.The text was updated successfully, but these errors were encountered: