Documentation
¶
Overview ¶
Package adminsocket serves the out-of-band admin plane: the one route the CLI posts to for password reset and API-key generation.
It exists because bbolt takes an exclusive OS file lock, so the CLI cannot open the store while the server holds it. The commands travel over HTTP to the running process instead, on a Unix socket in a 0700 directory rather than the TCP mux — the kernel's socket custody IS the security boundary, which is why these handlers require no credentials and why that is safe. main.go owns the listener; this package owns the handlers.
The three of them read one collaborator (the auth store) plus a metrics hook and were the last coherent handler cluster on Server. Everything the plane needs is in Deps: nothing here reads the live config, the live snapshot, or the main store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Store authStore
Metrics panicRecorder
}
Deps is what the plane needs.
type Plane ¶
type Plane struct {
// contains filtered or unexported fields
}
Plane serves the admin socket's single route.
func (*Plane) Handler ¶
Handler returns the admin-plane handler: a one-route mux serving POST /api/admin/bootstrap, wrapped in the same access-log/request-ID and panic-recovery middleware the TCP mux uses (the body limit is inside the handler via webhttp.DecodeBody, exactly as on the TCP plane). It installs no request-metric hook, deliberately: http_requests_total describes the public HTTP surface, and this plane is one route reachable only by a same-container process, so a series for it would carry no signal. Every http_requests_total sample therefore comes from the server's own middleware chain.
main.go serves it on a second http.Server bound to the Unix socket in the 0700 directory config.AdminSocketDir — kernel socket custody replaces the former requireLocalhost peer-address check, so the zero-credential bootstrap channel is unreachable over every TCP path (netns-sharing peers and proxied clients included). Both configured and unconfigured server modes expose it.