Documentation
¶
Overview ¶
Package console serves an embedded operator web console for a broker.
The console is a static single-page app. It holds no broker data of its own: every value it renders is fetched at runtime from the same admin and /v1 endpoints an operator would use with curl, carrying the same bearer token and subject to the same ACL. That keeps a single authorisation path instead of a privileged back door that happens to live in the UI.
Assets are compiled into the binary, so the console needs no build step, no Node toolchain and no files on disk. That matters for the distroless images and for reproducible_build.sh.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppJS ¶
AppJS returns the console's script source. It exists so tests can assert that every endpoint the console calls actually exists, which is otherwise only discoverable by loading the page in a browser.
func Handler ¶
Handler returns the console handler. Mount it behind the admin auth wrapper so the console cannot become an unauthenticated window onto broker state:
mux.Handle("/console/", admin.Wrap(console.Handler()))
The handler only ever serves its own embedded bytes, so it reads nothing from the broker and is safe to mount without auth if a deployment prefers to put it behind a separate authenticating proxy.
Types ¶
This section is empty.