Repository navigation
Conversation
Fail at boot when GFS_DRIVE_NAME is outside ^[a-z0-9-]{1,63}$, the
alphabet canonical gfs://<drive>/<rid> URIs and live-watch keys rely on.
The 403 returned when the principal itself cannot be resolved now carries
reason "principal_denied" (code stays "forbidden"), so callers can tell a
principal denial apart from a per-resource denial without parsing the
message. Additive: no current client reads the field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
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
GFS_DRIVE_NAMEis outside^[a-z0-9-]{1,63}$.reason: "principal_denied". Thecodestaysforbidden.Why
The live GFS watch (rest of this stack) identifies every resource by a canonical key
gfs://<drive>/<rid>, and that key format only holds if the drive name stays inside that alphabet. Today nothing checks it.The watch also needs to tell "this principal cannot read anything" apart from "this principal cannot read this resource" without parsing the error message. The first one ends the whole stream; the second one only rejects a key.
How
config.tsvalidates the drive name next to the rest of the boot config, with the same error style.serve.tsadds the field to the existing principal-denied branch only. Additive: no current client reads it.Testing
config.test.ts: defaultmainwhen unset or empty, valid names, and rejected ones (uppercase,_,.,/, surrounding spaces, non-ASCII, trailing newline, 64 characters).serve.test.ts: the principal-denied 403 carries the new reason, a per-resource 403 does not.tsc --noEmitclean,vitest run47 files / 675 tests passed.Risks
A deployment with a drive name outside the alphabet now fails at boot instead of running. No deploy manifest in this repo sets the variable, so the default
mainapplies and passes.The pattern is duplicated in other services by this stack; consolidating it is tracked in #1507.
Stack
Live GFS subscriptions ship as a stack. The server half and the desktop half must reach
devtogether: the server PRs retire the route the current desktop uses, and the desktop PR needs the new watch route.devprincipal_deniedreasondevdevGET/PUT /external/gfs/watchGET/PUT /api/v1/me/gfs/watch1 and 2 are independent of the chain and safe to merge on their own (1 before 2, since the controller check in 2 mirrors the one in 1).
3 to 8 are one unit and should not be deployed partially:
gfs_resource_changedNOTIFY trigger, which nothing listens to yet.changedevents of a stream that is idle (no op in flight). Do not ship 5/6 without 7./api/v1/entity-changes/streamand control-api/external/entity-changes/stream), which the current desktop still uses. Do not ship 7 without 8.