gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitf2c43bbbf2c43bbbtheme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mref2c43bbb/missions/003-ident-apps-login-button.md

4.9 KB

  1. # Mission 003 (old 006) — ident 2/6: apps and login button (ticket #25)
  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. Do not add features it does not describe; where it is silent, make the smallest choice
  6. and list it under "Questions for the creator".
  7. 2. The app's `README.md` and `STATUS.md` (piece 1, mission 002 (old 005), confirmed by the creator).
  8. Note `.scratch/removed-mission003/`: the old redirect + one-time-code exchange from mission 001 (old 003) —
  9. reuse its mechanics where they fit the concept, not its data model.
  10. 3. `/CONTAINERS/projects/antcolony/README.md` (section "Lessons learned").
  11. 4. Ticket: `GET http://100.77.141.84:8350/api/tickets/25`.
  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 (note #31: forged face sessions), and the open hybriel
  15. 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**. Hybriel repo READ ONLY.
  19. ## Scope (piece 2 of 6 only)
  20. 1. **Apps**: any signed-in ident user can register apps in ident (name + the origin(s) it runs on,
  21. used to validate return URLs). Each app gets a **public API key** and a **secret** (shown once or
  22. re-viewable — your choice, list it). The user sees and manages their apps (list, edit, regenerate
  23. secret, delete).
  24. 2. **One identity id per app**: when an identity logs in to an app for the first time, ident creates
  25. the connection with a new, app-specific identity id (not derivable from other apps' ids) and
  26. stores when it was created ("when they registered in it" — needed later for the per-app page).
  27. 3. **Login button flow**: app sends the browser to ident with its API key and a return URL (return
  28. origin must be one of the app's registered origins, else an error page and no redirect). Not
  29. signed in → ident login first. Signed in → the user chooses one of their identities (with only one
  30. identity: still show which one is used, one click). Then ident redirects back with a one-time code
  31. (short-lived, single use).
  32. 4. **Exchange**: the app's server posts the code with its API key + secret and gets back **only the
  33. app-specific identity id** — no email, no names (concept: apps ask for extra data themselves).
  34. Wrong secret, other app's code, reused/expired code → 400/401.
  35. 5. A **minimal test app** (separate tiny hybriel app in `testapp/`, own port) that registers as an app
  36. and proves the whole flow, incl. that a second app gets a different id for the same identity.
  37. **Out of scope**: selector (#26), notifications (#27+), client-only apps.
  38. ## Mail — IMPORTANT
  39. The dev server on :8351 now sends **real mail** (SMTP via mail.byrod.in, set by the creator).
  40. - **Never trigger an OTP on the :8351 dev server.** Do not run `tests/dev-smoke.mjs` against it.
  41. - Your gate starts its own servers with `IDENT_MAIL_SINK` set (as the current gate does).
  42. - **Do not read, print, copy or edit `.env`** (it holds the SMTP password). If you need other settings,
  43. pass them as environment variables to your own test servers.
  44. - At the end restart the dev server (kill only the PID in `server.pid`, `setsid nohup ./bin/hybriel
  45. project.hl >> server.log`, update `server.pid`) and check it answers 200 on `/` — without logging in.
  46. Leave your test app running on its port so the creator can try the flow; report its URL/PID.
  47. ## Data
  48. The dev store holds the creator's real account now. Back up `storage/` to `.scratch/storage-backup-<ts>/`
  49. before the restart; migrate, never wipe. After the restart verify (read-only, e.g. with a small hybriel
  50. script against the store copy) that the account and its identities are still there.
  51. ## Rules
  52. - No git. Don't touch other project folders. Only kill your own PIDs or the ones in ident's pid files.
  53. Clean up headless Chromes (`--disable-gpu`). Scratch in `.scratch/`.
  54. - Do NOT POST to the live tickets server (:8350).
  55. - A test is the whole process: real headless browser drives register app → login button → ident
  56. login → choose identity → back → exchange → test app shows the id; plus negatives (foreign origin,
  57. wrong secret, reused/expired code, other app's code, face-session forging per #31).
  58. - Strict API: unknown/missing fields → 400 naming the field; invalid JSON → 400.
  59. - Screenshots at 390px and 1280px, look at them. Update `README.md` ("How apps use ident") and
  60. `STATUS.md`. Do NOT edit `CONCEPT.md`.
  61. ## Report (final answer, this structure)
  62. ```
  63. ## Done
  64. ## Verified (each: command run + observed output)
  65. ## Not verified / open
  66. ## Hybriel issues (repro, observed, expected)
  67. ## Questions for the creator
  68. ## Running (URL, PID, log path)
  69. ```

Branches

Latest commits

  • 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
  • 19b7e3c3deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • c8a596f4re-vendor Hybriel 66c3db71 (web batch 4); e2e: main menu marked after in-place sign-in is a normal check; report 014mre