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

consent: spaces in plain words, from the page's spaces and spaceHandles

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:consent/spaces

The consent page now says what an app asks of spaces in the same plain words as its other rows, instead of listing raw space: tokens: one row per kind of space, such as "Your Workspace spaces: Read everything in them; add, change and remove notes and tiles; make new ones and change who's in them." A permission set's Details lists its spaces the same way.

Claude Opus 5.5 · high

What changes

Spec. OAUTH-PAGES.md, "Consent": a new row 5, one per space, which is a type, authority and key; tokens naming the same three merge.

  • <Space heading> says whose spaces and which type: "Your Workspace spaces", "@bob.test's …", "Everyone's …", "All your spaces", "Every space you're in", plus named “key” for a given key. The name is the declaration's title, or else the NSID's last segment in words. The owner is the verified handle, or else the DID in <code>.
  • <Space clauses>: read everything, or see what you've written; the writes, said as data rows say them (a type's declared collections for a bare type); and making, changing or deleting spaces.
  • These rows come after Direct messages, and transition:generic doesn't hide them. A set's Details lists its spaces as <h3> and <p>.
  • The plural rule is fixed: reply reads replies and box reads boxes.

OAUTH-SCOPES.md, "On the authorization page", and OAUTH.md: __authorizeData carries spaces (each type's declaration) and spaceHandles (verified handles of the DIDs the scope's own space: tokens name), as the alpha's page does. They are only there when the scope has a space permission, so the main runs' comparisons with the released reference are unchanged. A handle verifies only by DNS and HTTPS, as the alpha checks it.

Harness.

  • Pages run: the harness's lexicon authority now also publishes two space type declarations and a set granting spaces. A flow on the server alone signs in with three space clients and holds the consent view to the spec. The reference keeps no space: tokens, so their token answers would differ.
  • Spaces run: it now compares spaces and spaceHandles with the alpha.
  • A passkey race: a passkey flow's goto now waits for the tab's previous landing at the client to finish. The new flows shifted seed 1 onto that existing race.
  • look.mjs hosts the declarations for space: scopes too.

Server and pages. oauth/page.rs adds the two fields; verified_handle checks by DNS and HTTPS. web/src/lib/scopes.ts builds the space rows and the set's spaces; Grant.svelte draws them.

Why

The consent page showed space: tokens as raw Permission rows. This follows the design chosen from the mocks: plain words, one row per kind of space, no NSIDs or warning box, as the other rows read.

How it was checked

  • The check bites. On the server before this change, the pages run fails on the first spaces flow (the consent list differs), and the spaces run fails on the page data (spaces and spaceHandles missing).
  • It passes after. The pages run (--seed 1) passes, with 3 spaces flows and 36 consent views held to the spec. So does the spaces run.
  • Local gates. just quick and just code pass. cargo test passes for the new oauth::sets::tests::on_the_page.
  • Looked at. Drawn with just look consent, Details open and closed, on desktop light and phone dark (pictures attached), and critiqued by a fresh agent. Its two layout findings were already fixed (replys, an <h3> margin). Its other points are deliberate: a DID shows in place of an owner whose handle doesn't verify, and a token that allows nothing reads "Asks for nothing this server grants.", as a set that grants nothing does.

Shortcomings

  • A verified handle as owner is not checked by any run: no handle in either run's network resolves by DNS or HTTPS, so both sides give {}.
  • An owner whose handle doesn't verify shows as did:plc:…'s Forum board spaces, which reads awkwardly.

spaces-open-phone-dark.png

spaces-closed-desktop-light.png

Approved

This pull changes how the consent page shows space: permissions. Instead of raw Permission rows, it shows one plain-words row per space, merged by type, authority and key. A set's Details lists its spaces the same way. The page's __authorizeData now carries spaces and spaceHandles when the scope has a space permission.

I read all 18 changed files. The spec (OAUTH-PAGES.md, OAUTH-SCOPES.md, OAUTH.md, OAUTH-PERMISSION-SETS.md), the harness's consentRows/spaceRows, and the page's spacesOf/spaceHeading/spaceSentence agree with each other:

  • Defaults: authority self, skey *, and action read/create/update/delete match the scope table.
  • Declared collections: a bare type writes its declaration's collections, but not for *.
  • * collections: a collection that * already covers is not said again.
  • Plurals: the plural rule is the same in the spec, the harness and the page.
  • Owner shown as a DID: this is the only new <code> outside Technical details, and the spec allows it.

Server side. has_space and authorities are tested by on_the_page. verified_handle reaches other hosts only through code that already fetches DID documents and resolves handles (resolve_did, handle_resolves_to), both of which go through the outbound guard and have timeouts.

Harness. The changes only add checks:

  • The spaces run now also compares spaces and spaceHandles against the alpha.
  • The pages run holds three new space clients to the spec, on the server alone, and the spec says why.
  • The passkey goto retry only waits out a navigation that was interrupted. It doesn't loosen what's checked.

Changeset. There is one, written for callers.

One small thing: the doc comment on spaceClients says other's handle "verifies". The spec and the pull body both say no handle in the run verifies, so other shows as its DID. The comment should say that.

When I looked, gates was still running on this head, so this approval doesn't cover it. Merge once it passes.

harness/checks/pages.mjslines 1180 to 1185
/// The clients whose consent views show spaces, `other` the DID of an
/// account of the server, whose handle verifies (spec/OAUTH-PAGES.md, "How
/// it is checked"): a bare type merged with one managing it, another's,
/// every space of each authority, the set granting spaces, a type with a
/// key, collections of another app and `*`, a DID with no handle, and
/// writes with no collection to write.
review.knotless.dev

other is an account of the server, but its handle doesn't verify here: no handle in the run resolves by DNS or HTTPS (spec/OAUTH-PAGES.md, "How it is checked"), so it shows as its DID. The comment should say that, not "whose handle verifies".

All checks have passed

4 passed, 1 skipped

Merged as af59937