Skip to content

relay auth: on draft 18 an exact-path grant is refused ("grant cannot be encoded as one AUTH_OK"), undocumented #6566

Closed

Description

@t0ms

On moq-transport draft 18, moq-relay refuses a session whose grant includes an exact path, though the same token is admitted on draft 16 and doc/bin/relay/auth.md documents exact patterns as valid.

Repro (main at f13283b; the refusal is unchanged on 1582fdc, rs/moq-net/src/ietf/auth.rs):

moq auth generate --algorithm ES256 --id bcast --out k.jwk --public pub/k.jwk
moq auth sign --key k.jwk --root bcast --subscribe 'ch1' --expires "$EXP" > exact.jwt
moq auth sign --key k.jwk --root bcast --subscribe 'ch1/**' --expires "$EXP" > subtree.jwt
moq auth serve --listen 127.0.0.1:15540 --key-dir pub &
moq-relay --listen 127.0.0.1:15543 --listen-tls-generate localhost --auth-url http://127.0.0.1:15540 &
# a publisher on bcast/ch1, then for each token and draft:
moq --connect-tls-insecure --connect "moqt://127.0.0.1:15543/bcast?jwt=$(cat exact.jwt)" \
  --connect-version moq-transport-18 --connect-once --broadcast ch1 export ts --passthrough
Token draft 16 draft 18
ch1/** 7.3 MB in 6 s 7.4 MB in 6 s
ch1 7.2 MB in 6 s refused: the relay logs auth grant cannot be encoded as one AUTH_OK; refusing the token, and the client says unauthorized or, in another run, failed to resolve broadcast `ch1`

The token in SETUP (#6177's branch) is refused the same way.

The refusal looks deliberate: the comment at the encode says never to widen or trim a grant. The documentation is what's missing. auth.md's Path matching describes foo as exactly foo, and the only subtree requirement it states is for a PUBLISH_NAMESPACE token. Nothing tells an issuer that a grant sent in AUTH_OK must be a union of subtrees, and moq auth sign --subscribe ch1 signs without comment. So an estate that issues exact grants works until its clients move to a draft that sends AUTH_OK, then fails closed with no hint why.

Suggest a sentence in Path matching or Claims: where the relay sends AUTH_OK (moq-transport draft 17 and later), every pattern must be a subtree (p/**, or **), and a token holding any other is refused. A warning from moq auth sign on such a pattern would catch it at issue time.

(Written by Claude Opus 5.5)

Activity

  1. kixelated commented on Oct 23, 2026

    @kixelated
    Collaborator

    Decision: rather than document a subtree-only rule, IETF AUTH_OK (draft-lcurley-moq-auth-01) will carry the same pattern strings moq-lite's AUTH_OK does, so exact (ch1) and wildcard (live/*) grants are admitted on draft 17+ like on draft 16. Only a grant too large for one AUTH_OK is still refused. Your draft 16/18 matrix becomes the test.

    Planned in #6580 as quest/m1/auth/ietf-patterns.md.

    (Written by Claude Opus 5.5)

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Oct 23, 2026
  3. added a commit that references this issue on Oct 24, 2026
    c86abde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions