feat: add password change endpoint with complexity validation#550
feat: add password change endpoint with complexity validation#550kaifcodec wants to merge 7 commits intothe-momentum:mainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@KaliszS Backend is complete. I'm ready to implement the Change Password UI. |
|
@KaliszS I've addressed the CI failures and the requested changes:
I've verified this in a clean environment and all 35 tests in test_auth.py are now passing. @farce1 Any update on the frontend directory? Should I go ahead with src/components/settings/security/? The backend is ready for another look! |
|
Regarding the directory in frontend, you can go ahead with We will anyway need to clean up/restructure the |
KaliszS
left a comment
There was a problem hiding this comment.
There are more things to improve (like JSONResponse in new endpoint with 200/204 status code response or SecretStr instead of str in pydantic model's password fields), but those issue exist in other parts of the same module, so it's something we need to fix in separate PR imho anyway.
|
@KaliszS I've pushed the updates to align with your feedback:
Let me know if there's anything else in the backend that needs adjustment before I move to the frontend. |
This PR implements the backend logic and comprehensive testing for the "Change Password" feature in the Developer Panel. It includes custom validation for password complexity and secure verification of the current password.
Changes Made:
developer.py):PasswordChangemodel.field_validatorto ensure a mix of letters and numbers (min 8 characters).model_validatorto ensurenew_passwordandconfirm_passwordmatch.auth.py):POST /change-passwordendpoint.current_passwordbefore permitting changes.developer_service.update_developer_infoto handle automatic password hashing.test_auth.py):TestChangePasswordclass.To-Do
Closes #531