[316] Serve published dashboards at a customer subpath - #330
Draft
CarsonDavis wants to merge 1 commit into
Draft
Conversation
6 tasks
Terraform plan preview —
|
Terraform plan preview —
|
CarsonDavis
force-pushed
the
316-dashboard-subpath
branch
from
August 27, 2026 15:42
db6a133 to
1b2ccc3
Compare
This was referenced Aug 27, 2026
CarsonDavis
force-pushed
the
316-dashboard-subpath
branch
from
August 27, 2026 16:15
1b2ccc3 to
9f3ad31
Compare
A customer fronting a published dashboard with their own CloudFront forwards the full path and declares the matched prefix in X-Forwarded-Prefix. The viewer-request Function now validates that header (open-redirect and path-traversal shapes are ignored), strips the prefix from request.uri, and 302-redirects a slash-less entry to its trailing-slash form so relative asset URLs resolve. infrastructure/cloudfront-function.js becomes the deployed source: cfn-template.js reads and templates it at render time instead of carrying a second copy. For that to work every client-side URL under the dashboard must be relative to the document rather than the origin root: the upload route returns the S3 key with no leading slash, the Card adapter and the Configure preview classify that key shape instead of mission-prefixing it, the PDF worker resolves against document.baseURI, LayerGeologic drops its rooted /public, and a static build stops routing tile URLs through the server-side tile proxy. Adds the customer-facing integration contract at docs/infrastructure/serving-a-dashboard-from-your-domain.md.
CarsonDavis
force-pushed
the
316-dashboard-subpath
branch
from
August 27, 2026 18:02
9f3ad31 to
078adc9
Compare
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.
Part of #316 — PR 1 of 3 (with #348 republish stack convergence and #349 cache-control tiering).
Makes a published dashboard work behind a customer CloudFront that forwards a path prefix declared in an
X-Forwarded-Prefixheader — no path configuration on our side, and root-served dashboards are unaffected.no-store, and passes headerless direct requests through untouched. Now single-sourced frominfrastructure/cloudfront-function.js, which the template generator reads at publish time./assets/...values rebased on read. A cross-check test pins the classifier regex identical across the two bundles.../..tile/viewer climbs that escape the prefix./configure/with a trailing slash), and the duplicated static-path ternary inViewer_.jsis extracted to one helper.docs/infrastructure/serving-a-dashboard-from-your-domain.mdis the one-page contract for whoever points a CloudFront at a dashboard, linked from both infrastructure READMEs.Verification: 1565 unit tests green (rebased onto current development) plus the playwright e2e leg; earlier local smoke harness served the real staged bucket layout behind the actual function code under a prefix — 147 browser requests, zero prefix escapes.
Note: this serves newly published dashboards behind a prefix. Existing dashboards pick up the new edge function via #348.