Documentation
¶
Index ¶
- Constants
- Variables
- func RecoveredPanicCount() uint64
- type AuditEntry
- type BeaconStatsProvider
- type BlueprintAuditExport
- type BlueprintIdentityProvider
- type BlueprintPolicy
- type BlueprintRole
- type BlueprintWebhooks
- type DashboardStats
- type DeltaEntry
- type DeltaType
- type DirectoryEntry
- type DirectorySyncRequest
- type DirectorySyncResult
- type Handler
- type HandshakeRelayMsg
- type HandshakeResponseMsg
- type KeyInfo
- type NetworkBlueprint
- type NetworkInfo
- type NetworkInvite
- type NetworkPolicy
- type NetworkSampleEntry
- type NetworkStats
- type NodeInfo
- type ProbeState
- type RateLimiter
- type RegistryWebhookEvent
- type ReleaseBanner
- type Role
- type Server
- func (s *Server) AddRequest()
- func (s *Server) Addr() net.Addr
- func (s *Server) AdminKickMember(netID uint16, nodeID uint32, reason string) error
- func (s *Server) AdminListMembers(netID uint16) ([]dashpkg.MemberSnapshot, error)
- func (s *Server) AdminListNetworks() []dashpkg.NetworkSnapshot
- func (s *Server) AdminSetMemberRole(netID uint16, nodeID uint32, role, reason string) error
- func (s *Server) AdminToken() string
- func (s *Server) ApplyBlueprint(bp *identpkg.NetworkBlueprint, adminToken string) (*identpkg.ProvisionResult, error)
- func (s *Server) BreakerAllow(name string) (bool, string)
- func (s *Server) BreakerDelete(name string) error
- func (s *Server) BreakerList() []dashpkg.BreakerListEntry
- func (s *Server) BreakerManager() *breakerspkg.Manager
- func (s *Server) BreakerSet(name, state, reason string) error
- func (s *Server) BuildInfo() map[string]string
- func (s *Server) CheckAdminToken(msg map[string]interface{}) error
- func (s *Server) Close() error
- func (s *Server) ConnCount() int64
- func (s *Server) ForceRotateKey(id uint32, newPubKey []byte, rotatedAt time.Time) (oldPubKeyB64 string, err error)
- func (s *Server) GetAuditExportConfig() *identpkg.BlueprintAuditExport
- func (s *Server) GetDashboardStats() DashboardStats
- func (s *Server) GetDashboardStatsExtended() DashboardStats
- func (s *Server) GetDashboardStatsWithHistory() DashboardStats
- func (s *Server) GetIdentityProviderConfig() *identpkg.BlueprintIdentityProvider
- func (s *Server) GetIdentityWebhookSecret() string
- func (s *Server) GetIdentityWebhookURL() string
- func (s *Server) GetPulseSamples() []interface{}
- func (s *Server) GetRecoveryEnrollment(id uint32) (commitment, provider string, ok bool)
- func (s *Server) HandleBinaryHeartbeat(conn net.Conn, payload []byte)
- func (s *Server) HandleBinaryLookup(conn net.Conn, payload []byte, host string)
- func (s *Server) HandleBinaryResolve(conn net.Conn, payload []byte, host string)
- func (s *Server) HandleMessage(msg map[string]interface{}, remoteAddr string) (map[string]interface{}, error)
- func (s *Server) HandleSubscribeReplication(conn net.Conn)
- func (s *Server) HealthSnapshot() map[string]any
- func (s *Server) IsStandby() bool
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) LookupNode(id uint32) (pubKey []byte, networks []uint16, ok bool)
- func (s *Server) LookupNodeFull(id uint32) (pubKey []byte, keyMeta identpkg.KeyInfo, networks []uint16, ...)
- func (s *Server) LookupNodeKey(id uint32) (pubKey []byte, ok bool)
- func (s *Server) LookupPublicKey(nodeID uint32) ([]byte, bool)
- func (s *Server) MaintenanceBanner() string
- func (s *Server) NodeAddrs(nodeA, nodeB uint32) (addrA string, okA bool, addrB string, okB bool)
- func (s *Server) NodeIsEnterprise(id uint32) bool
- func (s *Server) NodePubKeyAndAdminToken(nodeID uint32) (pubKey []byte, adminToken string, ok bool)
- func (s *Server) Now() time.Time
- func (s *Server) PromoteToPrimary() error
- func (s *Server) RateLimitWhitelistSize() int
- func (s *Server) Ready() <-chan struct{}
- func (s *Server) Reap()
- func (s *Server) ReplicationToken() string
- func (s *Server) RunStandby(primaryAddr string)
- func (s *Server) ServeDashboard(addr string) error
- func (s *Server) SetAdminToken(token string)
- func (s *Server) SetBackupsCallback(fn func() ([]dashpkg.BackupEntry, error))
- func (s *Server) SetBannerPath(path string)
- func (s *Server) SetBeaconStats(b BeaconStatsProvider)
- func (s *Server) SetBreakersPath(path string)
- func (s *Server) SetBuildInfo(info map[string]string)
- func (s *Server) SetClock(fn func() time.Time)
- func (s *Server) SetDashboardHTTPAddr(addr string)
- func (s *Server) SetDashboardToken(token string)
- func (s *Server) SetIdentityWebhookSecret(secret string)
- func (s *Server) SetIdentityWebhookURL(url string)
- func (s *Server) SetLogLevelCallbacks(get func() string, set func(string) error)
- func (s *Server) SetMaintenanceBanner(msg string)
- func (s *Server) SetMaxConnections(max int64)
- func (s *Server) SetMaxNodes(n int)
- func (s *Server) SetRateLimitWhitelist(entries []acceptpkg.WhitelistEntry) error
- func (s *Server) SetRecoveryEnrollment(id uint32, commitment, provider string) (ok bool)
- func (s *Server) SetReplicationToken(token string)
- func (s *Server) SetStaleNodeThreshold(d time.Duration)
- func (s *Server) SetStandby(primary string)
- func (s *Server) SetTLS(certFile, keyFile string) error
- func (s *Server) SetWebhookRetryBackoff(d time.Duration)
- func (s *Server) SetWebhookURL(url string)
- func (s *Server) SetWhitelistCallbacks(get func() ([]byte, error), set func([]byte) error)
- func (s *Server) ShouldLog(key string) (bool, int64)
- func (s *Server) StaleNodeThreshold() time.Duration
- func (s *Server) SubmitBadge(id uint32, badge, badgeSig, provider string, verifiedAt time.Time) (ok bool)
- func (s *Server) SyncTimestamp(netID uint16) time.Time
- func (s *Server) Term() uint64
- func (s *Server) TriggerSnapshot() error
- func (s *Server) UpdateNodeExternalID(id uint32, externalID string) (oldID string, ok bool)
- func (s *Server) UpdateNodeKey(id uint32, expectedPubKey, newPubKey []byte, rotatedAt time.Time) (oldPubKeyB64 string, err error)
- func (s *Server) UpdateNodeKeyExpiry(id uint32, expiresAt time.Time) (oldExpiry time.Time, ok bool)
- func (s *Server) VerifyHeartbeatSignature(pubKey []byte, adminToken string, msg map[string]interface{}, challenge string) error
- func (s *Server) VerifyPunchSignature(pubKey []byte, adminToken string, msg map[string]interface{}, challenge string) error
- type StatsSample
- type WAL
Constants ¶
const ( DeltaRegister = walpkg.DeltaRegister DeltaDeregister = walpkg.DeltaDeregister DeltaHeartbeat = walpkg.DeltaHeartbeat DeltaTrustAdd = walpkg.DeltaTrustAdd DeltaTrustRevoke = walpkg.DeltaTrustRevoke DeltaVisibility = walpkg.DeltaVisibility DeltaHostname = walpkg.DeltaHostname DeltaTags = walpkg.DeltaTags DeltaNetworkCreate = walpkg.DeltaNetworkCreate DeltaNetworkJoin = walpkg.DeltaNetworkJoin DeltaNetworkLeave = walpkg.DeltaNetworkLeave DeltaKeyRotation = walpkg.DeltaKeyRotation DeltaTaskExec = walpkg.DeltaTaskExec DeltaNetworkDelete = walpkg.DeltaNetworkDelete )
Re-export the delta-type constants so existing server code compiles without qualification changes.
const ( RoleOwner = membpkg.RoleOwner RoleAdmin = membpkg.RoleAdmin RoleMember = membpkg.RoleMember )
const MaxWALSize = walpkg.MaxWALSize
MaxWALSize is the upper bound enforced by WAL.Append. Exposed for tests.
Variables ¶
var ( LoadBlueprint = wire.LoadBlueprint ValidateBlueprint = wire.ValidateBlueprint )
var ErrWALFull = walpkg.ErrWALFull
ErrWALFull is returned by WAL.Append when the size cap is exceeded.
Functions ¶
func RecoveredPanicCount ¶
func RecoveredPanicCount() uint64
RecoveredPanicCount returns the total number of panics swallowed by recoverHandler since process start. Used by metrics.go for the gauge.
Types ¶
type AuditEntry ¶
AuditEntry is an alias for audit.Entry, kept here so existing code and tests in package server can reference AuditEntry without import changes.
type BeaconStatsProvider ¶
type BeaconStatsProvider = dashpkg.BeaconStatsProvider
BeaconStatsProvider is an alias for dashpkg.BeaconStatsProvider (moved in R5.2).
type BlueprintAuditExport ¶
type BlueprintAuditExport = wire.BlueprintAuditExport
Blueprint types — canonical definitions live in pkg/registry/wire.
type BlueprintIdentityProvider ¶
type BlueprintIdentityProvider = wire.BlueprintIdentityProvider
Blueprint types — canonical definitions live in pkg/registry/wire.
type BlueprintPolicy ¶
type BlueprintPolicy = wire.BlueprintPolicy
Blueprint types — canonical definitions live in pkg/registry/wire.
type BlueprintRole ¶
type BlueprintRole = wire.BlueprintRole
Blueprint types — canonical definitions live in pkg/registry/wire.
type BlueprintWebhooks ¶
type BlueprintWebhooks = wire.BlueprintWebhooks
Blueprint types — canonical definitions live in pkg/registry/wire.
type DashboardStats ¶
type DashboardStats = dashpkg.DashboardStats
DashboardStats is an alias for dashpkg.DashboardStats (moved in R5.2).
type DeltaEntry ¶
type DeltaEntry = walpkg.DeltaEntry
DeltaEntry records a single state mutation for incremental replication. This is an alias for the canonical definition in the wal sub-package (R6.1).
type DeltaType ¶
DeltaType identifies what kind of mutation a delta represents. This is an alias for the canonical definition in the wal sub-package (R6.1).
type DirectoryEntry ¶
type DirectoryEntry = replpkg.DirectoryEntry
DirectoryEntry is an alias for replpkg.DirectoryEntry. Kept here so existing server code and any external callers are unchanged.
type DirectorySyncRequest ¶
type DirectorySyncRequest = replpkg.DirectorySyncRequest
DirectorySyncRequest is an alias for replpkg.DirectorySyncRequest.
type DirectorySyncResult ¶
type DirectorySyncResult = replpkg.DirectorySyncResult
DirectorySyncResult is an alias for replpkg.DirectorySyncResult.
type Handler ¶
type Handler func(s *Server, msg map[string]interface{}, remoteAddr string) (map[string]interface{}, error)
Handler is the unified shape of every registry message handler invoked by the dispatch table. Each entry in `handlers` maps a wire `msgType` (e.g. "register", "create_network", ...) to a thin closure that calls the corresponding `s.handleX(...)` method on *Server.
Handlers themselves stay defined as methods on *Server (in server.go and related files); this layer only routes msgType -> handler.
type HandshakeRelayMsg ¶
type HandshakeRelayMsg = trustpkg.HandshakeRelayMsg
type HandshakeResponseMsg ¶
type HandshakeResponseMsg = trustpkg.HandshakeResponseMsg
type NetworkBlueprint ¶
type NetworkBlueprint = wire.NetworkBlueprint
Blueprint types — canonical definitions live in pkg/registry/wire.
type NetworkInfo ¶
type NetworkInfo = membpkg.NetworkInfo
type NetworkInvite ¶
type NetworkInvite = membpkg.NetworkInvite
type NetworkPolicy ¶
type NetworkPolicy = membpkg.NetworkPolicy
type NetworkSampleEntry ¶
type NetworkSampleEntry = dashpkg.NetworkSampleEntry
NetworkSampleEntry is an alias for dashpkg.NetworkSampleEntry (moved in R5.2).
type NetworkStats ¶
type NetworkStats = dashpkg.NetworkStats
NetworkStats is an alias for dashpkg.NetworkStats (moved in R5.2).
type ProbeState ¶
type ProbeState = dashpkg.ProbeState
ProbeState is an alias for dashboard.ProbeState, kept here so the snapshot struct and tests in package server can reference ProbeState without changes.
type RateLimiter ¶
type RateLimiter = acceptpkg.RateLimiter
func NewRateLimiter ¶
func NewRateLimiter(rate int, window time.Duration, maxBuckets int) *RateLimiter
type RegistryWebhookEvent ¶
type RegistryWebhookEvent = webhookpkg.Event
type ReleaseBanner ¶
type ReleaseBanner = dashpkg.ReleaseBanner
ReleaseBanner is an alias for dashpkg.ReleaseBanner (R5.2). Kept here so existing code in package server that references ReleaseBanner still compiles.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewWithStore ¶
func (*Server) AddRequest ¶
func (s *Server) AddRequest()
AddRequest satisfies accept.Dispatcher. Increments the server-level request counter.
func (*Server) AdminKickMember ¶ added in v0.2.5
AdminKickMember removes nodeID from the network's member list and role map without any of the protocol's network-role gates — the operator (admin token holder) is the highest authority by definition. The owner cannot be kicked through this path; transfer ownership first.
Emits a "network.admin_kick" audit entry with the operator-supplied reason, invalidates the list_nodes cache for the network, publishes a membership.changed bus event, and triggers a snapshot save.
Returns protocol.ErrNetworkNotFound on unknown networks. Returns an error when nodeID is the owner or is not a member of the network.
func (*Server) AdminListMembers ¶ added in v0.2.5
func (s *Server) AdminListMembers(netID uint16) ([]dashpkg.MemberSnapshot, error)
AdminListMembers returns a snapshot of every member of the given network along with their role, hostname (if registered), and last-seen unix time. Bypasses the protocol's network-role RBAC: the caller has already been authenticated by the dashboard's requireAdminToken middleware, so the operator's admin token is the only authority that matters here.
Returns protocol.ErrNetworkNotFound when netID is unknown.
func (*Server) AdminListNetworks ¶ added in v0.2.5
func (s *Server) AdminListNetworks() []dashpkg.NetworkSnapshot
AdminListNetworks returns a snapshot of every network the registry knows about: numeric ID, name, member counts broken down by role, and flags. Powers the dashboard's network picker — the per-metric rollup keyed by label is name-only, but management endpoints need numeric IDs.
Read-only, RLock-only. Safe to call concurrently with any handler.
func (*Server) AdminSetMemberRole ¶ added in v0.2.5
AdminSetMemberRole updates the per-network role for nodeID. The role string must be "admin" or "member" (case-insensitive); anything else is rejected before the lock is taken. The owner role cannot be assigned or removed through this path — use the protocol's transfer_ownership flow.
Emits a "network.admin_set_role" audit entry, invalidates the list_nodes cache, publishes a membership.changed event, and triggers a snapshot save.
Returns protocol.ErrNetworkNotFound on unknown networks.
func (*Server) AdminToken ¶
AdminToken satisfies trustpkg.NodeView. It returns the current global admin token. Safe for concurrent use.
func (*Server) ApplyBlueprint ¶
func (s *Server) ApplyBlueprint(bp *identpkg.NetworkBlueprint, adminToken string) (*identpkg.ProvisionResult, error)
func (*Server) BreakerAllow ¶ added in v0.2.5
BreakerAllow is a convenience adapter matching the func(name) (allowed, reason) shape that out-of-package call sites (the in-process beacon, the WSS bridge) want when consulting the breakers. Returning the reason here lets sites surface it in any log line or error response without taking a second lookup. Unknown names default to allow (matches Manager.Allow semantic).
func (*Server) BreakerDelete ¶ added in v0.2.5
BreakerDelete removes one breaker. Counters are preserved so post-incident review still shows what flowed through the gate. Emits an audit-log entry. Persists the new (smaller) map to disk.
func (*Server) BreakerList ¶ added in v0.2.5
func (s *Server) BreakerList() []dashpkg.BreakerListEntry
BreakerList returns the live per-name snapshot for /api/breakers (state + reason + counters + last-denied timestamp). Adapter to the shape dashboard.Callbacks expects. Never panics; an empty manager returns an empty slice.
func (*Server) BreakerManager ¶ added in v0.2.4
func (s *Server) BreakerManager() *breakerspkg.Manager
BreakerManager returns the Server's named-breaker manager. Call sites inside the rendezvous binary consult breakers via this manager (e.g. s.breakers.Allow("registry.register")); cmd/rendezvous wires the file watcher against it so operator edits to breakers.json hot- reload without restart. Never returns nil for a properly-constructed Server.
func (*Server) BreakerSet ¶ added in v0.2.5
BreakerSet upserts one breaker by name + state + operator reason. Returns an error when state is unrecognised so the API caller gets a clean 400 rather than silently treating a typo as Closed. Applies the change in-memory immediately, then persists the full breaker map to breakersPath (if set) so the change survives restart. Emits an audit-log entry for the change.
func (*Server) BuildInfo ¶ added in v0.2.5
BuildInfo returns a copy of the recorded build identity, or nil if none was registered. Safe to call concurrently.
func (*Server) CheckAdminToken ¶
CheckAdminToken satisfies identpkg.NodeView. Returns nil if the message carries a valid admin token.
func (*Server) ConnCount ¶
ConnCount returns the current number of active connections (for testing).
func (*Server) ForceRotateKey ¶ added in v0.2.5
func (s *Server) ForceRotateKey(id uint32, newPubKey []byte, rotatedAt time.Time) (oldPubKeyB64 string, err error)
ForceRotateKey satisfies identpkg.NodeView. Swaps the public key WITHOUT an old-key stale-check — used only by identity recovery, authorized by a cold-key-signed recovery statement rather than the old key.
func (*Server) GetAuditExportConfig ¶
func (s *Server) GetAuditExportConfig() *identpkg.BlueprintAuditExport
func (*Server) GetDashboardStats ¶
func (s *Server) GetDashboardStats() DashboardStats
GetDashboardStats returns aggregate statistics for the dashboard.
func (*Server) GetDashboardStatsExtended ¶
func (s *Server) GetDashboardStatsExtended() DashboardStats
GetDashboardStatsExtended returns dashboard stats including per-network breakdowns. Requires the dashboard token — only called from the token-gated API path.
func (*Server) GetDashboardStatsWithHistory ¶
func (s *Server) GetDashboardStatsWithHistory() DashboardStats
GetDashboardStatsWithHistory returns aggregate statistics plus history charts. Used on the unauthenticated public endpoint — version distribution is omitted to avoid advertising what clients run.
func (*Server) GetIdentityProviderConfig ¶
func (s *Server) GetIdentityProviderConfig() *identpkg.BlueprintIdentityProvider
func (*Server) GetIdentityWebhookSecret ¶ added in v0.2.2
GetIdentityWebhookSecret returns the current identity webhook HMAC secret.
func (*Server) GetIdentityWebhookURL ¶
func (*Server) GetPulseSamples ¶
func (s *Server) GetPulseSamples() []interface{}
GetPulseSamples returns the ordered pulse samples from the dashboard Handler's ring.
func (*Server) GetRecoveryEnrollment ¶ added in v0.2.5
GetRecoveryEnrollment satisfies identpkg.NodeView.
func (*Server) HandleBinaryHeartbeat ¶
HandleBinaryHeartbeat satisfies accept.Dispatcher.
func (*Server) HandleBinaryLookup ¶
HandleBinaryLookup satisfies accept.Dispatcher.
func (*Server) HandleBinaryResolve ¶
HandleBinaryResolve satisfies accept.Dispatcher.
func (*Server) HandleMessage ¶
func (s *Server) HandleMessage(msg map[string]interface{}, remoteAddr string) (map[string]interface{}, error)
HandleMessage satisfies accept.Dispatcher. It dispatches a decoded JSON message and returns the response map.
func (*Server) HandleSubscribeReplication ¶
HandleSubscribeReplication satisfies accept.Dispatcher. It takes over the conn for replication streaming.
func (*Server) HealthSnapshot ¶ added in v0.2.5
HealthSnapshot returns the operator-facing process health bundle served by /api/health. Mostly atomic-field loads, plus a few subsystem queries — WAL size, the breaker snapshot, and replMgr.SubCount(). Those queries take their own short subsystem locks (the WAL mutex, the breaker mutex, the replication manager's sub lock), all uncontended fast paths — but the probe does NOT take the hot registry mutex (s.mu), so it never blocks behind a save in flight. Missing subsystems (no WAL, no replication) are omitted from the payload entirely.
func (*Server) ListenAndServe ¶
func (*Server) LookupNode ¶
func (*Server) LookupNodeFull ¶
func (s *Server) LookupNodeFull(id uint32) (pubKey []byte, keyMeta identpkg.KeyInfo, networks []uint16, externalID, owner string, ok bool)
LookupNodeFull satisfies identpkg.NodeView. Returns identity-related fields.
func (*Server) LookupNodeKey ¶
LookupNodeKey satisfies identpkg.NodeView. Returns the current public key.
func (*Server) LookupPublicKey ¶
LookupPublicKey returns the Ed25519 pubkey registered for nodeID, or (nil, false) if the node is unknown. Safe to call concurrently.
Used by the in-process beacon's compat-mode WSS bridge to authenticate daemons during the post-upgrade challenge. The key is copied before release so callers can hold the result past the lock.
func (*Server) MaintenanceBanner ¶
func (*Server) NodeAddrs ¶
NodeAddrs returns the RealAddr of nodeA and nodeB using shard locks. Implements routing.PunchBackend.
func (*Server) NodeIsEnterprise ¶
NodeIsEnterprise satisfies identpkg.NodeView. Returns true if the node belongs to at least one enterprise network.
func (*Server) NodePubKeyAndAdminToken ¶
NodePubKeyAndAdminToken returns the public key and admin token for the given node. Implements routing.PunchBackend.
func (*Server) Now ¶
Now satisfies identpkg.NodeView. Returns the current time via the server-overridable clock (supports testing).
func (*Server) PromoteToPrimary ¶ added in v0.2.4
PromoteToPrimary increments the replication term and persists it, fencing off a stale former primary. Safe to call on any server that should become the sole write master. (PILOT-328)
func (*Server) RateLimitWhitelistSize ¶ added in v0.2.4
RateLimitWhitelistSize returns the number of installed whitelist rules.
func (*Server) Reap ¶
func (s *Server) Reap()
Reap triggers stale node and beacon cleanup (for testing).
func (*Server) ReplicationToken ¶
ReplicationToken satisfies accept.Dispatcher. Returns the current replication auth token; empty string means replication is disabled. Delegated to walStore (R6.1).
func (*Server) RunStandby ¶
RunStandby connects to a primary registry and receives replicated snapshots. On each snapshot, the standby updates its own state and persists to storePath. This blocks until the connection is lost, then retries with backoff.
func (*Server) ServeDashboard ¶
func (*Server) SetAdminToken ¶
SetAdminToken sets the token required for network creation. Empty string disables network creation entirely.
func (*Server) SetBackupsCallback ¶ added in v0.2.5
func (s *Server) SetBackupsCallback(fn func() ([]dashpkg.BackupEntry, error))
SetBackupsCallback plugs the backup-directory enumerator into the dashboard. The closure owns the directory path; only the cmd-level package knows it, so wiring happens after NewWithStore.
func (*Server) SetBannerPath ¶
SetBannerPath enables disk persistence for the maintenance banner. If the file exists when called, its content becomes the initial banner value.
func (*Server) SetBeaconStats ¶
func (s *Server) SetBeaconStats(b BeaconStatsProvider)
SetBeaconStats wires a BeaconStatsProvider into the registry so /api/stats can return relay-forward counts. Also installs the metrics-side adapter so pilot_beacon_relay_forwarded_total / _dropped_total / _not_found_total appear on /metrics. The adapter returns (0,0,0,false) when no beacon is wired so the scrape omits the metrics entirely instead of lying about traffic.
func (*Server) SetBreakersPath ¶ added in v0.2.5
SetBreakersPath registers the on-disk breakers.json path so the admin control API can persist its changes there. Setting it after the file watcher has started is safe: the watcher polls by mtime so the next tick picks up our atomic write as a no-op (we apply the same map in-process before writing).
func (*Server) SetBuildInfo ¶ added in v0.2.5
SetBuildInfo records the build-time identity surfaced on /api/public-stats for supply-chain verification. Must be called before Start; the resulting map is treated as immutable. Pass a copy to defend against callers mutating their input.
func (*Server) SetDashboardHTTPAddr ¶
func (*Server) SetDashboardToken ¶
SetDashboardToken gates per-network stats on the dashboard. Empty string restricts the dashboard to global aggregates only.
func (*Server) SetIdentityWebhookSecret ¶ added in v0.2.2
SetIdentityWebhookSecret sets the HMAC-SHA256 pre-shared secret for identity webhook request/response signing (PILOT-240).
func (*Server) SetIdentityWebhookURL ¶
SetIdentityWebhookURL sets the webhook URL used to verify identity tokens.
func (*Server) SetLogLevelCallbacks ¶ added in v0.2.5
SetLogLevelCallbacks plugs operator-installable callbacks into the dashboard handler that back GET/PUT /api/admin/runtime/log-level.
func (*Server) SetMaintenanceBanner ¶
SetMaintenanceBanner sets a notice rendered on the dashboard. Empty string clears it. If SetBannerPath was called, the value is atomically written to disk so it survives restart.
func (*Server) SetMaxConnections ¶
SetMaxConnections overrides the default connection limit. Used in tests to prevent port exhaustion.
func (*Server) SetMaxNodes ¶
SetMaxNodes caps the number of registered nodes. Zero means unlimited.
func (*Server) SetRateLimitWhitelist ¶ added in v0.2.4
func (s *Server) SetRateLimitWhitelist(entries []acceptpkg.WhitelistEntry) error
SetRateLimitWhitelist installs (or replaces) the rate-limit whitelist on the underlying Acceptor. Whitelisted CIDRs bypass the per-IP token bucket, the per-connection abusive-rate close (>500 req/s/conn), AND the process-wide global rate cap (~1000 req/s default). Use for operator-trusted internal infrastructure that legitimately drives high sustained load (presence simulators, traffic generators, the service-agents host running specialist agents, etc.).
Pass nil or empty slice to clear the whitelist. Fail-closed: returns an error on any malformed CIDR; the previous whitelist remains in place on error.
func (*Server) SetRecoveryEnrollment ¶ added in v0.2.5
SetRecoveryEnrollment satisfies identpkg.NodeView. Records the opaque identity commitment a future recovery must match.
func (*Server) SetReplicationToken ¶
SetReplicationToken sets the bearer token required for subscribe_replication. Empty string disables replication subscription entirely.
func (*Server) SetStaleNodeThreshold ¶
SetStaleNodeThreshold updates the threshold. Zero or negative values are ignored to prevent accidentally disabling staleness detection. Intended for one-time configuration at startup; safe to call concurrently with readers.
func (*Server) SetStandby ¶
SetStandby puts the server into standby mode: write operations are rejected and state is received from the given primary.
func (*Server) SetTLS ¶
SetTLS enables TLS. Empty certFile triggers automatic self-signed certificate generation.
func (*Server) SetWebhookRetryBackoff ¶
SetWebhookRetryBackoff sets the initial backoff for webhook retries. Tests set a short value to avoid waiting on retry exhaustion.
func (*Server) SetWebhookURL ¶
SetWebhookURL sets the endpoint for audit event POSTs. Empty string disables dispatching.
func (*Server) SetWhitelistCallbacks ¶ added in v0.2.5
SetWhitelistCallbacks plugs operator-installable callbacks into the dashboard handler that back GET/PUT /api/admin/whitelist. Called by cmd/rendezvous/main.go once the on-disk whitelist path is known.
func (*Server) ShouldLog ¶
ShouldLog delegates log-sampling to s.accept. Returns true if this occurrence of key should be logged, plus the suppressed count.
func (*Server) StaleNodeThreshold ¶
StaleNodeThreshold returns the current configured stale-node threshold. Hot path on online-count read sites; uses an atomic load.
func (*Server) SubmitBadge ¶ added in v0.2.5
func (s *Server) SubmitBadge(id uint32, badge, badgeSig, provider string, verifiedAt time.Time) (ok bool)
SubmitBadge satisfies identpkg.NodeView. Stores a verified-address badge.
func (*Server) SyncTimestamp ¶
SyncTimestamp returns the last directory sync time for a network.
func (*Server) TriggerSnapshot ¶
TriggerSnapshot manually triggers a snapshot save. This is useful for testing and for ensuring data is persisted before shutdown. Returns an error if the save fails, or nil if there's no storePath configured. TriggerSnapshot manually triggers a snapshot save. Delegated to walStore (R6.1).
func (*Server) UpdateNodeExternalID ¶
UpdateNodeExternalID satisfies identpkg.NodeView. Sets the external identity.
func (*Server) UpdateNodeKey ¶
func (s *Server) UpdateNodeKey(id uint32, expectedPubKey, newPubKey []byte, rotatedAt time.Time) (oldPubKeyB64 string, err error)
UpdateNodeKey satisfies identpkg.NodeView. Atomically swaps the public key if it still matches expectedPubKey (stale-check). Returns the old pubkey (base64-encoded) on success.
func (*Server) UpdateNodeKeyExpiry ¶
UpdateNodeKeyExpiry satisfies identpkg.NodeView. Sets/clears key expiry.
type StatsSample ¶
type StatsSample = dashpkg.StatsSample
StatsSample is an alias for dashpkg.StatsSample (moved in R5.2).
Source Files
¶
- apply_delta.go
- dashboard.go
- delta.go
- directory_sync.go
- dispatch.go
- identity.go
- metrics.go
- panic_recovery.go
- release_poller.go
- replication.go
- server.go
- server_api.go
- server_auth.go
- server_handlers.go
- server_lifecycle.go
- server_membership_admin.go
- server_persist.go
- server_stats.go
- server_test_helpers.go
- server_util.go
- wal.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package accept contains the TCP accept layer for the registry server: connection handling, TLS configuration, rate limiting, log sampling, and panic recovery.
|
Package accept contains the TCP accept layer for the registry server: connection handling, TLS configuration, rate limiting, log sampling, and panic recovery. |
|
Package api defines the read-only view contracts that observability (dashboard, metrics, audit, webhook) and auth gates consume from the registry's state stores (directory, membership, trust, policy, identity).
|
Package api defines the read-only view contracts that observability (dashboard, metrics, audit, webhook) and auth gates consume from the registry's state stores (directory, membership, trust, policy, identity). |
|
Package audit manages the registry audit log ring buffer and optional external export (Splunk HEC, syslog/CEF, plain JSON).
|
Package audit manages the registry audit log ring buffer and optional external export (Splunk HEC, syslog/CEF, plain JSON). |
|
Package authz provides authorization and signature-verification helpers for the registry server (R3.1 of the registry decomposition plan).
|
Package authz provides authorization and signature-verification helpers for the registry server (R3.1 of the registry decomposition plan). |
|
Package breakers provides named, dynamically-controllable on/off switches for individual functional surfaces of the rendezvous process.
|
Package breakers provides named, dynamically-controllable on/off switches for individual functional surfaces of the rendezvous process. |
|
cmd
|
|
|
registry
command
|
|
|
rendezvous
command
|
|
|
Package dashboard implements the HTTP dashboard server, probe loop, and pulse-sample ring for the Pilot Protocol registry.
|
Package dashboard implements the HTTP dashboard server, probe loop, and pulse-sample ring for the Pilot Protocol registry. |
|
Package directory implements the registry's node directory: registration, lookup, resolve, deregister, heartbeat, list-nodes, hostname/tag/visibility management, and the stale-node reaper.
|
Package directory implements the registry's node directory: registration, lookup, resolve, deregister, heartbeat, list-nodes, hostname/tag/visibility management, and the stale-node reaper. |
|
Package events provides an in-process publish/subscribe event bus for the registry server's internal layers to communicate without importing each other.
|
Package events provides an in-process publish/subscribe event bus for the registry server's internal layers to communicate without importing each other. |
|
Package identity implements the registry's identity, key-lifecycle, and identity-provider handlers.
|
Package identity implements the registry's identity, key-lifecycle, and identity-provider handlers. |
|
Package locks exposes a single HTTP handler at /debug/locks that returns a JSON snapshot of mutex/block contention, current goroutine waiters, and runtime state.
|
Package locks exposes a single HTTP handler at /debug/locks that returns a JSON snapshot of mutex/block contention, current goroutine waiters, and runtime state. |
|
Package membership implements the registry's network membership handlers: create, delete, rename, join, leave, invite, kick, promote, demote, transfer-ownership, role query, member-tags, task-exec, and list-networks.
|
Package membership implements the registry's network membership handlers: create, delete, rename, join, leave, invite, kick, promote, demote, transfer-ownership, role query, member-tags, task-exec, and list-networks. |
|
Package metrics provides the lightweight Prometheus text-format metrics types and the Store that aggregates them for the registry server.
|
Package metrics provides the lightweight Prometheus text-format metrics types and the Store that aggregates them for the registry server. |
|
Package policy implements the registry's network-policy and expression-policy handlers.
|
Package policy implements the registry's network-policy and expression-policy handlers. |
|
Package replication provides the push-based replication manager for the registry server and directory-sync support types.
|
Package replication provides the push-based replication manager for the registry server and directory-sync support types. |
|
Package routing implements the beacon-registration and NAT punch-coordination handlers for the registry server.
|
Package routing implements the beacon-registration and NAT punch-coordination handlers for the registry server. |
|
Package trust implements the registry's trust-pair and handshake-relay store.
|
Package trust implements the registry's trust-pair and handshake-relay store. |
|
Package wal implements the write-ahead log (WAL) and persistence lifecycle for the registry server.
|
Package wal implements the write-ahead log (WAL) and persistence lifecycle for the registry server. |
|
Package webhook provides the audit-event webhook dispatcher for the registry server.
|
Package webhook provides the audit-event webhook dispatcher for the registry server. |