The engine dials as enrol.<node> on the pinned certificate, calls redeem with the public halves of its keys and a proof over them (the SDK's RedeemProof, which binds the node and the keys and never the token's secret), asks again while the holder says to, and verifies the vault's answer against the key its token carries before it keeps anything: an answer signed by another key, naming another signer or node, or altered is refused and nothing is kept. A signed one is kept (membership, login, keys), then the node dials as the login it was given, reads its key of node-logins, and calls confirm; nothing is applied until its placement names a module. When the bus does not serve the seat to the token (the controller still holds its lease) the controller's enrolment subject is used as before. The token's shape is mesh-sdk's now: identity keeps its names as aliases. Tests: one added, paid by merging three identity token tests into one (net two fewer). (issue 774, 774/S64) Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
16 lines
842 B
Go
16 lines
842 B
Go
package identity
|
|
|
|
import "git.novox.be/novox/mesh-sdk/go/delivery"
|
|
|
|
// Token is what a person carries to a machine that is joining (novox/hq ADR 0004): where the broker is, what certificate to
|
|
// expect there, whose signature to believe afterwards, and a one-time right to join. Its shape and its reading are mesh-sdk's
|
|
// (delivery.Token), which the vault that makes it, mesh-cli that opens it and this engine that parses it share (novox/hq ADR
|
|
// 0587 §3, issue 774); these are the names this package has always had for them.
|
|
type Token = delivery.Token
|
|
|
|
// TokenTunnel is the joining machine's side of its first tunnel (delivery.TokenTunnel).
|
|
type TokenTunnel = delivery.TokenTunnel
|
|
|
|
// ParseToken reads a token a person pasted (delivery.ParseToken).
|
|
func ParseToken(encoded string) (Token, error) { return delivery.ParseToken(encoded) }
|