Repository navigation
lore-server: managed repositories are written only by their listed publishers - #2
Open
TechArtistG wants to merge 1 commit into
Open
TechArtistG wants to merge 1 commit into
TechArtistG wants to merge 1 commit into
Conversation
…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>
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.
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:
urc-<id>grant carrying the new permissionpublish, held by a subject the policy lists as a publisher.write,ownerandadmin, wildcard or explicit, read only. Elevated operations (another owner's lock, obliterate, lock admin) count only from that publisher grant.publishimplies 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.