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

The OAuth authorization pages as a Svelte app, checked in a browser beside the reference's

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:oauth/pages

The OAuth authorization pages as a Svelte app, built from a new spec page, embedded in pds, and checked in a real browser beside the reference's.

Spec: spec/OAUTH-PAGES.md says what a person sees and does on each view:

  • Views: sign in, email code, choose an account, consent, and the error page.
  • Contracts: every accessible name, alert text and consent sentence, word for word, and the API call each control makes.
  • Consent in plain words: one row for each kind of thing asked, riskiest first, merged so that what a broader scope covers isn't said twice. The words come from the scope alone, so they work for any app's lexicons: apps are named by their NSIDs' domains (app.bsky.feed.post is bsky.app), things by the NSID's last segment, and services by host. No NSID, method or DID appears outside Technical details. Allow and Deny are always in view, and six rows or fewer fit without scrolling, at 360×740 and 1200×900. An app's own words belong to permission sets (include:), a follow-up.
  • Serving: the HTML, its Content-Security-Policy (hashed inline data script, no inline styles) and headers, and the assets at /oauth/assets/<name>, cached as immutable.

Running the pages against the reference changed five behaviours, now in the spec as the reference does them:

  • Back from consent goes to the account list, which lists accounts signed in on the page as well.
  • A login_hint opens Sign in with the identifier read-only, before the account list.
  • Deny sends the ephemeral token.
  • The asset route is one metrics label, /oauth/assets/{name} (spec/OPERATIONS.md).

Pages (web/):

  • Stack: Svelte 5 (runes, TypeScript) and Vite, with no SvelteKit.
  • Layout: components in atomic design's layers, atoms < molecules < organisms < templates, with views filling templates.
  • Styles: every value a token from web/src/tokens.css, light and dark following the browser.
  • Icons: Lucide's.
  • Conventions: web/AGENTS.md and the ui skill (.claude/skills/ui) carry knotless's house rules, the states to look at, and the critique step.
  • Embedding: pds-server's build.rs embeds web/dist, and oauth/assets.rs serves it. The old inline page script is gone.

Harness:

  • compare.mjs --pages: flows from a PAR to the client's redirect URI in Chromium (Playwright), the same on both sides, each choice drawn before either side is driven:

    • signing in, a wrong password, the email code;
    • remembered accounts, login_hint;
    • two tabs of one request;
    • deny, cancel and back.

    It compares each page's API calls, where it landed, and the tokens for its codes. The server alone is held to the rest of the spec: views and words, the consent list, focus, busy buttons, headers and HTML, assets, console, origins asked, width at 360 px, axe-core's WCAG A/AA rules, and the asset route's metrics.

  • layers.mjs and contrast.mjs: the components' layers, and every text colour at 4.5:1 in light and dark. They run in the code gates with svelte-check.

  • look.mjs (just look <state>): draws any view as pictures, desktop light and phone dark.

Proof the checks bite:

  • --pages fails on main's server: the HTML and headers.
  • A Deny without its token fails against the reference's calls.
  • A missing X-Frame-Options fails against the spec.
  • The asset metrics check fails on a server without the route label.

Results:

  • --pages passes on seeds 1 to 19 at 30 flows each.
  • just gates passed on d203fb2: the 7 code gates (fmt, clippy, deny, code.mjs, layers.mjs, contrast.mjs, svelte-check), the crates' tests (pds-server 317 passed), and all 17 harness runs, the two --pages runs among them.
  • Since then, the icons (Lucide), the merged consent rows and their plain words, each checked by svelte-check, the layer and contrast checks and --pages (seeds 1 to 4 at 30 flows on the merged rows, 1 and 2 on the last wording change). The new consent checks fail on the build before each change. The merge of main only changed gates.yml's paths, the README and the compatibility check.

Gates and builds:

  • Gates: gates.mjs gains the pages runs (quick and compare) and the pages' source checks (code).
  • Workflows: gates.yml and nightly.yml build web/ first, and gates.yml installs Chromium. gates.yml's paths, from main, now include web/** and the two new checks.
  • Other builds: just build and the bench setup build the pages before pds.

Not yet:

  • account pages and sign-up, as before;
  • a web client's name, logo and links are drawn but not compared: the pages run uses loopback clients.

consent-desktop-light.png

consent-phone-dark.png

wrong-password-desktop-light.png

choose-phone-dark.png

Asked for changes

The title and the changes are about the OAuth authorization pages. The body describes a different change, pds.js joining the compatibility check, and the diff holds none of that.

  • Title and diff: the pull adds web/, a Svelte 5 app. It embeds the app's Vite build in pds-server through build.rs and oauth/assets.rs, and serves it at /oauth/assets/{name}. It adds --pages to the harness (checks/pages.mjs, look.mjs, contrast.mjs, layers.mjs), spec/OAUTH-PAGES.md and spec edits, and gate and workflow changes.
  • Body vs. diff: the body's spec/COMPAT.md "One account", the accounts setting, the OAuth issuer adapter option, the pds.js Dockerfile, compat/RESULTS.md and results.json are all missing from the 72 changed files. The only bench/impls.json change is spec-pds's build command, now building web/ first. The pds.js table and the just quick / just gates results belong to another pull. Either that work is missing from this branch, or the body was pasted from the other pull.
  • What to do: rewrite the body to describe the pages, what was checked, and the gate results for this head. If the pds.js work was meant to be here, push it, with its spec/COMPAT.md change, since .knotless/review.md asks that every behaviour change be in spec/.

