Repository navigation
feat(server): a project guest reads the project's artifacts - #581
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Heads-up for this stack: #584 and #586 (#506) move J5's client reads onto the socket and delete |
A guest holding a View grant on a project was refused that project's artifacts: the guest gate refused every route that is not a GET, and reading an artifact is a POST. The list and the change subscription, both requests on the socket, were not listed for a guest either. The gate now allows the artifact read for a guest whose grant is on the project the request body names, and the list and the change subscription for that project only. A grant on a thread gives none (Shared server AC9), and writing and deleting stay refused. An open change feed ends when the grant on its project is removed. Refs #578 Co-Authored-By: Claude Opus 5.5 <[email protected]>
d7975b3 to
b5bf3cc
Compare
|
Ran a three-reviewer crew over the whole sharing stack (#581 → #602). Each reviewer was on a different vendor: acceptance criteria on Claude Fable 5.1, code review on GPT-6.1-Sol, and security on Grok 4.7. Every finding was checked against each higher branch up to #602, and only stuff that still survives at the top is listed here. Inline comments are on the PR that introduced each one. Overall: the guest gate looks solid. It's default-deny on both HTTP and RPC, scoped by thread/project, and View vs Collaborate is enforced on the server. Revoking a grant ends open feeds, tokens and errors look fine, and FORK.md/D33 are thorough. The real problems are where guest input reaches the agent, plus a couple of attribution bugs in the web client. Hold before merge (updated: one more security finding added on #600)
Smaller
Focused tests the code reviewer ran: 6 files / 101 tests, all passing. Nothing was run in a real browser or on mobile. 🤖 Generated with Claude Code |
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 21 minutes for your next included review. View limit details
Comment |
Problem
A guest holding a View grant on a project is refused that project's artifacts, which Shared server AC9 promises them. The guest gate refuses every route that is not a
GET, and reading an artifact is aPOST; the artifact list and the change subscription, both requests on the socket, are not in the guest's WebSocket allow-list either. Closes #578.What changed
All in J5-owned
apps/server/src/j5/sharing/GuestGate.ts.guestHttpRulenamesPOST /api/j5/artifacts/readas the only non-GET route a guest keeps permissions on. The gate reads the project from the request's JSON body and checks it withPersonAccess.projectAccess, so a grant on a thread gives none. The body is cached by the request, so the route reads the same bytes the gate checked.GUEST_RPC_RULESgains aprojectrule kind, used byj5.artifacts.listandj5.artifacts.subscribeChanges. The list was an HTTP route until the read stack made it a request on the socket (feat(j5): J5's client reads run over WebSocket methods #584); its rule moved with it at the rebase. Like a thread feed, an open change feed ends when the grant on its project is removed.j5.reads.subscribeChanges: none is listed, so each is refused by default.j5.artifacts.deleteis not listed, so it stays refused. There is no artifact write route for a client.A member's connection is unchanged: the gate still looks only at the session's subject.
Live testing
Run by the builder on an isolated
j5-live-testserver (commit1502675f48, the layer above this one, default flags), with a guest paired through a real share link and requests sent with its bearer token.plan.md(200). A path of../../settings.jsonis refused (409, "Artifact paths cannot leave the artifacts directory"), another project id is refused (403), andj5.artifacts.deleteis refused. An openj5.artifacts.subscribeChangesdelivered a change, then ended with "This is not shared with you on this server" when the guest left the project grant, and the next list was 403.j5/main(commit3ed8990140, the top of the stack; the pushed tip differs only in one test file's formatting): a project guest listed the project's one artifact withj5.artifacts.listand read it overPOST /api/j5/artifacts/read(200). The same guest was refused the list for another project id,j5.reads.subscribeChangesandj5.inbox.openCount, and the old/api/j5/artifacts/listroute is gone (404).j5Read(packages/client-runtime/src/j5/state.ts) refuses every J5 read once the connection is known to be a guest's, and the artifact list now goes through it. The server allows the request; the client never sends it. Reported to the read stack's owner.Checklist
FORK.md(case text and file-table row) in this PR — none edited; case 69's text says what a guest may now askdocs/j5/product/upstream.md— D33 extended by one sentenceAGENTS.md) — server only; both artifact entry points (HTTP reads, socket subscription) are covered, and removing the grant is the way back outdocs/j5/product/and user docs rewritten where this changes them — none neededTests:
apps/server/src/j5/sharing/GuestArtifacts.test.tsruns the real artifact routes, the real artifact folder and the real gate: another project's artifacts, a Collaborate thread guest of the same project, a guest session with no person, bodies that name no project or are not JSON, six paths that try to leave the folder, a member reading both, and the grant being removed.Claude Opus 5.5, Claude Code
🤖 Generated with Claude Code