Skip to content

feat: Manage a custom list of audit target URLs#2142

Merged
slitviachenko merged 6 commits intomainfrom
SITES-42547-Manage-a-custom-list-of-audit-target-URLs
Apr 8, 2026
Merged

feat: Manage a custom list of audit target URLs#2142
slitviachenko merged 6 commits intomainfrom
SITES-42547-Manage-a-custom-list-of-audit-target-URLs

Conversation

@slitviachenko
Copy link
Copy Markdown
Contributor

  • Bumped @adobe/spacecat-shared-data-access dependency to version ^3.45.0 in package.json and package-lock.json.
  • Introduced auditTargetURLsPatchGuard to validate and normalize audit target URLs in site configurations.
  • Updated SitesController to utilize the new validation logic when updating site configurations.

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description. Or if there's no issue created, make sure you
    describe here the problem you're solving.
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

If the PR is changing the API specification:

  • make sure you add a "Not implemented yet" note the endpoint description, if the implementation is not ready
    yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
  • make sure you add at least one example of the request and response.

If the PR is changing the API implementation or an entity exposed through the API:

  • make sure you update the API specification and the examples to reflect the changes.

If the PR is introducing a new audit type:

  • make sure you update the API specification with the type, schema of the audit result and an example

Related Issues

https://jira.corp.adobe.com/browse/SITES-42547

Thanks for contributing!

- Bumped `@adobe/spacecat-shared-data-access` dependency to version ^3.45.0 in `package.json` and `package-lock.json`.
- Introduced `auditTargetURLsPatchGuard` to validate and normalize audit target URLs in site configurations.
- Updated `SitesController` to utilize the new validation logic when updating site configurations.
@slitviachenko slitviachenko self-assigned this Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@slitviachenko slitviachenko requested a review from nitinja April 6, 2026 20:43
if (url.protocol !== 'https:') {
return { ok: false, error: 'URL must use HTTPS' };
}
if (siteHostname && url.hostname !== siteHostname) {
Copy link
Copy Markdown
Member

@nitinja nitinja Apr 6, 2026

Choose a reason for hiding this comment

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

Hostname check -> following case comes to mind

Example: In https://www.example.com
Protocol: https://
Hostname: www.example.com

but the page user entered could be blog.example.com/page -> thats sounds like a valid page, but fails this check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nitinja , I believe we need to onboard blog.example.com separately, as technically it may be running on a different tech stack, such as EDS vs AEMaaCS, etc.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

This PR will trigger a minor release when merged.

@slitviachenko slitviachenko requested a review from nitinja April 7, 2026 17:36
- Introduced `MAX_MANUAL_AUDIT_TARGET_URLS` constant to limit the number of manual audit target URLs to 500.
- Added `normalizeHostnameForAuditTargetMatch` function to standardize hostname comparisons by lowercasing and stripping leading `www.`.
- Updated `validateAuditTargetUrlString` to utilize the new normalization function for hostname checks.
- Enhanced error messages to clarify hostname matching requirements.
- Added tests for the new normalization function and updated validation logic to ensure compliance with the new limits and behaviors.
@slitviachenko slitviachenko merged commit 6103477 into main Apr 8, 2026
19 checks passed
@slitviachenko slitviachenko deleted the SITES-42547-Manage-a-custom-list-of-audit-target-URLs branch April 8, 2026 17:52
solaris007 pushed a commit that referenced this pull request Apr 8, 2026
# [1.424.0](v1.423.0...v1.424.0) (2026-04-08)

### Features

* Manage a custom list of audit target URLs ([#2142](#2142)) ([6103477](6103477))
@solaris007
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.424.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants