Open awoimbee opened 4 days ago
Caused by #970 that replaced list
by Sequence
in isinstance
.
>>> from collections.abc import Sequence
>>> isinstance("bugged", list)
False
>>> isinstance("bugged", Sequence)
True
@awoimbee I can confirm this issue as well!
Out of curiosity, what Python version are you using? It seems that this may also be tied to Python version when testing with PyJWT==2.10.0
.
For example: the expected InvalidTokenError
exception is raised when using 3.12.4
but not on 3.12.7
.
# Raises InvalidTokenError
Python 3.12.4
# Does not raise InvalidTokenError
Python 3.12.7
Impacts
2.10.0
, previous release (2.9.0
) is not impacted. Seems like ifissuer
is given as a string then any partial match is allowed.Expected Result
InvalidTokenError
due to badiss
.Actual Result
Token is accepted and decoded :grimacing:
Reproduction Steps
This is incomplete:
Note: this is fixed by replacing
issuer="https://test.example.com/auth"
byissuer=["https://test.example.com/auth"]
(relates to #913).System Information
This command is only available on PyJWT v1.6.3 and greater. Otherwise, please provide some basic information about your system.