Skip to content

feat(permissions): show callers only what they may read - #144

Open
PiquelChips wants to merge 1 commit into
feat/permissions-fetch-by-recordfrom
feat/permissions-reads
Open

PiquelChips wants to merge 1 commit into
feat/permissions-fetch-by-recordfrom
feat/permissions-reads

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Every caller reads everything a server holds. Callers now see only what their rights let them read, as permissions::Reader decides.

Reading:

  • A caller who can read no path sees nothing at all: the repository isn't listed, and every call answers as if it didn't exist.
  • Otherwise they see its targets and acceptances, every revision that changes a path they read, or changes nothing, and the statements about what they see. Revisions that only change unreadable paths are hidden, along with their statements and events.
  • Fetches, inventories, a change's revisions and heads, statements, pending landings and events all leave out the rest, and a push's expected heads are compared with those the caller sees.
  • Snapshot walks withhold the content of unreadable paths: their entries keep their place in the trees, but neither the blobs nor the trees under them come.
  • Everyone who sees the repository reads policy's snapshots, which say what each may do and which keys sign acceptances, so they can verify every target.

Walks only check paths where the rules differ: under a path whose level is settled, nothing more is checked.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 645def72-77a7-4ba4-96c1-dfc5c5afe319
Commits

Reviewing files that changed from the base of the PR and between 1a7880d and 8e6ddb4.

Files selected for processing: 11

  • apps/origin-src/src/events.rs
  • apps/origin-src/src/http.rs
  • apps/origin-src/src/permissions.rs
  • apps/origin-src/src/server.rs
  • apps/origin-src/src/service.rs
  • apps/origin-src/src/sync.rs
  • apps/origin-src/src/tree.rs
  • apps/origin-src/tests/http.rs
  • crates/origin-client/src/lib.rs
  • crates/origin-shared/src/api.rs
  • docs/openapi.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/permissions-reads branch from 4b2d2c7 to 3b66577 Compare November 22, 2026 15:04
@PiquelChips
PiquelChips force-pushed the feat/permissions-reads branch 2 times, most recently from 70f1c42 to 145c99f Compare November 22, 2026 18:54
Every caller read everything a server held. Callers now see only what
their rights let them read, as `permissions::Reader` decides.

A caller who reads no path doesn't see the repository at all: it isn't
listed, and every call answers as if it didn't exist. Otherwise they see
its targets and acceptances, every revision that changes a path they
read, or changes nothing, and the statements about what they see.
Fetching records leaves out the others, and so do inventories, the
revisions of a change and its heads, statements, pending landings and
events, while a push's expected heads are compared with those the
caller sees. A snapshot walk withholds the content of the paths they
don't read: their entries keep their place in the trees, but neither
the blobs nor the trees under them come. Everyone who sees the
repository reads `policy`'s snapshots, which say what each may do and
which keys sign acceptances, so they can verify every target.

Walks only check paths where the rules differ: under a path whose
level is settled, nothing more is checked.
@PiquelChips
PiquelChips force-pushed the feat/permissions-reads branch from 145c99f to 8e6ddb4 Compare November 22, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant