-
Notifications
You must be signed in to change notification settings - Fork 0
Add: clear user password history #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds an endpoint for clearing user password history, accessible only to administrators, as part of task 523. Additionally, it fixes a bug where user password history was not being populated correctly.
Key changes:
- New
/user/password_history/clear/{user_name}endpoint with admin-only access - Bug fix: Added
attributes.flag_modified()call to ensure password history updates are persisted - New
USER_CLEAR_PASSWORD_HISTORYauthorization rule added to Domain Admins role
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/api/password_policy/user_password_history_router.py |
Implements new router with clear endpoint for password history |
app/api/password_policy/adapter.py |
Adds UserPasswordHistoryResetFastAPIAdapter for the new endpoint |
app/ldap_protocol/policies/password/use_cases.py |
Implements UserPasswordHistoryUseCases with clear method and permissions |
app/ldap_protocol/policies/password/dao.py |
Fixes password history bug by adding flag_modified call |
app/enums.py |
Adds USER_CLEAR_PASSWORD_HISTORY authorization rule |
app/alembic/versions/a99f866a7e3a_add_user_pwd_reset_permission.py |
Database migration to grant new permission to Domain Admins |
app/ioc.py |
Registers new use cases and adapter in dependency injection container |
app/multidirectory.py |
Includes new router in the application |
app/api/password_policy/__init__.py |
Exports new router |
app/api/__init__.py |
Exports new router |
tests/test_api/test_password_policy/test_user_password_history_router.py |
Tests for the new clear endpoint |
tests/test_api/test_password_policy/conftest.py |
Test fixtures for the new use cases |
interface |
Subproject commit update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ory_reset_task_523
Добавить ручку для очистки истории паролей пользователя. Ручка должна быть доступна только админам.
Допом исправил баг, когда история пользовательских паролей не наполнялась.
Задача: 523