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

A group's site has no live data, nor a check in Safari and Firefox, yet

Open
Open chadtmiller.com opened this issue 0 comments

What happened

Sites landed in at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzliqhj7d5t2, which closed at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzlhxmmtidqn. What that issue planned and the pull left for later:

  • A browser test (e2e, Chromium) that a site page posting to the console carries no session: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n24zamse44no.
  • Safari and Firefox checked by hand once deployed: a site's page posting to the console carries no session.
  • The console shows a group's site: a link to it, and a way to publish or take it down: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n24yene6smh4.
  • The console's sign-in cookie as __Host-, and an Origin check on every POST a cookie authenticates: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n24z3sqzfbx3.
  • docs/design/sites.md stops saying a page reads live data from the host's public methods: in the console's pull above.
  • Before cutover, the prototype's public pages snapshotted as rendered HTML and published as each group's site (Rainshadow Riders / and /rides; opensocial /, /feed, /tangled, /standard-site-publications; the front pages of Mole People, Portland Cycling Club and Club Penguin), or dropped where they would go stale.

Dropped: answering the public GET methods with Access-Control-Allow-Origin: * so a site page could read them. A spike on just dev (a site asking each method, CORS added by hand) showed what a page nobody signed in to reaches with it: the group's DID, its handle, and its public repo (the site record, the declaration). Not the profile, the rules or the members, even for a listed group, because public means anyone signed in (85e2854). So CORS alone buys a site nothing it doesn't already have, and live data comes through the frame below.

What you expected

Decided while planning sites:

  • Signed out, a group shows only what its pages say. The rule stays: public means anyone with an Atmosphere account. A site's pages are public anyway, since the site record and its files are in the group's public repo. Live group data (profile, rules, members, events) is for someone signed in. A group that wants to be found writes its name and description into its pages; link previews and search see only those.

  • Live data for someone signed in, through a frame the host serves (option B). As the prototype does (~/code/opensocial, docs/design/sites.md, packages/group-sites/src/sitePage.ts), the code holding a visitor's session is the host's, never the group's:

    • at a group's address the host serves one fixed page, an atproto OAuth client of its own (client-metadata.json made per address), around the group's published pages;
    • the pages run sandboxed in frames inside it, and ask for data through a postMessage bridge, the prototype's os contract;
    • the site record declares what its pages read, the bridge refuses anything else, and the client's scopes come from the same declaration;
    • signed out, a read through the bridge comes back locked with "sign in", and the kit leaves that part out.

    The rest stays as it is: the group publishes static files, with no templates and no build. "No rendering on the server" becomes "one fixed page around the group's". It is designed and built after the items above, and before a site on a domain of the group's own (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzysqoksvx7f).

  • Not done: the group's own code as the OAuth client (a site would ask its visitors for whatever scopes it liked), and CORS with credentials on the console's cookie (every site on the host would read every group as its visitor).

Where

The host, the console, and the deploy at next.opensocial.fyi. A dev world opens group sites in a browser at https://<label>.groups.localtest.me (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n24whgwai4du).