gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit45f7e4da45f7e4daident: the user menu's Sign out waits for the server before it reloads (the apps gate failed because the session could still be signed in)mre45f7e4da/missions/004-ident-selector.md

5.2 KB

  1. # Mission 004 (old 007) — ident 3/6: identity selector (ticket #26)
  2. One-shot worker. The architect (Claude Code on Byrodin) verifies your report, then the creator tests.
  3. ## Read first — in this order
  4. 1. **`loreana:/media/STORAGE/projects/ident.worldapi.org/CONCEPT.md`** — the creator's concept, source
  5. of truth. Section "Flow 2: identity selector" and "Decided 2026-09-24" are this mission. Do not add
  6. features it does not describe; where it is silent, make the smallest choice and list it under
  7. "Questions for the creator".
  8. 2. The app's `README.md` and `STATUS.md` (pieces 1 and 2 done and confirmed by the creator; piece 2 =
  9. apps, API key + secret, per-app identity ids, login button, `POST /api/exchange`).
  10. 3. `/CONTAINERS/projects/antcolony/README.md` (section "Lessons learned").
  11. 4. Ticket: `GET http://100.77.141.84:8350/api/tickets/26`.
  12. ## Hybriel (standard block)
  13. Read `/CONTAINERS/projects/antcolony/docs/hybriel-for-app-workers.md` first — it lists which docs to
  14. trust, the known pitfalls with workarounds (#31 forged face sessions, #36 face names are global), and
  15. the open hybriel tickets. Report new Hybriel findings under "Hybriel issues"; do not edit that guide.
  16. ## Where
  17. - Host Loreana (`ssh loreana`, fish login shell → `bash -c '…'` or script files).
  18. - App: `/media/STORAGE/projects/ident.worldapi.org`, dev port **8351**; test app `testapp/` on **8354**.
  19. Hybriel repo READ ONLY.
  20. ## Scope (piece 3 of 6)
  21. From the concept:
  22. - The app's page includes **a script from ident, configured with the app's public API key**.
  23. - The script **fetches from ident** (with credentials). ident answers with the identities of the
  24. signed-in ident user **only if** the request comes from one of that app's registered origins and
  25. carries its API key (CORS: exact origin + credentials, never `*`).
  26. - The selector is a **shadow-DOM element in ident's design** that the host page **can restyle**
  27. (document how: CSS custom properties and/or `::part`).
  28. - It first says **"choose ident"**. **Selecting an identity is the login**: ident hands the script a
  29. **one-time code** (same rules as the button flow's code), the script gives it to the host page (e.g. a
  30. DOM event); the **host's server exchanges it** with `POST /api/exchange` (key + secret) → per-app id.
  31. - **The host tells the selector it is logged in** (`logged-in` attribute / property). The selector sets
  32. no cookie of its own. Logout on the website = the host resets the selector.
  33. - What happens after login is up to the app: **the test app switches its frontend to logged in
  34. without a reload** (our apps' behaviour).
  35. Where the concept is silent (make the smallest choice, list it): what the selector shows when the user
  36. is not signed in to ident (e.g. a link into the existing login button flow); what it shows in the
  37. logged-in state; how the host restyles it.
  38. Extend the test app (`testapp/`) to use the selector, keeping its login button too.
  39. **Out of scope**: notifications (#27+), foreign-domain / Safari-Firefox third-party cases (all our
  40. apps are same-site; dev ports on one IP count as same-site too), client-only apps.
  41. Also, only if you can read it without being refused: fix the 2 obsolete checks in the piece-1 gate
  42. `tests/browser.mjs` (ticket #37 — they expect `/login` and `/api/exchange` to be gone; replace them
  43. with checks of the current behaviour). If reading it is refused, leave it and say so.
  44. ## Mail — IMPORTANT (unchanged)
  45. The dev server on :8351 sends **real mail**. Never trigger an OTP on :8351; don't run
  46. `tests/dev-smoke.mjs` against it. Your gate starts its own servers with `IDENT_MAIL_SINK`.
  47. **Do not read, print, copy or edit any `.env`.** At the end restart :8351 (only the PID in
  48. `server.pid`) and the test app (only the PID in `testapp/testapp.pid`) and check both answer 200
  49. without logging in.
  50. ## Data
  51. The dev store holds the creator's account and a registered app. Back up `storage/` (and `.sessions/`)
  52. to `.scratch/storage-backup-<ts>/` before the restart; migrate, never wipe. Verify afterwards
  53. (read-only, on a copy) that accounts, identities, apps and connections are still there. The test
  54. app's own `testapp/storage/` holds the creator's key/secret setup — keep it.
  55. ## Rules
  56. - No git. Don't touch other project folders. Only kill your own PIDs or the ones in ident's pid files.
  57. Clean up headless Chromes (`--disable-gpu`). Scratch in `.scratch/`.
  58. - Do NOT POST to the live tickets server (:8350).
  59. - A test is the whole process: real headless browsers — signed in to ident on the ident origin, then
  60. the test app's page on its own origin shows the selector with the right identities, select → code →
  61. host exchange → test app switches to logged in without reload → `logged-in` state → host logout
  62. resets. Negatives: unregistered origin / wrong key gets no identities; signed out of ident gets no
  63. identities; forged face sessions (#31); code reuse; a restyle by the host actually changes the look.
  64. - Strict API as before. Screenshots at 390px and 1280px (selector closed and open), look at them.
  65. - Update `README.md` ("How apps use ident": the selector snippet a host needs) and `STATUS.md`.
  66. Do NOT edit `CONCEPT.md`.
  67. ## Report (final answer, this structure)
  68. ```
  69. ## Done
  70. ## Verified (each: command run + observed output)
  71. ## Not verified / open
  72. ## Hybriel issues (repro, observed, expected)
  73. ## Questions for the creator
  74. ## Running (URL, PID, log path)
  75. ```

Branches

Latest commits

  • 45f7e4daident: the user menu's Sign out waits for the server before it reloads (the apps gate failed because the session could still be signed in)mre
  • f07658c7ident: home page shows the account once (account bar removed, the user menu carries email, Sign out, Sign out everywhere); wildcard origins https://*.domain for apps on many subdomains; gates follow (WIP: gates not re-run after the last edits)mre
  • f2c43bbbtheme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
  • 6d4f996esessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 029eb5e5deploy: security gate (tests/security.mjs)mre
  • d3c065a8security audit (SI): uploadMax 0, Secure __Host- cookie behind https, headers on function routes/files, page CSP+referrer meta, app/identity caps, tests/security.mjs, reportmre
  • 5561a0cbreport I4-mobilemre
  • 4ca2ed20404 page in the shell (viewport, status 404, way home); phone: account actions live in the user menu so the open menu covers nothing; mobile gate; signoutall waits for a cold startmre
  • 9baad745tests: browser gate waits for the reloaded document (offline reload race under CPU throttle); HL_CPU_THROTTLE knobmre
  • b96796bdtests: wait for hydration before real clicks after a navigation (H2)mre
  • 9722964fre-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • c9b196c9tests/iplimit: wait for the welcome form itself after B's first login (identities list renders before it); mission 017 reportmre
  • 72e0f587ident#26: identity page with "Used in" (app, since, last use, Notif. chip, empty state); lastLogin recorded at exchange; gates + lisbeth E2E; mission 016 reportmre
  • 94576fbcident#26 WIP: identity page /identity/:iid with "Used in" (app, since, last use, Notif. chip), lastLogin recorded at exchange, "Used in…" link on the identities list; apps gate 4b, e2e-usedin.mjsmre
  • 349cb502tests/invites: wait for hydration on the code page before entering the code (native GET submit raced the welcome form); mission 015 reportmre
  • d1bf4720tests: no hard-coded ports — every gate's ports and fixture origins come from <GATE>_PORT / _CHROME env (defaults unchanged; Bob/fixture origins follow, selector cookie name too)mre
  • 6280c92fre-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • 147744bftests/migration: the fixture app origin follows MIGRATION_GATE_TESTAPP_PORT (oldstore-009 OLD_TESTAPP)mre
  • 48cd36bctests/migration: ports from env (MIGRATION_GATE_PORT, MIGRATION_GATE_TESTAPP_PORT); 8395/8396 were taken by a foreign servermre
  • 3d9b2fd8docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre