gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitf07658c7f07658c7ident: 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)mref07658c7/missions/001-ident-mvp.md

3.9 KB

  1. # Mission 001 (old 003) — ident.worldapi.org MVP in Hybriel (ticket #2)
  2. One-shot worker. Architect (Claude Code on Byrodin) verifies your report.
  3. Read first: `/CONTAINERS/projects/antcolony/README.md`, `STATUS.md`, `loreana:/media/STORAGE/projects/tickets.worldapi.org/missions/001-tickets-mvp.md`
  4. and its result: the tickets app `loreana:/media/STORAGE/projects/tickets.worldapi.org`
  5. (README, STATUS, project.hl, store.hl, tests/) — same stack, same conventions, copy its setup.
  6. ## Where
  7. - Host Loreana (`ssh loreana`, fish login shell → `bash -c '…'` or script files).
  8. - New app folder: `/media/STORAGE/projects/ident.worldapi.org`. Vendor `bin/hybriel` + plugins
  9. exactly like the tickets app does (same binary, sha256 c51d163d…).
  10. - Hybriel repo `/media/STORAGE/projects/hybriel` READ ONLY. Reference for login:
  11. `projects/demo-social-network` (mail.hl, login_form.hl, signup_form.hl, store.hl, tests/).
  12. - Dev port **8351**, bind 0.0.0.0. Gate ports: pick your own range, not 8352 and not the social
  13. gate's 8600-8619 (another worker runs the tickets gate at the same time).
  14. ## What ident is
  15. Login for all worldapi apps (tickets, gitoria, …). Email one-time codes only, no passwords.
  16. Accent orange `--color-accent: #ce9178` (tokens: `/CONTAINERS/projects/layouts.worldapi.org/css/foundation/tokens.css`
  17. on Byrodin, read only; markup rules in `docs/conventions.md` there).
  18. ## Scope
  19. 1. Users: email (unique, lowercased), display name, created. Sign up = first login with a new email
  20. (ask for a name once). Codes: 6 digits, expire after 10 min, single use, max 5 attempts, rate
  21. limit sends per email.
  22. 2. Pages: `/` (signed out: login form; signed in: "signed in as …", sign out), code entry,
  23. name prompt for new users.
  24. 3. **Login for other apps — architect decision, redirect + code exchange (OAuth-code style,
  25. works across domains and dev ports):**
  26. - App sends browser to `ident/login?return=<url>&app=<name>`.
  27. - After successful OTP, ident redirects to `<return>?ident_code=<one-time code>` (code valid 60 s,
  28. single use). Only return URLs whose origin is on an allow list (config, for now: the tickets dev
  29. origins `http://100.77.141.84:8350`, `http://192.168.178.75:8350`, `http://127.0.0.1:8350`, plus
  30. whatever your test client uses). Unknown origin → error page, no redirect.
  31. - App's server calls `POST ident/api/exchange {code}` → `{ user: { id, email, name } }` or 400.
  32. - ident keeps its own session cookie so a second app login does not need a new OTP.
  33. - Write this down as a short spec in the app README ("How apps use ident").
  34. 4. Mail: do NOT send real mail in this mission. Use a file sink like the social app
  35. (`HL_SOCIAL_MAIL_SINK` pattern) configured via `.env`; tests read the code from the sink.
  36. Leave the hl:smtp path wired and configurable (SMTP_* env) for mail.byrod.in later.
  37. 5. A minimal test client (a tiny second hybriel app or a route in the gate) that proves the whole
  38. redirect → OTP → return → exchange flow end to end.
  39. Out of scope: wiring tickets to ident (next mission), deploy, Docker.
  40. ## Rules
  41. - No git. Don't touch other project folders (read the tickets app only). Only kill your own PIDs.
  42. Clean up every headless Chrome (`--disable-gpu`, GPU is wedged). Scratch in `.scratch/`.
  43. - A test is the whole process: real headless browser drives login, observe the result;
  44. plus API negative cases (expired/reused code, wrong code 5x, bad return origin, reused exchange code).
  45. - Strict API from day one: unknown/missing fields → 400 naming the field.
  46. - Hybriel bugs: don't fix in the repo; report with repro.
  47. - Leave the dev server RUNNING on 8351 (setsid/nohup, `server.pid`, `server.log`).
  48. - Deliver `README.md`, `STATUS.md`, `tests/browser.mjs`.
  49. ## Report (final answer, this structure)
  50. ```
  51. ## Done
  52. ## Verified (each: command run + observed output)
  53. ## Not verified / open
  54. ## Hybriel issues (repro, observed, expected)
  55. ## Questions for the creator
  56. ## Running (URL, PID, log path)
  57. ```

Branches

Latest commits

  • 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
  • 19b7e3c3deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre