~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A site's page reaches the console without its visitor's session

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:e2e/site-session-2

The e2e flows now check, in Chromium, that a page of a group's site reaches the console without the session of whoever opens it. The site is served at a name beside the console's, as a deployment's group addresses are beside its own name.

Claude Opus 5.5

What changes

The flow "a site's page reaches the console without the session of whoever opens it" (harness/e2e/flows.spec.mjs):

  • Alice publishes, from Hikers' Site settings, a page that asks the host's getViewer with credentials: 'include', then posts a form to /console/logout.
  • The flow records each request the browser sends the console, and the cookie with it, until that post.
  • From the console's own page, getViewer carries her session. From the site's page, neither request does.
  • She is still signed in afterwards.

Where the site is served.

  • harness/e2e/setup.mjs starts a front for Hikers' address at hikers.group-host.internal, beside console.group-host.internal.
  • harness/world.mjs gains siteFront; tlsFront and it share one spawn.
  • harness/tls-proxy.mjs takes an optional name to pass each request on as, here hikers.groups.test, so the host serves the site.
  • resolving maps every name under group-host.internal to this machine, the console's included.

Docs. docs/development.md says what the flows check now, and where the site's front is.

Why

It is the browser-test item of at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzlk7gxpmi3j. The host's tests check that it sends Content-Security-Policy: sandbox. Only a browser shows what that does to the requests a page makes.

The site is same-site with the console in production (riders.groups.example.com beside group.example.com). There a SameSite=Lax cookie goes with any request a page makes to the console, unless the sandbox gives the page an origin of its own. So the front is at a name beside the console's, not under .groups.test, where the browser would never send the cookie anyway.

How it was checked

  • just e2e: all 35 flows pass locally, the new one among them.
  • With the sandbox header taken out of sites::sandboxed by hand, the new flow fails. The site's getViewer request carries group_host_session=…. So the flow catches a site served without its sandbox.

Shortcomings

  • Chromium only. Safari and Firefox are to be checked by hand once deployed, as the issue says.
Approved

The pull adds a Chromium flow that publishes a page to Hikers' site. From the site's origin, that page asks the console for getViewer and then posts a logout form. The flow records each request sent to the console and checks that the page's requests carry no group_host_session cookie, while a request from the console's own page does. It also checks that Alice is still signed in afterwards.

The site gets its own https front at hikers.group-host.internal, beside the console's name. The proxy takes an optional name to pass each request on as, and the resolver rule is widened to *.group-host.internal. docs/development.md is updated to match, as AGENTS.md asks.

I found nothing that must change.

  • SANDBOX in crates/group-host/src/sites.rs includes allow-forms and allow-scripts. The logout post is therefore permitted, so the flow tests the cookie behaviour and not a blocked form.
  • The new teardown kills the site's proxy and then calls w.stop.
  • The Host rewrite in the proxy only applies when a name is given, so the console's front is unchanged.

I did not run the flow. The claim that it fails without the sandbox header rests on the author's note. Whether it runs green in CI is for the e2e check to show.

Merged as 8f2b7a9