fix(server): auth to da.live preview host for content.da.live images#2754
Merged
Conversation
content.da.live is not publicly reachable for rendering images during local dev, so img src referencing the org/site content store must be rewritten to the aem preview domain. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
content.da.live is auth-gated for images, so local content/ pages need an IMS-authenticated cookie on the site's *.preview.da.live host to render them. Adds a client-side bootstrap that checks for an existing valid cookie/session first, and only then falls back to IMS login (via a dev-server-driven redirect, since the darkalley IMS client only allows its fixed :9898 callback as redirect_uri). Fixes #2752 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CodeQL (js/missing-rate-limiting) flagged /.aem/cli/da-login and /__internal__/da-content-auth.js: both trigger real side effects (an IMS redirect, a live callback server bind on :9898), so cap abuse from a runaway page/script with express-rate-limit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This PR will trigger a patch release when merged. |
Contributor
|
I cannot judge if this is correct. looks way too complicated.... why are the image references on content.da.live ? |
Contributor
Author
This is how DA works today: when you d&d an image inside a "page" document, image is uploaded inside a ".page" folder next to "page" and is referenced via content.da.lve. And yes, it is really complicated. |
tripodsan
previously approved these changes
Jul 8, 2026
…age-urls # Conflicts: # src/server/HelixServer.js
Contributor
|
🎉 This PR is included in version 16.20.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
content.da.liveimage URLs in localcontent/pages are rewritten to the site's*.preview.da.livehost, sincecontent.da.liveis auth-gated and not reachable during local dev./.aem/cli/da-logindev-server route (thedarkalleyIMS client only allows its fixed:9898callback asredirect_uri, so a plain client-sidesignIn()redirects to the wrong place).Fixes #2752
Test plan
npm run linttest/server-utils.test.js— URL rewrite, auth-script injection, probe-path extractiontest/server.test.js—content/ servingandda.live login redirectsuites (redirect validation incl. open-redirect rejection)test/content/da-auth.test.js—startDaLoginRedirectaem content clone+aem upproject (images broken → auth redirect → images load; reload not required after cookie is set)🤖 Generated with Claude Code