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

consent: spaces said from the account's side, every clause a sentence

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

The consent page's space rows now say what an app may do as you, not the scope word for word, which read like a takeover of everyone's spaces. Every clause of a space or data row is also its own sentence now, with no semicolons. Prompted by opensocial's real scope: "All of @opensocial.opensocial.fyi's spaces: Read everything in them; add, change and remove anything."

Claude Opus 5.5 · high

What changes

Spec (OAUTH-PAGES.md, <Space heading> and <Space clauses>). Each change matches what the server enforces:

  • Headings. A space whose owner is *, or another account, is one "you're in": "Conversation spaces you're in", "@x's spaces you're in", "Every space you're in". The space's own policy still decides who reads it (SPACES-POLICIES.md, "Who is authorized"). self stays "Your … spaces".
  • Writes. They read <Actions> your own <things>, and * is "records of any kind": a write in a space only reaches the caller's own records (SPACES-REPO.md).
  • Managing. For an owner other than self, it reads "Make new ones, and change who's in or delete the ones you made", since only a space's owner can manage it (SPACES-POLICIES.md).
  • Sentences. In space rows and data rows (<Data clauses>), each clause is its own sentence joined with a space: "Add and remove posts. Add, change and remove likes. Add follows."

Harness. spaceRows and the data rows follow the new wording. A spaces client now has an opensocial-like token (owner *, every collection, all three manage operations). The spaces flow waits for "Allow access" after the sign-in's answer, as the view can still be Sign in when the answer arrives.

Pages. web/src/lib/scopes.ts.

How it was checked

  • The check bites. With main's scopes.ts, the pages run (--seed 1) fails: the consent list differs.
  • It passes after. The pages run passes, with 3 spaces flows and 36 consent views held to the spec. just code passes.
  • Looked at. Drawn with just look consent (attached).

Shortcomings

  • "you're in" leaves out public spaces, which can be read without being a member. It slightly understates what the token reaches.
  • An owner with no verified handle still starts a heading as its DID, in <code>.

wording-phone-dark.png

wording-desktop-light.png

Asked for changes

This pull rewrites the consent page's space rows from the account's side. Spaces owned by others now read "you're in", writes read "your own …", and managing reads "the ones you made". Each clause of a space row or data row becomes its own sentence. The spec, harness, pages and changeset all move together, and the harness change makes the check stricter: the new wait for "Allow access" still fails when the view never changes.

The manage wording for an owner that is a particular DID doesn't match what spec/OAUTH-SCOPES.md enforces.

  • Owner *: the manage permission works, and "Make new ones, and change who's in or delete the ones you made" is right.
  • Owner another account's DID: "What it allows" says a permission matches only when its authority is the operation's.
    • createSpace checks manage create against the caller's own DID, so space:…?authority=did:other&manage=create never lets you make anything.
    • updateSpace and deleteSpace check the space's own authority (did:other) and then refuse any caller who isn't that authority. "The ones you made" are under your own DID, so this token doesn't reach them.
    • So for a DID owner, the manage permissions grant nothing.

The harness's third client, space:*?authority=${other}&manage=delete, now has to read "@other's spaces you're in: Delete the ones you made." That promises something the server won't do, and the pull says every change matches what the server enforces.

What to change: for a DID owner, say nothing for manage, so a token that asks only that reads "Asks for nothing this server grants." Keep the "ones you made" wording for * alone. Change it in OAUTH-PAGES.md, spaceRows and scopes.ts together. If the DID is the signed-in account's own, it can be treated as self, but that's optional.

The gates check was still running when I reviewed, so I haven't seen whether it passes.

spec/OAUTH-PAGES.mdlines 378 to 384Outdated
3. its `manage` operations. For `authority` `self`: `make new ones`
(`create`), `change who's in them` (`update`) and `delete them`
(`delete`), in that order, joined as a list. For any other, as only
a space the account owns can be managed (`SPACES-POLICIES.md`):
`make new ones` (`create`); then `change who's in` (`update`) and
`delete` (`delete`), joined as `a` or `a or b`, with ` the ones you
made` after them; the two joined with `, and ` when there are both.
review.knotless.dev

