gitoria
All repositories: gitoria
4.3 KB
# W42 — gitoria: a connected app gets a short-lived token and can fetch over HTTPS (gitoria#42, part of the push API #38)TASK (his words, unchanged): "gitorias first job is to evaluate how to make a push api where external apps can register to interact with gitoria. first use case being a code reviewer." Build GO by Apollo 2026-11-02. This part: https://tickets.worldapi.org/gitoria.worldapi.org/42W42, PORTS = 8730–8739, branch w42-app-token (from main fdb9ed2, which has #41's lib/apps.hl merged; #40's PR records are NOT merged yet — do not depend on them).## Scope (contract docs/apps-api.md v1.2 §0, §2, §3, §6)1. Tokens: `POST {api}/apps/token` with `Authorization: Bearer gak_…` → `200 {"token":"gat_…","expires":"<ISO>"}`, life 1 hour, stored as sha256 only, bound to the app (and so to its repo). Old tokens work until they expire; expired ones are cleaned up cheaply (no timer: e.g. on issue). Removing the app (lib/apps.hl removeApp) kills its tokens at once; so does a re-connect (new key).2. One auth helper for every later API route: appOfRequest(route, req) → { app, repo } or the contract §6 error (401 unauthorized for missing/unknown/expired; 404 not_found when the token's repo is not the repo the address names). Plus the contract error shape helper if #41's apiError does not already give exactly §6 (check, reuse).3. git over HTTPS (lib/transport.hl): Basic auth with any user name and password `gat_…` = READ of that one repo (clone, fetch, ls-remote, refs/pull/* included once they exist). A push with it → 403. Another repo → treated as no access (public repo: plain anonymous read still works as today; private repo: "no such repository" as GO34). Works on the org form of the address too.4. API base for org repos: the routes must exist on both spellings #41 used for exchange (/api/<repo>/… on the org address and /<repo>/api/…) — use one route pattern helper so #43/#44 can add routes the same way. Document it in the report.5. Tests: tests/app-token.mjs (in GATES): issue, use, expiry (fake clock or short life via env only in tests), wrong repo 404, removed app 401, git clone with token on a private test repo, push refused, key in a URL never logged.## Read first- /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.- /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,/media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for anyView change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).Copy a working shape from the docs or from gitoria's own code. A framework gap: write a DOCS/GAP line in the report with a tiny repro; no workaround, no hand-written JavaScript.- THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).- Evaluation: reports/E38-push-api-eval.md (sections 1–6) and reports/E38b-konrad-needs.md. App: README.md, project.hl, lib/pulls.hl, lib/transport.hl, lib/tokens.hl, lib/tickets.hl (connect flow), lib/repos.hl.## Rules- Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main fdb9ed2), everything under /media/STORAGE/claude-scratch/gitoria/W42/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.- Hybriel stays on the vendored set (do not re-vendor).- Ports: only PORTS (check `ss -ltn` first).- Secrets: keys/tokens stored as sha256 only (like lib/tokens.hl); the signing secret is server-readable but never sent to a page or a log.- Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.- Gates (LC_ALL=C), 0 failed at the end: node theme/check-theme.mjs ., node tests/browser.mjs, and every gate in deploy.sh's GATES list. Add your own gate file tests/<name>.mjs for this ticket and add it to GATES. A flake: rerun once, report it.- Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.## Report (REPORT.md, short)What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 7bcf7bc2Nest repo navigation media rules and document selector gapsmre
- 46a76272Reference release row styles from the Viewmre
- a383f428Tie README definition and path styles to its own Viewmre
- a90812ffConsolidate add-code styles under its existing View idmre
- 89107a3eDocument the index direct-child selector remaindermre
- 07403362Scope reply form layout through the component form rulemre
- 097c52baStyle the login error through its View idmre
- c6d9c86aOwn the not-found code rule in its componentmre
- 055424c2Record W61 replacement theme gates, sidebar repro and baselinemre
- 2ed09441Use layouts theme 17e0f03 for W61 compatibilitymre
- b8609a91Merge branch 'main' into w61-stylemre
- 4639caf7Report W61 theme startup blocker and day39 Style probemre
- 81f0a0bbREADME: two caches were restored by 90b4f72; log W62mre
- 4a3f557eImport layouts theme ebd00b6 for W61 (startup blocked)mre
- ab12a257Merge W62: #25 commit page measurements and proc repromre
- 41323e49gitoria#25: measure commit request costs and reproduce blocking process waitsmre
- 53ca42b2log: W60 merged, W61 W62 startedmre
- 80870a33mission W61: style passmre
- 560fd208Merge W60: helpers, bound forms, login in topics, two form fixes (gitoria#28 #32 #33)mre
- ac5ba6a4log: W60, #25 measuredmre