Documentation
¶
Overview ¶
Package meshjoin hosts the spec-024 enrollment endpoints on the hub daemon:
POST /api/mesh/join worker enrollment (code-authenticated)
POST /api/mesh/invite admin: mint invite (loopback only)
DELETE /api/mesh/machines/{name} admin: remove peer (loopback only)
Enrollment is plain CRUD — zero model calls. The package touches execution only through exec/cluster (hot transport add/remove) and exec/remote (the transport it installs); it never imports a provider runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Live *machines.Live // shared registry pointer (placer/cluster/roster)
RegistryPath string // managed machines.yaml path
Managed bool // false ⇒ FORT_MACHINES set ⇒ refuse writes
Cluster *cluster.Runtime // hot Add/Remove of peer transports
Store *store.Store // invites + events
Tokens *TokenStore
NodeName string // hub identity
Port string // hub bind port (for detectHubURL)
ProbeAgents func() []string // $PATH provider probe, injected
Resolve func(string) ([]net.IP, error) // DNS resolver for advertise hostnames; nil ⇒ net.LookupIP
Now func() time.Time // injectable clock
Log *slog.Logger
// contains filtered or unexported fields
}
Server wires the enrollment handlers to the daemon's live state. All fields are set by the composition root (cmd/fort) before Register.
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore holds the mesh token for live readers (node auth, outbound remotes) and persists it to node.yaml on first mint (spec 024 bootstrap).
func NewTokenStore ¶
func NewTokenStore(initial, dataDir, name, addr string) *TokenStore
func (*TokenStore) Ensure ¶
func (t *TokenStore) Ensure() (tok string, minted bool, err error)
Ensure returns the token, minting and persisting it on first use. minted reports whether this call created it (the caller prints the hub-now-accepts-exec notice exactly once).
func (*TokenStore) Get ¶
func (t *TokenStore) Get() string
Get returns the current token ("" until minted or configured).