feat:add feature to change password for profile as well as user - #524
Conversation
bupd
left a comment
There was a problem hiding this comment.
Overalll LGTM, will give it a hands on review in today's CLI meeting.
bupd
left a comment
There was a problem hiding this comment.
Overalll LGTM, will give it a hands on review in today's CLI meeting.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #524 +/- ##
=========================================
- Coverage 10.99% 7.19% -3.80%
=========================================
Files 173 237 +64
Lines 8671 14217 +5546
=========================================
+ Hits 953 1023 +70
- Misses 7612 13087 +5475
- Partials 106 107 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ChayanDass please do rebase your patch on main branch |
There was a problem hiding this comment.
Pull Request Overview
This PR adds password change functionality for both user profiles and admin-managed users. The implementation provides two distinct workflows: users can change their own passwords by providing their old password, while admins can reset passwords for other users without requiring the old password.
- Adds two password change views with appropriate validation
- Implements API handlers for both user password change and admin password reset
- Creates CLI commands for password management accessible through both profile and user management contexts
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/views/password/reset/view.go | Creates password reset form for admin use (new password + confirmation) |
| pkg/views/password/change/view.go | Creates password change form for user profile (old + new + confirmation) |
| pkg/api/user_handler.go | Adds ResetPassword API function for admin password reset |
| cmd/harbor/root/user/password.go | Implements user password reset command for admins |
| cmd/harbor/root/user/cmd.go | Registers password command under user management |
| cmd/harbor/root/password.go | Implements profile password change command |
| cmd/harbor/root/cmd.go | Registers password command under access group |
|
Hey @bupd, there’s an issue , after changing the password for the current user, all API calls become unauthorized. I’m not sure if we’re sending the username and password from the config file, but if we are, we might need to update the password in the config file as well. |
bupd
left a comment
There was a problem hiding this comment.
@ChayanDass Thanks for you contributions. will review this next week. Please do update the screenshots on the PR description.
|
lint error, other wise looks good |
|
@ChayanDass I believe you need to run |
bupd
left a comment
There was a problem hiding this comment.
@ChayanDass please fix lint issue and make sure CI passes before requesting a review.
|
Hey @bupd, sorry for the earlier review request , I accidentally requested before checking the latest messages. I’ve now fixed the linting issues and updated the docs. Maybe I missed, but I'm not able to find any instructions about the docs at |
|
Then we need to add that to the contributing.md feel free to create an issue. |
Signed-off-by: Chayan Das <01chayandas@gmail.com>

closes #523
password change operation
logs for user password update and own password