Skip to content
quarry History Of Ticket 32801e6bd26375f738d030800aa88cce548b9db0
Login

History Of Ticket 32801e6bd26375f738d030800aa88cce548b9db0

Artifacts Associated With Ticket 32801e6bd26375f738d030800aa88cce548b9db0

  1. Ticket change [d14a917882] (rid 694) by dmestas on 2026-08-17 23:42:03:

    1. comment initialized 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.
      
      
    2. status initialized to: "Open"
    3. title initialized to:
      Private repositories: visibility flag and read gating
      
  2. Ticket change [497109a8d4] (rid 697) by dmestas on 2026-08-18 01:06:41:

    1. comment changed to:
      Grounding this in 0001 after a correction elsewhere: the RFC already anticipates this work and places it here rather than in zit.
      
      §7 states the current position as a deliberate v1 choice, not an oversight:
      
      > Pulls stay anonymous in v1.
      
      and puts the enforcement point beyond doubt:
      
      > TLS, HTTP keep-alive, auth, and N-repos-on-one-port live here — zit's deliberately minimal one-shot server stays untouched.
      
      §8 names the v2 shape:
      
      > v1 ships single-org, flat repo namespace, admin + per-repo tokens; role granularity is v2 and adds tables, not architecture.
      
      So this ticket is that v2 step, and "adds tables, not architecture" is the standard it should meet. Three consequences for the plan above:
      
      1. **The gate is quarry's edge, everywhere — including sync.** `zit serve` children bind loopback behind `xfer`, so gating the web while leaving the proxied pull path open is not a partial fix, it is no fix. Item 4 in the list is not optional.
      
      2. **The credential already exists.** §7's sync auth is shipped: quarry verifies the login card's nonce and signature per request against the §6.3 secret, and "the same secret backs web/API writes via HTTP Basic (§8), so there is exactly one credential per user". A private repository should reuse that identity rather than introduce a second notion of who a reader is.
      
      3. **This changes a stated default, so it needs to be explicit.** Anonymous pull is what every existing client expects. Visibility must default to public on upgrade, and taking a repository private is the deliberate act — never the reverse.
      
      
  3. Ticket change [b1caa1ab28] (rid 855) by dmestas on 2026-08-18 18:40:03:

    1. Untracked field cmimetype: "text/x-markdown"
  4. Ticket change [d3265ba43d] (rid 1079) by dmestas on 2026-08-19 11:04:36:

    1. priority changed to: "Medium"
    2. severity changed to: "Important"
    3. type changed to: "Feature_Request"
  5. Ticket change [f25cf50fb5] (rid 1129) by dmestas on 2026-08-19 12:10:52:

    1. subsystem changed to: "api"
  6. Ticket change [11804f9b42] (rid 5380) by ai-local on 2026-09-03 11:54:49:

    1. icomment:
      Landed: repo visibility flag (public by default and on migration; private is the deliberate act), read gating at the web edge, and the same gate on the sync path via xfer.SetReadGate so a private store refuses anonymous pull as well as anonymous browsing. One credential per user, as §7/§8 asked.
      
    2. mimetype: "text/x-markdown"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"
  7. Ticket change [eae51b14ea] (rid 12447) by zeitgeist on 2026-09-24 00:52:44:

    1. Untracked field number: "12"