Skip to content

lore-server: an open QUIC storage session asks again before every write - #3

Open
TechArtistG wants to merge 2 commits into
feature/managed-repositoriesfrom
feature/managed-session-recheck
Open

TechArtistG wants to merge 2 commits into
feature/managed-repositoriesfrom
feature/managed-session-recheck

Conversation

@TechArtistG

@TechArtistG TechArtistG commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

GRID uses Lore to store versioned simulation asset packs and limit who can publish changes to them. A publisher who lost permission could still upload through a storage connection they had already opened. This PR checks the current publishing rules before each write on that connection, so removing a publisher takes effect without waiting for their sign-in token to expire.

A QUIC storage session decided once, at AuthorizeStart, whether it may write, and kept that answer until its token expired. A session opened before its repository became managed, or before the policy dropped its publisher, kept uploading.

The session now keeps its verified token. Every mutating command (put, copy, mutable store, CAS) asks again under the managed-repository policy in force. With no policy configured nothing can change while the server runs, so the answer from the start stands. An auth-off server is unchanged.

Tests

quic::storage_service_v4::tests::open_sessions_follow_the_managed_policy_in_force drives the real v4 handler with signed test tokens and policy-file changes: a wildcard writer's open session is refused once its repository becomes managed, the listed publisher writes, and both are refused once the policy drops the publisher. With the tests of the two PRs below: 114 passed (Windows, debug).

Not run: the same over a real QUIC socket; no existing client sends raw store writes with a token.

Base: feature/managed-repositories. Third of three. The tree at this head is the one qualified on loopback in GenRobo/GRID sim/lore/TESTING.md.

A QUIC storage session decided write once, at AuthorizeStart, and kept
that answer until its token expired. A session opened before its
repository became managed, or before the policy dropped its publisher,
kept uploading. The session now keeps its verified token, and every
mutating command (put, copy, mutable store, CAS) asks again under the
managed-repository policy in force. With no policy configured nothing
can change while the server runs, so the answer from the start stands.

Refs GenRobo/GRID#3445.

Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
…is a write

The managed-repository policy was re-read only when the file's size or
modification time changed. A replacement that keeps both (a copy that preserves
times, an equal-length edit within the clock's resolution) left a removed
publisher able to write for as long as the server ran. The file is small, so
the server now reads it at every recheck and compares its contents.

A storage Verify with the heal flag rewrites index entries and flushes the
bucket, but neither transport asked for write: a read grant could reach it, on
a managed repository too. gRPC and QUIC now check write for a healing verify
and leave a reporting verify open to readers.

Tests: the open-session test swaps in a policy of equal size and modification
time (it fails on the old reload), and covers healing and reporting verifies on
a session; a gRPC test covers the same three callers.

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