Overview
| Artifact ID: | d14a91788241850c2b6c69f8ad5935ed309586c4d63864a567b0cc28d5e74dfb |
|---|---|
| Ticket: | 32801e6bd26375f738d030800aa88cce548b9db0
Private repositories: visibility flag and read gating |
| User & Date: | dmestas on 2026-08-17 23:42:03 |
Changes
- comment changed to:
Every repository quarry serves is fully public. There is no visibility flag, and nothing gates a read: 26 of the 38 registered ops are `ops.Anonymous`, and `gate()` is only ever called on write pages. ## The role already exists and does nothing `oltp.Role` is `NoRole | Read | Write | RepoAdmin`, ordered so a comparison answers "is this enough?". `Read` is grantable today — quarry account grant --user alice --repo-name libfossil --role read — and it changes nothing, because no read path consults it. That is worse than not having it: an operator can grant `read` on a repository, believe they have scoped access, and have published nothing of the sort. ## What fossil does Fossil has no visibility flag either. Privacy falls out of its capability model: a repository is public because the pseudo-users `nobody` (unauthenticated) and `anonymous` (logged in, unidentified) hold read capabilities. In the corpus every clone carries: nobody gjorz -- g clone, j read wiki, o check-out, r read tickets, z download anonymous hz -- h hyperlinks, z download Take `o`/`g` from `nobody` and the repository is private. So fossil's answer to "is this repo public" is "what can the anonymous user do", which is one mechanism doing two jobs. Quarry does not have to copy that. A visibility flag plus the existing Role ladder is simpler and says what it means. But the fossil behaviour is what an imported repository will arrive expecting, so the mapping has to be deliberate rather than accidental. ## What is needed 1. **Visibility on the repository.** Forge configuration, so OLTP beside `mirror` and `webhook` — not the index, which is disposable, and not the store, which quarry does not write to directly. 2. **Read gating in the ops layer.** Per-repository, not per-op: the check is "may this identity read this repository", and it belongs where `d.repo(name)` already resolves the store, so a new op cannot forget it. An op-by-op `Auth` change would be 26 chances to miss one. 3. **Repo list filtering.** `repo.list`, the fleet page and search must not leak the NAMES of private repositories to an anonymous reader. Name leakage is the usual way this feature is got wrong. 4. **The sync path.** `xfer` fronts `zit clone`/`pull` over HTTP. A private repository must refuse an unauthenticated clone, or the web gate is decoration. 5. **404, not 403, for a private repository an identity cannot see.** A 403 confirms the repository exists, which is exactly what a private repository should not confirm. ## Ordering note Step 3 and step 4 are the ones that make this real. A visibility flag that hides pages but leaves `/api/v1/repos` and the clone endpoint open has not made anything private; it has only made it inconvenient to find. - status changed to: "Open"
- title changed to:
Private repositories: visibility flag and read gating