-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Allow enforcing password change for a user after reset by admin (root/domain) #12294
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12294 +/- ##
============================================
+ Coverage 17.46% 17.51% +0.05%
- Complexity 15516 15595 +79
============================================
Files 5913 5915 +2
Lines 529385 529981 +596
Branches 64679 64737 +58
============================================
+ Hits 92448 92821 +373
- Misses 426518 426700 +182
- Partials 10419 10460 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16086 |
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 implements a feature to enforce password changes for normal users after an admin-initiated password reset. When an admin resets a user's password, they can require the user to change it upon next login. The user is then redirected to a forced password change page and has limited API access until the password is updated.
Key Changes:
- Added
passwordChangeRequiredboolean parameter to theupdateUserAPI command, allowing admins to flag users for mandatory password change - Introduced a new UI route
/user/forceChangePasswordwith a dedicated component that restricts users to password change until completed - Implemented navigation guards and API restrictions to limit users to essential APIs (login, logout, updateUser, listUsers, listApis) when password change is required
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
ui/src/views/iam/ForceChangePassword.vue |
New component for forced password change page with form validation and success state |
ui/src/views/iam/ChangeUserPassword.vue |
Added checkbox for admins to require password change on next login |
ui/src/store/mutation-types.js |
Added PASSWORD_CHANGE_REQUIRED constant for state management |
ui/src/store/modules/user.js |
Added state and mutations for password change requirement flag, loads user info with limited APIs when flag is set |
ui/src/store/getters.js |
Added getter for passwordChangeRequired state |
ui/src/permission.js |
Added navigation guards to redirect users to force change password page when required |
ui/src/config/router.js |
Registered new forceChangePassword route under user path |
ui/public/locales/en.json |
Added localization strings for password change UI |
server/src/main/java/com/cloud/user/AccountManagerImpl.java |
Added logic to set/remove passwordChangeRequired user detail, loads user details during authentication |
server/src/main/java/com/cloud/api/query/vo/UserAccountJoinVO.java |
Added passwordChangeRequired field to join view object |
server/src/main/java/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java |
Maps passwordChangeRequired to user response |
server/src/main/java/com/cloud/api/ApiServer.java |
Sets passwordChangeRequired in login session when user detail is present |
plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java |
Restricts API list to essential APIs when user requires password change |
plugins/api/discovery/src/test/java/org/apache/cloudstack/discovery/ApiDiscoveryTest.java |
Updated test setup to mock getUserAccountById method |
engine/schema/src/main/resources/META-INF/db/views/cloud.user_view.sql |
Added LEFT JOIN to user_details table for PasswordChangeRequired value |
engine/schema/src/main/java/org/apache/cloudstack/resourcedetail/UserDetailVO.java |
Added PasswordChangeRequired constant |
api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java |
Added passwordChangeRequired field to user API response |
api/src/main/java/org/apache/cloudstack/api/response/LoginCmdResponse.java |
Added passwordChangeRequired field to login API response |
api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java |
Added passwordChangeRequired parameter to update user command |
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java |
Added PASSWORD_CHANGE_REQUIRED API constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
Outdated
Show resolved
Hide resolved
...ins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/response/LoginCmdResponse.java
Outdated
Show resolved
Hide resolved
...ins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16095 |
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16097 |
…wd flow for passwordchangerequired
api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
Outdated
Show resolved
Hide resolved
...ins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
Outdated
Show resolved
Hide resolved
...ins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
Outdated
Show resolved
Hide resolved
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
Copilot reviewed 21 out of 21 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/api/discovery/src/test/java/org/apache/cloudstack/discovery/ApiDiscoveryTest.java
Show resolved
Hide resolved
...ins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
Show resolved
Hide resolved
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16106 |
|
@blueorangutan test |
|
@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15039)
|
api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/response/LoginCmdResponse.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
vishesh92
left a comment
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.
clgtm
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16154 |
Description
This PR introduces enforcement of password changes for users upon login after an admin-initiated reset.
API changes:
[ "login", "logout", "updateUser", "listUsers", "listApis" ]UI
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Screen.Recording.2025-12-18.at.4.11.45.PM.mov
How Has This Been Tested?
How did you try to break this feature and the system with this change?