Repository navigation
feat: sign-in handoff page for private.nemar.org - #396
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
36216d7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://38f39a02.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-private-site-authori.nemar-website.pages.dev |
Contributor
Author
|
Review record. An independent review pass on e849236 (security first, all lenses; probes against the production build under
Kept by design: the |
neuromechanist
added a commit
that referenced
this pull request
Oct 1, 2026
Open PR #396 already adds ADR 0021. Also correct two claims the review found overstated: the page reads approval_in_flight, and its copy names GitHub Actions.
…te-authorize # Conflicts: # .context/decisions/README.md
5 of 10 tasks
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.
Adds
/auth/private/authorize, the middle hop of the sign-in handoff toprivate.nemar.org, NEMAR's site for access-controlled features. The private site sends a visitor without a session there to this page with astateit generated; the page proves the visitor is signed in, asks the backend for a one-time code bound to thatstate(POST /auth/private/grant, nemarOrg/nemar-cli#1577), and redirects to the private site's callback with the code.What the page does
statefirst (32 to 256 base64url characters); a missing or malformed value gets a 400 panel before anything else runs.Allow: GETbefore anything is read or minted./loginwith a return address rebuilt from the validatedstate.stateunchanged in the grant body only, with the visitor's cookie and a pinnedOrigin, and never follows a redirect on that call; the callback URL carries the code alone, never thestate(the private site keeps its own return path), and nothing logs the query string.PRIVATE_SITE_BASE(an https origin on a nemar.org host, no credentials, normalized to its origin), defaulting tohttps://private.nemar.orgonly when the API is production; any other deployment without the setting refuses with 501 before minting a code.Cache-Control: no-store,Referrer-Policy: no-referrerandX-Robots-Tag: noindex; the middleware keeps a page-setno-referrerinstead of overwriting it with the site-wide policy, whatever spelling of the path reached the page (ADR 0021).Contract
test/private-site-contract-drift.test.tscompares the authorize path, thestateparameter name and the callback path against nemar-cli'sshared/contract/private-site.tsondev, and checks the page file exists at the path the contract names; CI adds that file to its sparse checkout and runs the test in strict mode.Staging
deploy-test.ymlsetsPRIVATE_SITE_BASE=https://private-test.nemar.orgat build time; the value is inlined into the worker bundle, sowrangler.test.tomlcarries it for reference only.Deploy order
The backend side (
POST /auth/private/grant) is already on nemar-clidevand deployed to the dev API; this page can ship to staging independently. The private site consumes this page later; until it exists nothing sends visitors here.Testing
bun run test: 2767 passed, 3 skipped (drift test, no local contract); 2770/2770 with the nemar-clidevcontracts in strict modebun run lintcleanbun run typecheck: 0 errorsbun run buildsucceeds;PRIVATE_SITE_BASEis inlined when set and absent when unsetwrangler pages dev: all path spellings keepno-referrer, non-GET methods get 405, other routes keep the site-wide policy