Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description:
This pull request addresses several key aspects related to JWT (JSON Web Token) authentication within the project:
Fixing JWT Authentication Handling: In the
jwt_auth/mixins.py
file, I've corrected the exception handling for expired signatures. Previously, it was catchingjwt.ExpiredSignature
, which is incorrect. It should instead catchjwt.ExpiredSignatureError
to handle expired signatures properly.Enhancing JWT Encoding and Decoding: Within the
jwt_auth/utils.py
file, I've made improvements to the JWT encoding and decoding process. Specifically, I've added an additional parameterverify_signature
to the decoding process, which is sourced from the project settings (settings.JWT_VERIFY
). This helps in customizing signature verification based on project requirements.Dependency Update: The
requirements.txt
file has been updated to ensure compatibility with PyJWT versions. The requirement for PyJWT has been relaxed to allow versions up to 2.5.0 (>=1.4.0,<=2.5.0
) to accommodate potential future updates without compromising compatibility.These changes collectively enhance the security and reliability of JWT authentication within the project while ensuring compatibility with the latest PyJWT versions.