Skip to content

lore-server: managed repositories are written only by their listed publishers - #2

Open
TechArtistG wants to merge 1 commit into
fix/raw-store-guardfrom
feature/managed-repositories
Open

TechArtistG wants to merge 1 commit into
fix/raw-store-guardfrom
feature/managed-repositories

Conversation

@TechArtistG

@TechArtistG TechArtistG commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

GRID uses Lore to store versioned simulation asset packs. Someone with general write access should not be able to change a pack that other teams rely on. This PR lets administrators protect a pack by requiring anyone who changes it to be both a listed publisher and explicitly authorized for that pack. A storage connection opened before a rule change can still write under the old rules; the next PR closes that gap.

A managed repository is one that only a listed publisher may change. GRID uses it for GDAM asset packs (GenRobo/GRID#3445, GenRobo/GRID#3621).

A JSON policy, [server.auth] managed_repositories_file, lists them:

{"version": 1,
 "managed": [{"resource_id": "urc-<32 lowercase hex>", "name": "pack",
              "publishers": ["<sub>"], "authors": ["<sub>"]}]}

On a managed repository:

  • Write (push, branch and metadata changes, store writes, locks, repository create) needs an explicit urc-<id> grant carrying the new permission publish, held by a subject the policy lists as a publisher.
  • write, owner and admin, wildcard or explicit, read only. Elevated operations (another owner's lock, obliterate, lock admin) count only from that publisher grant.
  • publish implies read everywhere and writes nowhere else.

The file is read again when it changes, at most every 5 s, so dropping a publisher revokes its writes without a restart. No file configured: nothing is managed and nothing changes. A configured file that is missing or invalid stops the server at start; after start it manages every repository with no publishers until it is valid again.

Tests

cargo test -p lore-server --lib -- managed grants auth::jwt repository_create is_owner_or_admin can_admin_lock, with the tests of the PR below: 113 passed (Windows, debug).

Not covered here: an open QUIC storage session keeps the write decision it made at start. The next PR fixes that.

Base: fix/raw-store-guard. Second of three.

…blishers

A managed repository (GRID GDAM asset pack) is listed in a JSON policy,
[server.auth] managed_repositories_file. On it, only an explicit
urc-<id> grant carrying `publish`, held by a subject the policy lists as
a publisher, writes or performs elevated operations (another owner's
lock, obliterate, lock admin, repository create); `write`, `owner` and
`admin`, wildcard or explicit, read only. `publish` implies read
everywhere and writes nowhere else. Dropping a publisher from the policy
revokes its writes within 5 s. A configured policy that is missing or
invalid stops the server at start, and after start manages every
repository with no publishers until it is valid again.

Refs GenRobo/GRID#3445.

Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
@TechArtistG
TechArtistG added this pull request to stack #5 November 23, 2026 07:58
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