Standardize password hashing and introduce configurable hashing for token revocation#967
Open
RinZ27 wants to merge 1 commit intojazzband:masterfrom
Open
Standardize password hashing and introduce configurable hashing for token revocation#967RinZ27 wants to merge 1 commit intojazzband:masterfrom
RinZ27 wants to merge 1 commit intojazzband:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hardcoded MD5 hashing for password comparisons in
REVOKE_TOKEN_CLAIMhas been replaced with a more flexible mechanism. This update introduces a new setting,CHECK_REVOKE_TOKEN_HASH_ALGORITHM, which defaults tomd5to maintain strict backward compatibility for existing tokens. Users can now choose more modern algorithms likesha256orsha512by updating their project settings.Refactoring the internal hashing utility to support multiple algorithms ensures that authentication and token validation remain robust while providing a clear path for modernization. The change impact is localized to:
settings.py: Added default hash configuration.utils.py: Enhanced hashing utility with support for dynamic algorithms.tokens.py,serializers.py,authentication.py: Integrated the configurable hashing logic into core workflows.Existing tests in
tests/test_authentication.pyhave been updated to reflect these changes, ensuring that the revocation check logic continues to function as expected under the new configurable model. This approach avoids breaking current installations while significantly improving the project's extensibility for different hashing standards.