Repository navigation
Conversation
Quest-Claim: 781e240164415fb4
A grant (token, moq auth serve rule, relay public rule, origin scope, and lite-07 AUTH_OK) is a set of path prefixes, each covering its whole subtree. Every wildcard is refused where a grant is parsed or made. Discovery filters keep their patterns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rop harness Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…egion Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lays' syntax A filtered consumer's follow and request start from the scope's subtrees, not the handle's filters, so a path the filter leaves out still resolves. Published relays from 0.15 read pattern grants and refuse a public rule without a wildcard, so smoke.sh hands them smoke-patterns.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions pass Releases before 0.22 read a grant member as a pattern, so a bare `foo` is one path to them. Tokens, key scopes, and auth server grants now write each prefix as `foo/**` or `**`, and read that spelling back as the prefix, in moq-auth and @moq/auth alike. Config, flags, origin scopes, and AUTH_OK stay strict. Both aliases are TEMPORARY MIGRATION, deleted by quest/m4/grant-alias-delete.md. The wire-compat token lane signs and verifies under scoped keys each CLI generates, and the compat relay keeps `public = "**"` for released relays, which refuse the empty prefix at startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A parsed scope, Key.public, and KeySet.public spell each prefix as the subtree pattern releases before 0.22 read, as GrantSchema does, so a released verifier no longer reads a published scope narrower than the tokens the key signs. Scope.allows reads either spelling. The wire-compat token lane adds a key the library scopes, verified by its public half. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
ℹ️ No blocking issues found — one small JS/Rust mismatch is inline, and one upgrade edge case should be named in the docs.
Approach: sound. Moving grants back to prefixes makes authorization O(n log n) on every shape and lets a claim ride the path it is presented at. Discovery keeps patterns (Consumer::filter). The temporary foo/** wire alias in wire.rs and wire.ts lets old and new issuers, verifiers, and relays upgrade in any order. The alias stays in the serde layer, and Access's own serde stays strict, which is where it belongs.
Reviewed changes. I read the prefix algebra, the auth alias and claims, moq-net's origin, permit, and request coverage, and the relay, CLI, FFI, and config surfaces. I also checked parity for lite-07 AUTH_OK, regions, and the origin listing between Rust, JS, and the draft.
Prefix/Prefixes(moq-pattern,@moq/pattern): a sorted, reduced set that refuses any*and malformed slashes.- Rust
coveringbinary-searches each ancestor; JS#coveringchecks the last member at or before the path. Both are correct for a reduced, sorted set. - Both reject the same inputs, and
AUTH_OKdecoding turns a bad prefix into a PROTOCOL_VIOLATION on both sides, as the draft says.
- Rust
- Auth wire alias: tokens, key scopes, and
GrantJSON writefoo/**or**, and the deepest prefix as its literal. Only those two spellings read back."/**","a\/**","foo/*/**", and every other wildcard are refused identically in both languages. - Legacy
put/get: read as the same prefixes, with slashes normalized. - Origin scope vs. listing:
OriginScope.allowedisPrefixes. The newConsumer.listedis the scope ∩ filters and feeds only theannounced/routescursors.path_routesanswers to the scope alone, which matches JS, wherefollowtakes no filter. reach(): gives the whole claim when the scope covers the prefix, and otherwise the scope's members beneath it. This matches JS'sclaimed.- Permits:
Permit::withinreplacesbeneath, andregions()intersects the grant and the limit.PublishNamespaceuses the same prefix test asPublish. - Config and CLI:
moq auth serverules, the relay'spublic*settings, and thesign/generateflags refuse wildcards and name the prefix to write instead. The empty prefix is""across the CLI, TOML, and env. The Nix module mapspublicPathexactly as before. The relay's lease and refresh changes are mechanical.
ℹ️ A released bare "" widens from the root path alone to everything
The upgrade note says a bare member minted since #3746 widens from one broadcast to its subtree. The extreme case is the bare empty member. Under released pattern semantics, "" granted exactly the root path (claims.rs on main: "the empty pattern grants exactly the path"). alias::read and readPrefix now read it as Prefix::all().
Take a released key scope minted with moq auth generate --publish ''. It jumps from signing only the root path to unrestricted signing, which runs against Scope's promise that a scoped key can never sign more than it already could. A released token, or a released auth server's answer, holding "" widens the same way. This follows from the decision you documented and is probably rare in the wild. But it is the one widening that reaches everything, so it deserves its own sentence in doc/setup/upgrade.md and the Impact section.
Technical details
# Bare `""` from a release before 0.22 now grants everything
## Affected sites
- rs/moq-auth/src/wire.rs:409-420 (`alias::read`) — `""` falls through to `head.parse()` → `Prefix::all()`
- js/auth/src/wire.ts:48-52 (`readPrefix`) — same
- doc/setup/upgrade.md:44-47 — names the `alice` widening but not the `""` → everything case
## Required outcome
- Operators learn that a key scope, token, or auth-server grant minted before 0.22 with a bare `""` member now grants everything under its root, and know to re-mint it.
## Open questions for the human
- Is a docs note enough? The alternative is refusing a bare `""` on read until the step-1 migration starts writing bare prefixes. 0.22 itself always writes `**`, so a bare `""` in 0.22 can only come from an older issuer.claude-opus-5-5 | 𝕏
|
quest land watch: ended this pull request's pick, disarming its auto-merge, since its head 367233d is held by finding by pullfrog[bot]: This casts every gained prefix to (written by quest land watch) |
`gained()` cast every new grant prefix to a path, so a prefix longer than a path can be marked every synced reader at or above it behind. Rust's `Permit::beyond` drops such a prefix, since it covers nothing a peer could name; JS now does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes. This run covers the one commit since the last review, which fixes the inline finding on gained().
gained()filter:js/net/src/lite/routed.tsnow drops any gained prefix thatPath.checkrejects. This matches Rust'sPermit::beyond, so a grant that gains a prefix too long to be a path no longer unsyncs any reader.- Regression test: the new
subscriber.test.tscase grants a prefix ofMAX_BYTES+ bytes and asserts that a rootroutes()reader stays synced.
The earlier body note on a released bare "" widening to everything is not yet in doc/setup/upgrade.md. Whether it needs its own sentence is your call. It does not block merging.
claude-opus-5-5 | 𝕏
|
quest land watch: the merge queue removed this pull request at 8a43f46 because its The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.
… installed [204.00ms]
$ wrangler deploy --dry-run
⛅️ wrangler 4.162.0 (update available 4.166.0)
───────────────────────────────────────────────
Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
Total Upload: 1.44 KiB / gzip: 0.73 KiB
Your Worker has access to the following bindings:
Binding Resource
env.GO (go-moq-dev) R2 Bucket
--dry-run: exiting now.
bun test v1.4.4 (38afee6c8)
##[group]src/worker.test.ts:
(pass) serves each GOPROXY file with its type and cache lifetime [1.36ms]
(pass) HEAD returns the headers without a body [0.09ms]
(pass) a missing version, @latest, or a non-GOPROXY key is an uncached 404 [0.20ms]
(pass) only a GOPROXY path reads the bucket [0.07ms]
(pass) refuses writes [0.04ms]
##[endgroup]
5 pass
0 fail
35 expect() calls
Ran 5 tests across 1 file. [6.00ms]
bun install v1.4.4 (38afee6c8)
+ wrangler@4.158.0
37 packages installed [134.00ms]
bun install v1.4.4 (38afee6c8)
+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0
40 packages installed [152.00ms]
$ wrangler deploy --dry-run
⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────
Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
Total Upload: 7.71 KiB / gzip: 3.03 KiB
No bindings found.
--dry-run: exiting now.
bun install v1.4.4 (38afee6c8)
+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0
40 packages installed [156.00ms]
$ wrangler deploy --dry-run
⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────
Total Upload: 2.18 KiB / gzip: 0.97 KiB
Your Worker has access to the following bindings:
Binding Resource
env.RELEASE (nix-moq-dev) R2 Bucket
env.CI (nix-ci-moq-dev) R2 Bucket
--dry-run: exiting now.
bun test v1.4.4 (38afee6c8)
##[group]src/worker.test.ts:
(pass) bucket reads > RELEASE service error 10001 makes GET and HEAD a non-cacheable miss [0.77ms]
(pass) bucket reads > RELEASE service error 10043 makes GET and HEAD a non-cacheable miss [0.07ms]
(pass) bucket reads > RELEASE preserves Error: get: Unauthorized (10002) [0.12ms]
(pass) bucket reads > RELEASE preserves Error: get: Access denied (10003) [0.01ms]
(pass) bucket reads > RELEASE preserves Error: get: No such bucket (10006)
(pass) bucket reads > RELEASE preserves Error: get: Invalid object name (10020)
(pass) bucket reads > RELEASE preserves Error: get: Unknown failure (0)
(pass) bucket reads > RELEASE preserves Error: unrelated 10001 [0.06ms]
(pass) bucket reads > RELEASE preserves TypeError: bad binding [0.01ms]
(pass) bucket reads > CI service error 10001 makes GET and HEAD a non-cacheable miss [0.05ms]
(pass) bucket reads > CI service error 10043 makes GET and HEAD a non-cacheable miss [0.04ms]
(pass) bucket reads > CI preserves Error: get: Unauthorized (10002) [0.05ms]
(pass) bucket reads > CI preserves Error: get: Access denied (10003)
(pass) bucket reads > CI preserves Error: get: No such bucket (10006) [0.02ms]
(pass) bucket reads > CI preserves Error: get: Invalid object name (10020)
(pass) bucket reads > CI preserves Error: get: Unknown failure (0)
(pass) bucket reads > CI preserves Error: unrelated 10001
(pass) bucket reads > CI preserves TypeError: bad binding [0.01ms]
(pass) bucket reads > a missing binding is a configuration error [0.20ms]
(pass) bucket reads > a release miss checks CI and preserves the object's headers and body [0.50ms]
(pass) bucket reads > a release service error still serves the path from CI [0.21ms]
(pass) bucket reads > a plain miss stays cacheable [0.09ms]
(pass) bucket reads > cache metadata needs no bucket read [0.10ms]
##[endgroup]
23 pass
0 fail
78 expect() calls
Ran 23 tests across 1 file. [6.00ms]
bun install v1.4.4 (38afee6c8)
+ @cloudflare/workers-types@5.20261108.1
+ typescript@7.0.2
+ wrangler@4.158.0
40 packages installed [154.00ms]
$ wrangler deploy --dry-run
⛅️ wrangler 4.158.0 (update available 4.166.0)
───────────────────────────────────────────────
Total Upload: 2.08 KiB / gzip: 0.89 KiB
Your Worker has access to the following bindings:
Binding Resource
env.RPM (rpm-moq-dev) R2 Bucket
--dry-run: exiting now.
##[endgroup]
ci: check large_files started
ci: check large_files passed in 1s
##[group]check large_files
changed: base 9b22abb233127027ddf5c055deab282c313a4958
##[endgroup]
ci: check text started
ci: check text passed in 0s
##[group]check text
##[endgroup]
ci: check coverage_tables started
ci: check shell failed in 3s
##[group]check shell
open infra/nix/node_modules/.bun-tmp-57a271e920280c3f/dist/src: no such file or directory
In bench/browser/run.sh line 20:
source "$WORKSPACE/test/lib/harness.sh"
^-- SC1091 (info): Not following: ../../test/lib/harness.sh was not specified as input (see shellcheck -x).
In bench/browser/run.sh line 97:
bun micro.ts --bench "$benchmark" --rounds 1 --out "$HARNESS_RUN/$benchmark.json" \
^----------^ SC2153 (info): Possible misspelling: HARNESS_RUN may not be assigned. Did you mean HARNESS_RUNS?
For more information:
https://www.shellcheck.net/wiki/SC1091 -- Not following: ../../test/lib/har...
https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: HARNESS_RUN...
##[endgroup]
ci: check coverage_tables cancelled in 0s
ci: check go cancelled in 81s
##[group]check coverage_tables
##[endgroup]
##[group]check go
bash ../sh/go/check.sh
go check: gofmt -l...
go check: go vet modzip...
go stage: building moq-ffi for x86_64-unknown-linux-gnu...
Finished `dev` profile [unoptimized] target(s) in 0.36s
mbx[savings]: 3.3 TiB logical of build debris has left the building.
go stage: generating bindings...
go stage: assembling ffi module...
go lib linux_amd64 <- x86_64-unknown-linux-gnu (480 MiB)
go lib linux_arm64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/aarch64-unknown-linux-gnu/libmoq_ffi.a missing
go lib darwin_arm64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/aarch64-apple-darwin/libmoq_ffi.a missing
go lib windows_amd64: skipped, /var/cache/github-runner-work/moq/moq/dist/go-libs/x86_64-pc-windows-msvc/moq_ffi.lib missing
Staged: /var/cache/github-runner-work/moq/moq/dist/go-ffi-pkg/moq-ffi-0.0.0-dev-go
go stage: staging wrapper module...
skipping go mod tidy (no go.sum staged)
Staged: /var/cache/github-runner-work/moq/moq/dist/go-wrapper-pkg/moq-go-0.7-wrapper
go check: checking error sentinels...
go check: go vet ./...
go check: go build ./...
go check: go test -race ./...
error: recipe `check` was terminated on line 17 by signal 15
##[endgroup]
##[error]ci: check shell failed
ci: wall and CPU seconds per module
218 407 check py
113 13 test py
265 297 check rs
297 1947 test rs
23 3 check cargo_nix
273 348 check c
375 189 check cpp
42 60 check obs_compile
38 47 check biome
206 548 check js
87 126 test js
13 7 check dead_code
6 8 check audio_quality
21 10 check drafts
11 12 check markdown
18 24 check gh
116 98 check tooling
177 154 check kt
42 48 check flake
35 59 check bench
5 5 check carla
90 66 check carla_bridge
1 0 check swift
81 30 check go (cancelled)
1 0 check drill
7 10 check workers
2 2 check quest
0 0 check python
3 2 check shell (failed)
1 0 check large_files
0 0 check text
0 0 check coverage_tables (cancelled)
856 4536 whole run
error: recipe `ci` failed on line 120 with exit code 1
##[error]Process completed with exit code 1.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: cargo-timings
path: target/cargo-timings/cargo-timing-*.html
if-no-files-found: ignore
retention-days: 14
compression-level: 6
overwrite: false
include-hidden-files: false
archive: true
env:
BASE: 9b22abb233127027ddf5c055deab282c313a4958
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 3 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 186210
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is f544929c3ff43764bb8d4fa83be47a4cc5941e282cdd74b3b1259a0bf8c60712
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14687901495
Artifact cargo-timings has been successfully uploaded! Final size is 186210 bytes. Artifact ID is 14687901495
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/44854912132/artifacts/14687901495
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__a67eb395-fcca-4b38-9938-e47b5c75a1be.mbx]
##[end-action id=__a67eb395-fcca-4b38-9938-e47b5c75a1be.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/64c00428-c0ec-4725-b8e4-d7703330ce45' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/qrn6ds64bzvwbm5nwf245ifz2c6jb9xw-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 65 objects and 20 action results (264.2 MiB logical); 50.0 GiB logical remain
dropped 11 stale checkout records
dropped 4 session event streams
removed 0 learned incremental units and 3 checkout directories (3.8 KiB logical); 32 units (5.0 GiB logical) remain
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
removed 2 target directories (2.1 MiB logical, 2 abandoned and 0 live); 20.8 GiB logical remain
Cleaning up orphan processes
(written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
codex, gpt-6.1-sol, medium effort land fixer: ci: check shell failed in 3s
##[group]check shell
open infra/nix/node_modules/.bun-tmp-57a271e920280c3f/dist/src: no such file or directory
In bench/browser/run.sh line 20:
source "$WORKSPACE/test/lib/harness.sh"
^-- SC1091 (info): Not following: ../../test/lib/harness.sh was not specified as input (see shellcheck -x).
In bench/browser/run.sh line 97:
bun micro.ts --bench "$benchmark" --rounds 1 --out "$HARNESS_RUN/$benchmark.json" \
^----------^ SC2153 (info): Possible misspelling: HARNESS_RUN may not be assigned. Did you mean HARNESS_RUNS?
For more information:
https://www.shellcheck.net/wiki/SC1091 -- Not following: ../../test/lib/har...
https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: HARNESS_RUN...
(written by codex, gpt-6.1-sol, medium effort) |

Claims and completes quest/m2/prefix-grants.md.
Summary
Every grant is a set of path prefixes again, as before moq-dev/moq#3746. Each prefix covers its whole subtree. This backs out the grant half of #3746 and the pattern-valued scopes of moq-dev/moq#3672. A route a grant admits now always serves whole subtrees, so a claim's reach can ride the path it is presented at. That unblocks lite07-claim-reach-routes.
moq-patternand@moq/patterngainPrefix,Prefixes, andInvalidPrefix.Prefixesis a reduced, sorted set in segment order, so two sets covering the same paths compare equal./is an error, so a typo cannot widen a grant.*anywhere is refused first, with the prefix to write instead (`anon/**` is a wildcard: grants are prefixes, and `anon` covers `anon` and every path beneath it).moq-auth,@moq/auth)moq auth serverules and the relay'spublic*configGrantJSONPermitand origin scopes (Producer::scope,Consumer::scope,allowed) in moq-net and js/netAUTH_OKfooas one exact path. So tokens, key scopes, and the auth server'sGrantJSON spell each prefix as the subtree pattern they read,foo/**or**, and read that spelling back as the prefix. Every other wildcard is refused there. Config, CLI flags, env, origin APIs, andAUTH_OKtake bare prefixes alone. The alias iswire::aliasinmoq-authandwire.tsin@moq/auth. Both are markedTEMPORARY MIGRATIONand come out in two version migrations (quest/m4/grant-alias-delete.md).Consumer::filter(&Pattern)(Rust) and thefilterargument ofannounced()androutes()(JS) narrow what a handle lists, apart from what it may reach. A scoped handle lists what its prefixes and its filter both admit.Consumer::reaches_anyis gone, since a prefix test does its job.AUTH_OKcarries Publish and Subscribe Prefixes. A wildcard or malformed prefix is a PROTOCOL_VIOLATION. The region rule's regions are the scope's prefixes not lying within another. The draft's Path Pattern section is now Path Prefix.put/gettokens read as the same prefixes they always meant. Every token writespublishandsubscribe, as since moq-dev/moq#9001.doc/concept/moq-lite.mdgains a "Grants and filters" section. Also updated: the relay auth and config pages, the library pages, the CLI page, the upgrade guide, demo configs, scripts, and the interop harness.Decisions
anoncoversanonand everything beneath it, and the empty member covers everything. Wildcards are refused loudly wherever a grant is made:moq auth serverules, relay config (CLI, TOML, and env), signing (with_publish,Key.sign, and the CLI flags), origin scope APIs, andAUTH_OK. The one exception is the migration spelling below, which applies where a grant is read from a token, a key scope, orGrantJSON.foo/**and**as their prefix, and write each prefix asfoo/**, or**for the empty prefix. Rejected: shipping strict, which upgrades an auth server and the relays it answers together. The release check turned up the need for the write half:fooas one path and""as the root path alone.foo/**is read as the same subtree./**have expired or been re-minted.moq_auth::wire::aliaswrapsClaims,Scope, andGrantserde, andAccessgains crate-privateserialize_asanddeserialize_asfor it.Access's own serde stays strict, somoq auth serverules still refusefoo/**.{"path": [...], "rate": ...}) is spelled the same way.JSON.stringifyis the serializer, so the parsed value carries the written spelling.GrantSchema.parseoutputs it, so an auth server answering withGrantSchema.parse(grant)is read alike by every relay. Parsing that output again yields the same JSON. A typedGrantstill holds bare prefixes.ScopeSchema, and with it every parsed key.Key.publicalso spells a scope typed by hand, soKey.publicandKeySet.publicalways publish the spelling the key's tokens carry.Scope.allowsreads either spelling. This came from the local review, which found that a published key's barevideowould make a released verifier refuse the key's ownvideo/**tokens.PrefixListSchemaandAccessSchemastay the API input forKey.signandClaimsFieldsSchema. The token and JWK schemas useWirePrefixListSchemaandWireAccessSchema.--publishand--subscribestay strict, like Rust's.put/getorfoo/**, which 0.22 reads alike.foo/**, which a released verifier and relay read as the same subtree."transport": "webtransport", which a releasedmoq auth serveanswers with 422. The upgrade guide already says so, and this PR doesn't change it.@moq/room,@moq/watch, and@moq/statsin JS?path=sessions filter andmoq auth sessions --pathPrefix::rootedandrebasedrop empty segments in the root, asPatterndid, sowith_root("/project/live/")scopes the same asproject/live. The prefix itself stays strict.""in JSON and TOML,--auth-public ''on the CLI, andMOQ_AUTH_PUBLIC=in the environment, which the relay reads as set.roomtold through a scope grantingroom/lobby.chatarrives atroom/lobby.chat. So a**/*.chatlisting at the far end lists it, where older versions tell the claim atroomand the listing omits it (relays_route_a_covering_claim_that_listings_omit).quest/m5/peer-grant-bound.mdshrinks to [S]. Prefixes remove the Orthogonal Vectors bound and the received-grant type question it planned around. What remains is measuring the prefix rows in Chromium and sweeping deep members. This PR adds the Rust prefix rows (collect,covers,intersect), mirroring the JS ones.Consumer::path_routesstarts from the scope's subtrees, not the handle's discovery filters, sofollowandrequestreach a path the filter leaves out (a_filter_never_narrows_a_lookup, which fails on the previous head). JS takes filters per call, so it had no counterpart.public = ""at startup. I confirmed this against the 0.17.17 binary.smoke.shhands such a relaytest/smoke/smoke-patterns.toml(public = "**"). This came from the local review.interop.sh's compat mode wrotepublic = ""for a released relay, so it failed at startup. It now probes the relay's help the same way. Both are delete-marked for whenreleasereads prefixes.Validation
quest gate just checkpasses on ec05d1b, which holds all of the code. That covers 11228 Rust tests (nextest, every selected crate and feature) and 283@moq/authtests, plus the other JS, Python, C, C++, Go, Kotlin, Dart, docs, drafts, and quest checks.failed to create directory .../target, while the build cache re-pointed the checkout'stargetsymlink. Rerun alone (just py check,just c check,just cpp check), they pass.js/authAPI report changed only in schema internals: each member is a string pipe, andScopeSchemagains a final transform. TheScopetype and every input and output type are unchanged.quest gate just test interop --allpasses on 367233d, after a rerun of the go client's cells.targetswap, anduniffi-bindgen-gofound nolibmoq_ffi.so, though the build had just produced it.--publishers rust,python,go,cpp,js --subscribers go) and the go row (--publishers goagainst every other subscriber), each with--timeout 30, the 35 go cells pass, the denied and finish lanes included. Both runs report all checks passed.quest gate just test wire-compatpasses on ec05d1b against moq-cli 0.14.17, moq-relay 0.17.17, and@moq/auth0.2.3. Its token lane:--publish video --subscribe '''video/**'and'**'Key.parseof a typed scopevideoand"", verified through the halfKey.publicwrites (compat/client.ts generate)PASS token signed by ...for all four signers).video/**with a bareaudioreads in current Rust and JS as the prefixesaudioandvideo(PASS released pattern token read as prefixes).rs/moq-auth/tests/released_token.rs:{"root":"compat","publish":["bob","video/**"]}, the exact payload 0.14.17 signs for a mixed grant, reads asbobandvideo.put/gettokens.rs/moq-auth/tests/corpus.json), replayed by Rust and JS, gains accepted cases for each subtree spelling. Its refused cases includea/*/**,**/a,/**,a\/**, a key scope holding*/room, and a grant memberlobby/*.moq auth sign --root compat --publish video --subscribe ''writes{"root":"compat","publish":["video/**"],"subscribe":["**"]}. Releasedmoq auth verifyreads it asPatterns([video/**])andPatterns([**]).moq auth sign --publish 'video/**'still refuses the flag, namingvideoas the prefix to write.moq auth generate --root compat --publish video --subscribe ''writes the scope{"root":"compat","publish":["video/**"],"subscribe":["**"]}. The released signer signs within that scope and refusesaudio/**as exceeding it.*/chatis refused by current verify, which says it holds a wildcard.generatepublishes{"root":"compat","publish":["video/**"],"subscribe":["**"]}. The released signer signs within it. Tokens from the current CLI, the released CLI, and current JS all verify through that public half: released verify readsPattern("video/**"), and current verify readsPrefixes(["video"]). The previous head's public half,publish: ["video"], makes released verify refuse the key's own token withtoken capabilities exceed the key scope.video. The broadcasts werevideo/nested-cam,video/root-cam, andaudio/outside, and I compared what the subscriber listed. The script lives in.tmpand is not committed. In no run wasaudio/outsidelisted.moq auth serve: lists bothvideo/broadcasts.{"publish":["video"],"subscribe":["video"]}: lists nothing. That is the narrowing the write half prevents.moq auth serve: refused with 422 on"transport": "webtransport", the request-side break fix(auth): distinguish WebTransport from native QUIC #5293 already documents. Behind a proxy that renames it toquic, the released server answers{"publish":["video/**"],"subscribe":["video/**"]}, and the current relay lists bothvideo/broadcasts.video/broadcasts.@moq/authGrantSchemareading what the current JS auth server answers. Two checks stand in for it. The cross-language grant vector (interop.test.ts) pins that JS output and Rust's are the same bytes. Released relays read those bytes in the pairings above.a_public_prefix_admits_its_whole_subtree.pattern-algebraprefix rows: at 64 KiB,collecttook 0.27 ms andcovers2.8 ms, against 40 ms for the oldmaskshape.Impact
Breaking public API, in Rust, JS, and the bindings. Wire: lite-07
AUTH_OK(unpublished, so nothing stays compatible with its pattern form).Migration:
foo/**asfooand**as the empty prefix""in:moq auth serverulespublic*rules (CLI, TOML, and env)moq auth signandmoq auth generate's--publishand--subscribe, in Rust and JSfoo/**and**as their prefixes and writes each prefix that way. Releases before 0.22 read that as the same subtree.alice, widens from one broadcast to its subtree.*/chat,cam-*.hang) is refused, so mint it again with prefixes.put/gettokens keep their meaning.transportrather than for grants.moq-auth:Claims,Scope,Grant,Permissions, andAccess.pathholdPrefixes.with_publishandwith_subscribetakePrefixitems. The crate re-exportsInvalidPrefix,Prefix, andPrefixesinstead of the pattern types, and its error variant isError::Prefix.moq-net:Producer::scopeandConsumer::scopetake&Prefixes, andallowed()returnsPrefixes.GrantandPermitholdPrefixes.Patterns::from(Pattern::subtree("foo"))asPrefixes::from("foo".parse::<Prefix>()?).Pattern::all()asPrefixes::all().**/*.chat, moves toConsumer::filter(&pattern).moq-relay:auth.public,public_publish, andpublic_subscribeareVec<Prefix>.@moq/auth: every role inClaims, a key'sScope, and aGrantis a list of prefixes.Key.signrefuses a member holding a*, with the prefix to write instead. Verification andGrantSchemareadfoo/**and**as their prefix and refuse every other wildcard.GrantSchema.parseoutputs each prefix asfoo/**or**, so answer a relay with its output rather than a rawGrant.scope,Key.public, andKeySet.publicspell each prefix the same way, so write a key you scope by hand throughKey.parseorKey.public.Claims.authorizereturnsPrefixesin each role.InvalidPrefix,Prefix, andPrefixesinstead of the pattern types.patterns()isprefixes(), andPatternListSchemaisPrefixListSchema.@moq/net:Grant.publishandGrant.subscribearePath.Prefixes, andProducer.scope(root, prefixes)takesPath.Prefixes.new Path.Patterns([Path.Pattern.subtree("foo")])asPath.Prefixes.parse(["foo"]).Path.Pattern.all()asPath.Prefixes.all().announced(filter?)androutes(filter?)still take anyPath.Pattern; the parameter was namedscope.@moq/room:claims(room, identity)returnssubscribe: [""]andpublish: [identity]instead of**andidentity/**. Mint new tokens with it.MoqGrantmembers are prefixes, with""granting everything. Signatures are unchanged.anonadmitsanon/roomas well asanon. On lite-07, a claim told through a scope narrower than it arrives at the scope's region.Follow-ups
quest/m4/grant-alias-delete.md(new, S) deletes the alias in two version migrations: first it writes bare prefixes, then it deletes the read. Two open decisions:/**spelling nothing re-mints, such as a key scope or a token with noexp. Recommended: delete the read everywhere, with a migration note to regenerate or edit such keys and re-mint unbounded tokens.quest/m4/js-listing-rebuild.md(new, M):@moq/net's origin listing rebuilds every route against every scope member on each update. It measured 22 ms per update at 128 routes and 128 members, the same as with pattern scopes before this PR. The fix rebuilds only touched paths and looks members up through the sorted set. No open decisions.quest/m5/peer-grant-bound.md(rewritten here, L to S): measure the prefix rows in Chromium, sweep deep members, and decide whether themaskandchainrows still earn their place. No open decisions.quest/m4/regrant-route-recheck.md(aligned here): a member is a prefix, so the routes it can change are those at, beneath, or above it. No open decisions.quest/m2/lite07-claim-reach-routes.md(unblocked here): its Required link to this quest is removed.Models
Size: L
Implementer: Claude Code, claude-opus-5-5, unknown effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, L)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 8a43f46
Base: origin/main at 444a1c5
Risk: high,
Changing authorization from patterns to prefixes can broaden token access or reject existing grants and relay configurations for consumers and operators; reverting restores code but cannot undo unauthorized data access.Classified: high by Codex, gpt-6.1-sol, low effort, session
01a1fbc5-b682-7823-b1f6-010cd52e77d8Reviewer: Codex, gpt-6.1-sol, xhigh effort
Session:
01a1fb88-d45a-7370-b21d-098a87e2440d, round 2Score: 10/10,
The incremental fix correctly excludes unrepresentable grant prefixes, preserves the earlier compatibility fix, and adds focused regression coverage; no actionable issues were found, and builds and tests were not run as instructed.Rounds: 5; first round 2 (medium 2); findings 3 (medium 3): fixed 3, refuted 0, open 0
Findings: none