Feature: Forgot password
Description
This PR adds the functionality to reset password for a user by email.
8 Global settings:
| Category | Type | Name | Default value | Description | Dynamic |
|---|---|---|---|---|---|
| Advanced | Long | password.reset.ttl |
30 | Password reset ttl in minutes | Yes |
| Advanced | String | password.reset.email.sender |
null |
Password reset email sender | Yes |
| Advanced | String | password.reset.smtp.host |
null |
Password reset smtp host | No |
| Advanced | Integer | password.reset.smtp.port |
25 | Password reset smtp port | No |
| Advanced | Boolean | password.reset.smtp.useAuth |
False |
Use auth for smtp in Password reset | No |
| Advanced | String | password.reset.smtp.username |
null |
Password reset smtp username | No |
| Secure | String | password.reset.smtp.password |
null |
Password reset smtp password | No |
| Advanced | String | password.reset.mail.template |
Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{reset_link}}}\nIf you did not request a password reset, please ignore this email.\n\nRegards,\nThe CloudStack Team | Password reset mail template. This uses mustache template engine. Available variables are: username, firstName, lastName, resetLink, token | Yes |
2 new APIs:
- Command: forgotPassword Params: username, domain Details: Sends an email to the user with a token which can be used to reset the password using resetPassword command.
- Command: resetPassword Params: username, domain, token, password Details: Resets the password for the user using the token generated via forgotPassword command.
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [x] Minor
Screenshots (if appropriate):
How Has This Been Tested?
- Setup a mailserver or for testing purposes use the below command to setup maildev using docker
docker run -d -p 1080:1080 -p 1025:1025 maildev/maildev
- Update the above global settings to point the smtp host to the above docker container and restart the management server.
- Ensure an email is set for the test user
- In UI, click on forgot password and enter details.
- maildev runs a web ui to view all emails being sent. Open maildev's UI which is running on port 1080 and see if there are any emails.
- There should be an email from cloudstack to reset the password for the user. Click on the link in the email to reset the password or copy the token.
- Open the link in the email or navigate to
{ACS MS}/user/resetPasswordon the UI. - Enter the details along with token from the email. Set the new password.
- Try login with the newly set password.
How did you try to break this feature and the system with this change?
Codecov Report
Attention: Patch coverage is 28.30769% with 233 lines in your changes missing coverage. Please review.
Project coverage is 15.76%. Comparing base (
8c8d115) to head (b3ffbf3). Report is 15 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9509 +/- ##
===========================================
Coverage 15.76% 15.76%
- Complexity 12510 12524 +14
===========================================
Files 5621 5627 +6
Lines 491469 491884 +415
Branches 62967 60293 -2674
===========================================
+ Hits 77460 77544 +84
- Misses 405553 405878 +325
- Partials 8456 8462 +6
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.03% <ø> (-0.02%) |
:arrow_down: |
| unittests | 16.58% <28.30%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@blueorangutan package
@vishesh92 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 10631
@blueorangutan test
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-11068) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 53619 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9509-t11068-kvm-ol8.zip Smoke tests completed. 138 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_01_redundant_vpc_site2site_vpn | Failure |
457.46 | test_vpc_vpn.py |
| test_01_vpc_site2site_vpn | Failure |
320.12 | test_vpc_vpn.py |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package
@vishesh92 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 10773
@blueorangutan package
@vishesh92 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 10828
@blueorangutan package
@vishesh92 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 10878
@blueorangutan package
@vishesh92 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 10925
@blueorangutan package
@vishesh92 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 10963
@blueorangutan package
@vishesh92 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 10966
@blueorangutan package
@vishesh92 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 10970
@blueorangutan package