Repository navigation
feat(host): check project access and refuse peers without it - #523
Merged
Merged
Conversation
Shares live in the directory's new shares table (versioned migration). apps/host/src/access.ts grants direct access through GitHub read access or the person's own folder, and access through a share otherwise. The host running a channel filters each peer's listing by its person and refuses channel requests and project-repo for projects they can't access. Adds project-access, project-share, and shares-changed ops; the UI and CLI follow in #510. Fixes #507 Fixes #508 Why: apps/host/src/gateway.ts#function mayOpen | every peer request that reaches a channel this host runs must pass the project access check; only the host's owner skips it Why: apps/host/src/access.ts#function share | only people with direct access may change shares, so access from a share is never passed on Why: apps/host/src/gateway.ts#function peopleChanged | a peer's GitHub login decides what it sees, so learning one late must resend peers' listings Why: services/directory/src/index.ts#const MIGRATIONS | the first migration predates the version key and must stay idempotent for directories created before it
iamnbutler
force-pushed
the
access-check
branch
from
October 19, 2026 21:09
45cf69d to
8cc14ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #507
Fixes #508
Part of #506. Stacked on #512 (docs).
Data model: the directory gets a
sharestable through a versioned migration, the firstversionkey it has. The originalCREATE TABLE IF NOT EXISTSschema becomes migration 1, so existing directories upgrade in place.GET /now returnsshares, andPOST /sharesadds or removes one.Access check:
apps/host/src/access.tsgh, or*) or with the person, by Tailscale login.none. GitHub only returns that to accounts with push access (verified against the real API), so a host whose owner only has read access can't confirm teammates. They need a share.Enforcement on the host that runs the channel:
apps/host/src/gateway.tschannelsand every broadcast, is filtered for the peer's person. The host's owner on another of their machines still sees everything.channelrequests (watch, say, ask, stop, and the rest) and peerproject-repoare refused for projects without access.New ops:
project-access: who can see a project and why, plus whether the owner can share it. Owner only.project-share: owner only. Writes to the directory, then sendsshares-changedto every reachable peer, which re-reads the directory. A lobby can't reach someone who was just given access.Smoke-tested:
wrangler devdirectory, upgrading an existing database created bymain's code:main's code still reads the migrated database.github.readableagainst the real API:access.tsagainst that directory, with this host's realgh:--loopbackhost boots and lists channels.Not exercised (needs two people on two Macs): peer listing filtering, refused peer channel requests, and revoking watches when a share is removed. These are in the study scenarios.
Built in Ace
No. Built with Claude Code in a terminal: the session that planned #506 continued straight into implementation, and smoke tests ran
wrangler devand theghCLI directly. Nothing here needed a capability Ace lacks.