Skip to content

Make sure verification URL is generated correctly#682

Merged
tilen1976 merged 15 commits into
mainfrom
feat/tracking-changes-accepts-forwarded-host
Jul 2, 2026
Merged

Make sure verification URL is generated correctly#682
tilen1976 merged 15 commits into
mainfrom
feat/tracking-changes-accepts-forwarded-host

Conversation

@tilen1976

@tilen1976 tilen1976 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Background

While implementing Klass in SSB Dataportal, it was discovered that the pattern used for generating email subscription verification links relied on the host from the incoming request. This resulted in verification URLs using internal hosts such as http://klass/, which made it impossible to verify subscriptions.

Change

Replace the use of WebMvcLinkBuilder with UriComponentsBuilder when generating subscription verification and unsubscribe URLs.

WebMvcLinkBuilder is useful for generating dynamic HATEOAS links based on the current request context. However, for links sent by email, the host should always resolve to the public environment URL. The new implementation generates URLs using the configured public base URL, ensuring that verification links always point to the correct public endpoint (data.ssb.no or data.test.ssb.no).

Additional changes

  • Added support for testing email verification flow using the mock mail server in the Klass API Docker Compose setup.
  • Added inbound rules for the SSB Dataportal in Klass api development manifest

Result

Users now receive valid verification links that resolve to the public Klass endpoints, allowing email subscription verification to work correctly across environments.

@tilen1976 tilen1976 changed the title Make sure verifying url is correct Make sure verification URL is generated correctly Jul 2, 2026
@tilen1976 tilen1976 marked this pull request as ready for review July 2, 2026 12:17
@tilen1976 tilen1976 requested a review from a team as a code owner July 2, 2026 12:17
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@Jorgen-5 Jorgen-5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@tilen1976 tilen1976 merged commit 6ccb552 into main Jul 2, 2026
4 checks passed
@tilen1976 tilen1976 deleted the feat/tracking-changes-accepts-forwarded-host branch July 2, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants