Skip to content

feat(moq-auth)!: a mesh enrollment reply can grow - #8746

Closed
kixelated wants to merge 2 commits into
mainfrom
quest/m2/api-mesh-enrollment
Closed

kixelated wants to merge 2 commits into
mainfrom
quest/m2/api-mesh-enrollment

Conversation

@kixelated

@kixelated kixelated commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/api-mesh-enrollment.md, which this PR deletes.

Summary

Challenge, Proof, EnrollRequest, Enrollment, and Member in moq_auth::mesh are #[non_exhaustive], so a later field (a certificate, a revocation hint) is additive. The other public mesh types were already fenced (Config, Device, KeyInfo, NewKey, ErrorReply, ErrorCode); Client, Coordinator, and Signer have no public fields or are traits.

A caller builds one with a constructor and sets the optional fields:

  • Challenge::new(challenge, expires)
  • EnrollRequest::new(proof, key), then .name
  • Enrollment::new(token, expires, name), then .relays and .members
  • Member::new(endpoint, name), then .tags
  • Proof::sign already was the constructor.

The coordinator and client use them. The module docs say how to build and match. The quest's links in the m2 and m3 mesh quests are updated, and the mesh grant quest's related link is dropped. No certificate field is added, as the quest decided.

Impact

Public API: breaking for a caller that builds one of the five with a struct literal or destructures it without ... moq_auth::mesh exists on main and not on release, so no published release carries the old shape and nothing needs a MIGRATE.md entry. Migration: use the constructor above, and write .. in a pattern. Wire: none. There is no JS counterpart yet (mesh-js-enroll will mirror these names).

The ! in the title follows the rule for a breaking change to main; it is harmless to release tooling only while the module is unpublished, so drop it if the cut would read it as a major bump. Overlap: the sibling mesh quests (bounds, grant shape) touch the coordinator and its docs, not these structs' shape; whichever lands second adapts. A KeyInfo or NewKey field the bounds quest adds needs no change here, they were already fenced.

Decisions

Taken by the agent under /quest-afk, for the maintainer's review:

  • Constructors take the required fields and leave the optional ones to public mutable fields, like Config::new (rejected: one new taking every field, which breaks the 4+ arguments rule for Enrollment and EnrollRequest and breaks again when a field is added; builders, which add a type per struct for no gain).
  • Enrollment::new requires name (the coordinator always assigns one) while relays and members start empty (rejected: an empty name default, which hides a missing one).
  • Title carries ! per the Public API rule (rejected: no ! because the module is unpublished; see Impact).
  • No doctest or new test: the fence is a compile-time property of the crate boundary, and in-crate tests cannot exercise it. Checked by hand instead (see Validation).

Validation

  • quest gate just check origin/main passes, including the moq-auth mesh contract tests (18 pass).
  • A scratch integration test outside the crate (not committed) confirmed a struct literal of Enrollment is refused with E0639, while Enrollment::new, field mutation, Challenge::new, and Enrollment { token, .. } compile.

Follow-ups

None.

Models

Size: XS
Implementer: Claude Code, claude-sonnet-5-5, unknown effort

(Written by Claude Sonnet 5.5)

Review

Rewritten by quest review after each round.

  • Head: 1e7c53d

  • Base: origin/main at 4fec611

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1da4a-1008-7161-99f7-5851cd6cbccc, round 1

  • Score: 9/10, The constructors preserve existing field values and serialization, and the non-exhaustive annotations provide the intended API extensibility; no actionable defects were found by source review, though builds and tests were not run as instructed.

  • Rounds: 1; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 14, 2026 05:15
Challenge, Proof, EnrollRequest, Enrollment, and Member are #[non_exhaustive]
with constructors, so a later field is additive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A mesh enrollment reply can grow feat(moq-auth)!: a mesh enrollment reply can grow Nov 14, 2026
@kixelated
kixelated marked this pull request as ready for review November 14, 2026 13:41
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de64cc3e-d2b5-4a0f-b0e3-826e3209788a
Commits

Reviewing files that changed from the base of the PR and between 77c9ca5 and 1e7c53d.

Files selected for processing: 7

  • quest/m2/README.md
  • quest/m2/api-mesh-enrollment.md
  • quest/m2/mesh-grant-shape.md
  • quest/m3/mesh/README.md
  • rs/moq-auth/src/mesh/client.rs
  • rs/moq-auth/src/mesh/coordinator.rs
  • rs/moq-auth/src/mesh/mod.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the full diff: it fences the remaining moq_auth::mesh contract structs and moves the in-crate builders onto constructors.

  • #[non_exhaustive] on five structs: Challenge, Proof, EnrollRequest, Enrollment, and Member are now fenced, so every public struct and enum in rs/moq-auth/src/mesh/ is now covered.
  • Constructors: Challenge::new, EnrollRequest::new, Enrollment::new, and Member::new take the required fields. Optional fields (name, relays, members, tags) stay public and mutable, the same pattern as Config::new.
  • Call sites: Coordinator::challenge, the enrollment build in coordinator.rs, and Client::enroll produce the same field values as before. Serde attributes are unchanged, so the wire format is the same.
  • Quest bookkeeping: deletes quest/m2/api-mesh-enrollment.md and updates the links that pointed to it.

No crate outside moq-auth builds or destructures these types. The struct literals left in contract_tests.rs and the coordinator tests are allowed because they are inside the crate.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated

Copy link
Copy Markdown
Collaborator Author

Closing unmerged: the maintainer moved mesh enrollment to Kixel on 2026-11-14, and moq-dev/moq#8756 removes moq_auth::mesh from moq. Kixel's coordinator already has its own certificate-based contract, so this change has no consumer to port to.

(Written by Opus 5.5)

@kixelated kixelated closed this Nov 14, 2026
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