MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetBootstrapToken

Method SetBootstrapToken

internal/server/bootstrap.go:146–151  ·  view source on GitHub ↗

SetBootstrapToken wires the in-memory token + on-disk path into the Server. Called once at startup from cmd/pad/main.go after EnsureBootstrapToken succeeds. Empty token is allowed (means: no token configured — used when EnsureBootstrapToken failed or when the instance is in cloud mode).

(token, path string)

Source from the content-addressed store, hash-verified

144// token configured — used when EnsureBootstrapToken failed or when the
145// instance is in cloud mode).
146func (s *Server) SetBootstrapToken(token, path string) {
147 s.bootstrapMu.Lock()
148 defer s.bootstrapMu.Unlock()
149 s.bootstrapToken = secret.New(token)
150 s.bootstrapTokenPath = path
151}
152
153// hasBootstrapToken reports whether a bootstrap token is currently
154// configured. Lock-aware — safe to call without holding s.bootstrapMu.

Calls 3

NewFunction · 0.92
LockMethod · 0.80
UnlockMethod · 0.80