Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Nov 14, 2025

Description

This PR fixes the url in password reset email. (regression from #11379)

Fixes #12050

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • 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
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (e90e31d) to head (8c22f84).

Files with missing lines Patch % Lines
.../cloudstack/user/UserPasswordResetManagerImpl.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #12078   +/-   ##
=========================================
  Coverage     17.56%   17.56%           
  Complexity    15538    15538           
=========================================
  Files          5909     5909           
  Lines        529099   529102    +3     
  Branches      64623    64624    +1     
=========================================
+ Hits          92913    92914    +1     
- Misses       425732   425734    +2     
  Partials      10454    10454           
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.62% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot finished reviewing on behalf of sureshanaparti November 14, 2025 07:42
Copy link
Contributor

Copilot AI left a 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 fixes a regression in the password reset email URL functionality introduced in PR #11379. The URL construction was broken because the domain URL was being included twice in the email template.

Key changes:

  • Consolidated URL construction logic to build the complete reset link in code rather than in the email template
  • Added fallback to use ManagementServerAddresses when UserPasswordResetDomainURL is not configured
  • Added trailing slash removal to ensure clean URL formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15767

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks generally good, one question.

if (StringUtils.isBlank(domainUrl)) {
domainUrl = ManagementServerAddresses.value().split(",")[0];
}
domainUrl = domainUrl.trim().replaceAll("/+$", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Contributor Author

@sureshanaparti sureshanaparti Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes @DaanHoogland , in case the domain url setting has value like "https://xyz.com/" , trail / are not needed as it's considered while formatting the reset link.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it will not be in the way either, will it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, @DaanHoogland. While the extra / usually won’t cause issues, it could create problems in environments where admins use a reverse proxy with strict access rules for the reset-password URL.

For example, some organization could only allow access to password-reset endpoints from the office network or over the company VPN. This would reduce the attack surface to a very sensitive endpoint that is often forgotten.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14834)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Password Reset Email Template Ignores {{domainUrl}} Variable in CloudStack 4.22]

4 participants