Docs: step-by-step recipe for giving a node a custom role

Open Beginner friendly
#957 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
documentation

Research direction

Start by checking the getting-started path and the reference pages that cover node enrollment, roles, and policy bindings, then choose a suitable location under guides/. Write a step-by-step recipe for enrolling a node, finding its peer ID, binding a role, and verifying access; explain that policy bindings grant effective access even when the credential lists only mesh:role:node. Done when the recipe includes the commands, expected wait behavior, and successful and forbidden call checks.

Written by the indexing model from the issue text.

Description

agentmesh-node always requests mesh:role:node (RequiredRole: api.RoleNode), and the control plane requires the requested role to match the bootstrap token's role. That's the intended design. But it means a token minted with agentmesh-one token create --role caller can't enroll an agentmesh-node, and nothing in the getting-started path says so.

The supported route works well, but you have to assemble it from several reference pages. A short recipe would help:

  1. Mint a plain node token and enroll once: agentmesh-node join <url> --bootstrap-token-path tok --data-dir ./n1.
  2. Start it with run, without the token flag.
  3. Get the peer ID: the PeerID: line in the startup log, or GET /debug/mesh-info on the node's API with its token. (/mesh/identity answers only over the socket or mTLS.)
  4. Bind the role by peer ID: add {"role": "caller", "members": ["node:<peer-id>"]} to bindings and POST /policies with the admin token.
  5. No restart is needed. In a single test run, a new grant took effect in about 2 s and a removal in about 50 s.
  6. Verify with a call that should succeed and one that should get a 403.

Worth stating explicitly in the recipe: the binding grants access through policy evaluation, so a renewed credential can still list only mesh:role:node while the binding authorizes the call. Anyone building a "what can this node do" view needs to read effective grants from the policy, not the roles printed in the credential.

I can write this as a docs PR under guides/ if that's useful.

Dominant language
Go
Stars
1.2k
Forks
207
Avg merge
1d 10h
Merged PRs (30d)
85

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/agentmesh

All issues in google/agentmesh

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.