This holds for authority *, but not for a DID. Under OAUTH-SCOPES.md, "What it allows", createSpace checks manage create against the caller's DID, so a permission for did:other never matches it. updateSpace and deleteSpace check the space's own authority and then require the caller to be that authority. So a DID owner's manage grants nothing, and "make new ones" or "the ones you made" overstates it. Say nothing for manage when the owner is a DID.

chadtmiller.com

Right. Item 3 now says manage only for self and *, and nothing for a DID: making a space checks the account's own DID, and changing or deleting one asks the account to be its authority, so a DID's manage reaches no space. A DID-owned token asking only that reads "Asks for nothing this server grants." (e9f31f8)

web/src/lib/scopes.tslines 526 to 532Outdated
} else {
const made = MANAGE_MADE.filter(([m]) => s.manage.has(m)).map(([, said]) => said);
const manage = [
...(s.manage.has('create') ? ['make new ones'] : []),
...(made.length ? [`${made.join(' or ')} the ones you made`] : [])
];
if (manage.length) clauses.push(manage.join(', and '));
review.knotless.dev

This else covers a DID authority too. space:*?authority=did:other&manage=delete reads "Delete the ones you made", but the ones you made are under your DID, which this token doesn't reach. Use this branch only for s.authority === '*'.

chadtmiller.com

Fixed: the "ones you made" branch is for authority === '*' alone, and a DID adds no manage clause. (e9f31f8)

harness/checks/pages.mjslines 269 to 273Outdated
} else {
const made = [['update', "change who's in"], ['delete', 'delete']].filter(([m]) => g.manage.has(m)).map(([, w]) => w)
const parts = [...(g.manage.has('create') ? ['make new ones'] : []), ...(made.length ? [`${made.join(' or ')} the ones you made`] : [])]
if (parts.length) clauses.push(parts.join(', and '))
}
review.knotless.dev

This has the same issue as the spec. The third client in spaceClients (space:*?authority=${other}&manage=delete) now expects "Delete the ones you made." Once the spec is fixed, it should expect nothing to be said for the DID's manage.

chadtmiller.com

Fixed: else if (g.authority === '*'). The third client's space:*?authority=${other}&manage=delete now expects only "Read everything in them." from its default actions. The pages run (--seed 1) passes. (e9f31f8)

Approved

This is round 2. Last time I asked that a DID owner's manage say nothing, and e9f31f8 does that.

  • Spec: spec/OAUTH-PAGES.md, <Space clauses> item 3, now gives the manage wording for self and * only. For a DID it says nothing, and it cites OAUTH-SCOPES.md for why: createSpace checks the caller's own DID, and updateSpace/deleteSpace require the caller to be the space's authority.
  • Harness: spaceRows in harness/checks/pages.mjs uses else if (g.authority === '*').
  • Pages: web/src/lib/scopes.ts does the same, with its comment updated.
  • Result: the third harness client (space:*?authority=${other}&manage=delete) now expects only its read clause, which matches what the server grants. Spec, harness and pages agree again.

Two small leftovers, neither blocking:

  • Changeset: the "Managing" line in .changeset/consent-spaces-wording.md still reads as if every non-self owner gets "the ones you made". Narrowing it to "any owner" would match the spec.
  • Pull body: the "Managing" bullet says the same thing and is now out of date.

On checks at e9f31f8: docs and citations pass, and gates was still running when I looked, so I haven't seen its result.

.changeset/consent-spaces-wording.mdline 11
- **Others' spaces:** where the scope names any owner, or another account, the row is the spaces "you're in", not "Everyone's", as the space itself still decides who gets in.
- **Writes:** these are "your own" records, since a write in a space only ever reaches the writer's own records.
- **Managing:** changing who's in a space or deleting it reads "the ones you made", as only a space's owner can.
review.knotless.dev

Since e9f31f8, a scope naming one particular other account says nothing about managing. Only an any-owner (*) scope reads "the ones you made". Consider: "where the scope names any owner, changing who's in a space or deleting it reads 'the ones you made'…".

All checks have passed

4 passed, 1 skipped

Merged as 9981552