Repository navigation
lore-server: refuse raw mutable-store writes of keys a checked RPC owns - #1
Open
TechArtistG wants to merge 1 commit into
Open
TechArtistG wants to merge 1 commit into
TechArtistG wants to merge 1 commit into
Conversation
With auth on, the raw MutableStore and MutableCompareAndSwap RPCs (gRPC v1 and QUIC lore-storage/0.4) refuse the key types a checked RPC owns: branch head, branch record, branch id, repository record, repository id. A writer could otherwise move a branch head past protection, file locks and the parent check BranchPush applies. The stock client never writes these through the raw RPCs; untyped and instance keys stay writable. The refusal holds only where a key written under one type cannot be read as another. LocalMutableStore stamps the key type into the stored key, so a branch head relabelled Untyped or Instance lands beside it. A remote or plugin mutable store gives no such guarantee, so under auth a server with one refuses every raw mutable write. Refs GenRobo/GRID#3304. 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 track versions of simulation assets. A writer could change which version a branch pointed to without going through the checks that protect branches and locked files. This PR blocks direct storage writes that bypass those checks when sign-in is required. A separate PR sets the rules for who may publish shared asset packs.
With auth on, the raw
MutableStoreandMutableCompareAndSwapRPCs (gRPC v1 and QUIClore-storage/0.4) refuse the key types a checked RPC owns: branch head, branch record, branch id, repository record, repository id.Before, a writer could move a branch head with a raw store call, past branch protection, file locks and the parent check that
BranchPushapplies (GenRobo/GRID#3304).BranchPush. Untyped and instance keys stay writable.LocalMutableStorestamps the key type into the stored key, so a branch head relabelledUntypedorInstancelands beside it. A remote or plugin mutable store gives no such guarantee, so under auth a server with one refuses every raw mutable write.Tests
cargo test -p lore-server --lib -- raw_mutable mutable verify_write: 51 passed (Windows, debug). The new test seeds each of the five key types, checks that raw store and CAS are refused withPERMISSION_DENIEDand the value is unchanged, and that the same key relabelledUntypedorInstancedoes not reach it.Also run on loopback against this code with the stock CLI and raw gRPC calls: GenRobo/GRID
sim/lore/TESTING.md, "Managed packs and the native writer" (branchfeature/lore-managed-packs).Not run: Linux, a release build, the QUIC path over a real socket (covered by the handler test in the PR above this one).
Base: v0.8.18 (
318f3fd). First of three; the next is the managed-repository policy.