For the pages themselves, the README, spec/OAUTH-PAGES.md and spec/OAUTH.md are updated together with the code. I found no atproto or MCP crates added: build.rs only adds serde_json, which is already a workspace dependency. I did not read the Svelte components, pages.mjs, look.mjs, the lockfiles or the spec pages line by line. Once the body matches the pull, I'll review those.

Approved

The body now describes this pull, which answers my earlier review. It adds the Svelte 5 pages in web/, build.rs and oauth/assets.rs embedding and serving the Vite build at /oauth/assets/{name}, a CSP hashed over the one inline data script, --pages with its layers/contrast/look tooling, and spec/OAUTH-PAGES.md.

I checked this against .knotless/review.md:

  • Spec:
    • spec/OAUTH-PAGES.md, OAUTH.md, OPERATIONS.md (asset route label) and PDS.md (index) move with the code.
    • The README describes what exists, not how it was built.
    • The headers and CSP in page.rs, the asset headers, the 404 for other methods, and the Deny-sends-token and Back-to-list behaviours in the Svelte views all match the spec text.
  • Harness: the changes add checks (--pages, the route label in observe.mjs and operations.mjs). I found no loosened check. I saw no change to conformance.yaml.
  • Server code: I found no new atproto or MCP crates. build.rs adds only serde_json as a build-dependency, which is already a workspace dependency. base64 and sha2 were already used by pds-server.

I did not read the other Svelte components, the lockfiles, pages.mjs or look.mjs line by line.

The gates on ede1264 were still running when I read them, and the run on the earlier head failed on a merge conflict that has since been merged away. Merge only once they pass.

Approved

I read what changed since the approval at ede1264. It replaces the one-row-per-token consent list with merged rows, and keeps the actions in view.

  • Spec: spec/OAUTH-PAGES.md now gives the rows in order, the account, record, upload and service clauses, and a "Seeing it all" rule. web/src/lib/scopes.ts (rowsOf) follows it.
  • Harness: consentRows in pages.mjs is the same merge, written separately from the server's. It makes the check stricter: merged rows, extra scopes that merge and cover each other, and Allow, Deny and Back in the window with no scroll at six rows or fewer. Nothing is loosened.
  • Server code: the other changes are CSS tokens and layout, with no new crates.
  • Gates: the gates run on e243f2f was still running when I looked. Merge only once it passes, since it holds the two --pages runs that exercise the new rows.
  • Edge case, not blocking: a malformed repo: token with no collection would give a bare . sentence. An account: token with an action other than read or manage is read differently by consentRows and scopes.ts. The spec doesn't cover either case.
Approved

I read what changed since the approval at e243f2f. The consent rows are now in plain words: no NSID, method or DID shows outside Technical details. Records becomes All your data plus one Your data in <app> row per app. Services becomes Other services, listed by host. The verbs are add, change and remove. Your identity becomes Who you are.

  • Spec: spec/OAUTH-PAGES.md has the new row table, the clauses for apps, things, kinds and services, and the harness bullet. web/src/lib/scopes.ts and consentRows in pages.mjs both follow it. I compared the two by reading and found no difference in order, merging, covering by *, or wording.
  • Harness: pages.mjs still writes its own merge rather than copying the server's. It gains one scope with several apps, camel-case names, did:plc and did:web audiences, and non-image blobs. Nothing is loosened.
  • Server code: no crates added. The other changes are web code and a CSS gap.
  • Gates: the gates run on f4d449b was still running when I looked. Merge only once it passes, since it holds the two --pages runs that exercise the new words.
  • Edge case, not blocking: an rpc: token with no aud is skipped by servicesRow in scopes.ts. In consentRows, p.q.get('aud') would be null and startsWith would throw. The spec doesn't cover this case, and the pages run's scopes always give an aud.
Approved

I read what changed since the approval at f4d449b. It touches only web/src/lib/templates/Card.svelte. The action row now has a top border and a bottom-only negative margin, and a comment is reworded. This is layout only. It changes no behaviour, spec text, harness check or crate, so what I approved stands.

The gates run on 49a5a62 failed at the test step (exit 101, the crates' tests), so build and harness were skipped. I couldn't read the log, so I don't know why it failed. A CSS change shouldn't affect the Rust tests, so it may be a flake or something already on the branch. Re-run the gates, and merge only once test and the two --pages runs pass. The border and spacing change is what --pages checks at 360×740 and 1200×900 (actions in view without scrolling, no overflow), so that run matters here.

Merged as 059c3d9