PreviewBanner: approval-key gating, drop PR/GitHub surface - #7
Merged
Merged
Conversation
….meta.env Vite only exposes .env-file vars and PUBLIC_-prefixed shell vars on import.meta.env, so the PLIOSOFT_PREVIEW_* variables the sites-app build pipeline passes through the environment were always undefined and the banner silently rendered nothing on every preview deploy. Frontmatter executes in Node at build time (static output), so process.env sees them. Verified against a real customer site build: banner + JWT now bake into preview HTML; production builds (vars unset) still emit nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Approve/Reject now render only when the page URL carries the approval key (?k=...) from the link Pliosoft Sites shared with the customer; the key is forwarded as form data next to the JWT for server-side verification. Visitors who merely guess the preview hostname get a view-only banner, and without JavaScript the banner stays view-only. The banner also stops speaking GitHub: no PR number, branch, sha, or repository link — just the change description. Reviewers see a Pliosoft surface, not a pull request. Companion change in pliosoft/sites-app verifies k server-side and appends it to shared preview URLs. Bump to 0.3.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pproval-key # Conflicts: # package-lock.json # package.json
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.
What
?k=from the page URL, fills a hiddenkform field, and unhides the actions. Withoutk(or without JavaScript) the banner is view-only ("You're viewing a preview of a proposed change."). The orchestrator verifieskserver-side regardless — hiding is UX, the server is the gate.PR #nfallback title. The banner shows only the change description. Customer-facing surfaces shouldn't advertise the repo.Companion
pliosoft/sites-app adds server-side
kverification on/_preview/approve|rejectand appends?k=to shared preview URLs (slug-scopedHMAC(PREVIEW_JWT_SECRET, "preview-approval:" + slug)). Deploy order is safe either way: old banner + new orchestrator → clear error page on action; new banner + old orchestrator →kignored.Verified against a real customer-site build: actions hidden by default, script present, zero
github.com/branch/sha strings in output; production builds (vars unset) still emit nothing.🤖 Generated with Claude Code