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

Aperta Adatta ai principianti
#957 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
documentation

Direzione di ricerca

Inizia controllando il percorso introduttivo e le pagine di riferimento che trattano la registrazione dei nodi, i ruoli e le associazioni delle policy, quindi scegli una posizione adatta sotto guides/. Scrivi una procedura dettagliata per registrare un nodo, trovare il suo ID peer, associare un ruolo e verificare l’accesso; spiega che le associazioni delle policy concedono l’accesso effettivo anche quando la credenziale elenca solo mesh:role:node. La procedura è completa quando include i comandi, il comportamento di attesa previsto e i controlli per le chiamate consentite e vietate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
1.2k
Fork
207
Merge medio
1g 10h
PR unite (30g)
85

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google/agentmesh

Tutte le issue di google/agentmesh

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.