Repository navigation
feat(openclaw-id): member roles are opaque names in the protocol - #197697
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR permits opaque member-role names, requires exact invite-role approval, and denies Gateway access for names without a permission policy. Example: An owner signs an invitation assigning acct_bob the role guest.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open as a useful, owner-directed protocol foundation. Current main still fixes member roles to operator and viewer; inspection found no discrete introduced correctness bug. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSigned invitations and membership changes enter the shared protocol authority; stored membership feeds Discovery snapshots, Gateway admission and recovery checks, and role labels in the Control UI. flowchart LR
A[Owner signed invitation] --> B[Protocol validation]
B --> C[Membership authority]
C --> D[Discovery snapshot]
C --> E[Gateway role policy]
E --> F[Request and recovery admission]
C --> G[Control UI role labels]
Technical reviewBest possible solution: Keep protocol names opaque and Gateway permissions authoritative, preserving built-in access while coordinating new-name publication with Discovery and loader support. Do we have a high-confidence way to reproduce the issue? This is a capability addition, and current-main source directly establishes the operator/viewer restriction; no target code was executed. Is this the best way to solve the issue? The implementation uses the existing protocol validator and membership authority, with one shared Gateway admission predicate; it is a coherent first stage without adding configurable permissions prematurely. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 83e3641e0921. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +217, Tests +353, Docs +25. Total +595 across 27 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 12, 2026, 6:03 AM ET / 11:03 UTC. |
8723304 to
82b2811
Compare
Live proof on the staging testnet (build
|
| Check | Result |
|---|---|
| Owner signs in, saves the recovery kit and reaches the Control UI over the tunnel | pass; owner gets six scopes including admin |
| Owner invites an operator; member redeems; owner approves | pass; signed approval carries the exact invite role; operator scopes exclude admin |
| Owner invites a viewer; member redeems; owner approves | pass; signed approval carries the exact invite role; only operator.read granted |
| Discovery and loader after both grants | pass; snapshots published; loader shows Operator / Viewer |
| Approval role differs from invite, in either direction | refused with target_mismatch; invitation and membership seq unchanged |
Owner changes viewer to guest with a signed statement |
accepted as opaque membership data; fresh Gateway WebSocket connect refused and ordinary HTTP returns 401 |
| Guest calls membership, statements, invites, node-invites or signout tunnel API | every route returns 403 not_admitted; no token/seq change or sign-out side effect |
| Owner/operator while Discovery rejects the guest snapshot | both still connect with their normal scopes |
| Restore viewer | snapshot publication recovers; viewer reconnects read-only |
| Owner removes viewer | connection cut; claw disappears from that member's list |
Staging Discovery still has the closed role validator. Its response to the guest snapshot was HTTP 400 invalid_statement, “expected one of operator, viewer.” The Gateway reported the failed publication without changing its own membership authority. This is the expected deployed-service incompatibility; restoring viewer recovered publication.
Afterwards the throwaway claw was retired in Discovery staging (no claw, member, relay-key or live-hostname rows remain), all test-account issuer sessions were revoked, browsers closed, and the isolated Gateway, state and checkout were removed. No shared claw was changed.
Separate observations: the old test harness needed updates for current UI controls; the model-free fixture displays its existing model-setup/empty-session UI. Guest/removal denial is proven by the protocol receipts—the browser displayed “Reconnecting…” rather than a dedicated refusal screen. No chat turn, node enrollment or retained/recovered run was exercised by this live fixture.
|
Merged via squash.
|
…nclaw#197697) * fix(openclaw-id): carry opaque member roles with exact invite grants * fix(openclaw-id): enforce role admission on tunnel HTTP API
What Problem This Solves
OpenClaw ID members can only be
operatororviewer, because the protocol package fixes that list and ranks the two. Owners need roles between those two and roles of their own, which a closed, ordered list in the signed protocol cannot carry.User Impact
User impact: none yet. Operator and viewer members, owner devices and nodes behave as before, and the Access page still offers Operator and Viewer. A member whose role name the Gateway does not know is refused access.
OpenClaw ID is a Labs feature and its protocol is an unreleased v1 draft, so this changes the draft schema with no version bump. Discovery and the claw loader carry their own copy of the protocol and must update before any claw publishes a role other than
operatororviewer.Why This Change Was Made
-and_, starting with a letter. The same validator covers invites, theaddandset_roleoperations, and membership snapshots.operatorandviewer. Any other role name is refused at WebSocket connect, on Gateway HTTP, on the tunnel API (/_openclaw-id/v1/*), and for retained and recovered runs. Stored membership keeps the name, so a later change can define what it allows.This is the first step of customizable member roles. Resolving role names from
gateway.roles.definitionscomes in a follow-up.Evidence
tunnel-principal,tunnel-api,remote-signout(21 tests),server.auth.openclaw-id-tunnel.test.ts(20) andoperator-run-recovery.test.ts(41) pass. New tests cover refusal of an unknown role at connect, HTTP, every tunnel API route and recovery.tsgofor core, UI and extensions, scoped lint, format and the line ratchets pass.Not run: the full repository suite, a live tunnel or Discovery end-to-end test, and browser screenshots (no visible UI change for existing roles).