Repository navigation
Feature/password validation 790 - #1082
Open
aarushii25 wants to merge 8 commits into
Open
aarushii25 wants to merge 8 commits into
aarushii25 wants to merge 8 commits into
Conversation
✅ Deploy Preview for bibliodrift-dm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
|
@aarushii25 pr is not ready for merge yet... pls:
|
aarushii25
force-pushed
the
feature/password-validation-790
branch
from
May 29, 2026 08:25
0401974 to
ce79680
Compare
Author
|
Thanks for the review! I've made all the requested changes and successfully resolved the merge conflicts: Added missing file: Created the vault-author-fix.js file. Cleaned up UI: Verified auth.html and ensured only the new password strength UI remains. Removed Dead Code: Completely removed the require_strong_password middleware and its imports from app.py since Pydantic handles validation now. The PR is ready for another review. Let me know if anything else is needed! |
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.
Hey @devanshi14malhotra! I've implemented the strong password validation system as discussed in Issue #790. Here's a detailed breakdown of everything that was done:
📋 What Was Done
This PR adds a complete password validation system with both frontend real-time feedback and backend enforcement — so weak passwords are blocked at every layer.
🗂️ Files Changed
New Files:
frontend/js/passwordValidator.js— Reusable validation utility with 5 password rules and strength scoringfrontend/js/authValidator.js— Wires up real-time UI (strength bar, checklist, submit button toggle) on the auth pageModified Files:
backend/validators.py— Addedvalidate_password_strength()function and integrated it intoRegisterRequestvia Pydantic'sfield_validatorso weak passwords are rejected before any business logic runsbackend/middleware.py— Addedrequire_strong_passworddecorator as a second layer of backend defencebackend/app.py— Applied@require_strong_passworddecorator to the/api/v1/registerroutefrontend/pages/auth.html— Added strength bar, strength label, and checklist UI elements (already present)frontend/css/style.css— Added password strength styles (already present)tests/test_validation.py— Addedtest_password_strength()andtest_register_password_integration()with 19 test cases✅ Password Rules Enforced
password❌ →passwords✅secure@1❌ →Secure@1✅SECURE@1❌ →Secure@1✅Secure@!❌ →Secure@1✅Secure123❌ →Secure@123✅🎯 How It Works
Frontend:
Backend:
RegisterRequestPydantic model validates password strength before any DB operationrequire_strong_passwordmiddleware decorator provides a second layer of protection{"error": "Password does not meet security requirements", "requirements": [...]}🧪 Tests Added
Run with:
cd backend python tests/test_validation.py10 unit tests for
validate_password_strength()covering boundary cases, empty strings, missing rules etc.9 integration tests for
RegisterRequestcovering strong/weak password combinations.🔗 Related
Closes #790
Let me know if any changes are needed! Happy to update anything. 🙌