feat: host project read endpoint for remote editors (#62, part 1) #69

Merged
claude-bot merged 1 commit from feat/v7-host-project-read into main 2026-06-30 13:38:49 +00:00
Contributor

First slice of #62 (editor-side outbound, full round-trip). The host side a remote editor's instance needs to read a project before editing it.

What it does

  • verifyGetSignature() (apCrypto) — verifies a body-less GET HTTP signature (requires (request-target) + date signed and fresh) and returns the verified signer's actor URL.
  • GET /ap/projects/:id — returns the project's entries as an AP Collection. Public projects are open; private projects require a signed GET from an accepted remote editor on the project (401 unsigned, 403 non-editor). Each entry is exposed with its canonical AP id (/ap/entries/:id) — the exact target an Update activity uses (#10).

Defederation interacts correctly for free: a blocked instance's editors were revoked (#61), so the authorization check fails → 403.

Verification (dev server)

hostProjectRead.test.ts4 tests (forging real GET signatures): private needs a signature → 401; invited editor signed → 200 with the entry + its AP id; non-editor signed → 403; public served unsigned → 200.

api tsc clean; full API suite 211 passed (was 207).

What's next in #62

PR 2 — the invite handshake (host sends an AP Invite on invite-remote; editor records it → "Shared with me"). PR 3 — editor remote-view + compose/edit → signed Create/Update delivery. Cross-instance fetch/delivery is unit-tested per-side; true end-to-end needs two live instances.

🤖 Generated with Claude Code

First slice of **#62** (editor-side outbound, full round-trip). The host side a remote editor's instance needs to **read** a project before editing it. ## What it does - **`verifyGetSignature()`** (apCrypto) — verifies a body-less GET HTTP signature (requires `(request-target)` + `date` signed and fresh) and returns the verified signer's actor URL. - **`GET /ap/projects/:id`** — returns the project's entries as an AP `Collection`. Public projects are open; private projects require a signed GET from an **accepted remote editor** on the project (`401` unsigned, `403` non-editor). Each entry is exposed with its canonical AP id (`/ap/entries/:id`) — the exact target an `Update` activity uses (#10). Defederation interacts correctly for free: a blocked instance's editors were revoked (#61), so the authorization check fails → `403`. ## Verification (dev server) `hostProjectRead.test.ts` — **4 tests** (forging real GET signatures): private needs a signature → `401`; invited editor signed → `200` with the entry + its AP id; non-editor signed → `403`; public served unsigned → `200`. api `tsc` clean; full API suite **211 passed** (was 207). ## What's next in #62 PR 2 — the invite handshake (host sends an AP `Invite` on invite-remote; editor records it → "Shared with me"). PR 3 — editor remote-view + compose/edit → signed `Create`/`Update` delivery. Cross-instance fetch/delivery is unit-tested per-side; true end-to-end needs two live instances. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(p62): host read endpoint — GET /ap/projects/:id (#62)
All checks were successful
CI / App — typecheck, test & build (push) Successful in 1m36s
CI / API — typecheck & tests (push) Successful in 2m48s
CI / App — typecheck, test & build (pull_request) Successful in 1m44s
CI / API — typecheck & tests (pull_request) Successful in 2m41s
c3b97bc8ff
First slice of the editor-side round-trip: let a remote editor's instance
read a host project's entries before editing.

- New verifyGetSignature() in apCrypto: verifies a body-less GET HTTP signature
  (requires (request-target)+date signed, fresh) and returns the signer.
- GET /ap/projects/:id returns the project's entries as an AP Collection.
  Public projects are open; private require a signed GET from an accepted
  remote editor (401/403 otherwise). Entries carry their canonical AP id
  (/ap/entries/:id) so the editor can target Updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-bot scheduled this pull request to auto merge when all checks succeed 2026-06-30 13:36:13 +00:00
claude-bot deleted branch feat/v7-host-project-read 2026-06-30 13:38:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rbrooks/TeaLeaves!69
No description provided.