Expand description
Admin API and UI server.
Runs an axum [Router] on a dedicated port, separate from the data plane.
Exposes Basic-Auth-protected CRUD endpoints for routes and policies,
status/health/metrics endpoints, and serves the embedded React SPA
(node-graph editor) as an unauthenticated fallback
(compile-time ui feature + runtime admin.ui_enabled).
Modulesยง
- auth ๐
- HTTP Basic Auth middleware for the admin API.
- consumers ๐
- Admin API endpoints for consumer CRUD. Mutations rewrite the in-memory
gateway config and trigger
SharedState::reload, which rebuilds and atomically swaps the consumer store (no graph recompile is strictly needed, but reload keeps the semantics uniform with routes/policies). - debug ๐
- Admin API for debug mode: trace listing/retrieval and the plugin sandbox.
- policies ๐
- Admin API endpoints for policy CRUD, plus catalogs of available plugin
types and on-disk scripts. Policy mutations rewrite the in-memory gateway
config and trigger validation + graph recompilation via
SharedState::reload. - routes ๐
- Admin API endpoints for route CRUD. Mutations rewrite the in-memory
gateway config and trigger validation + graph recompilation via
SharedState::reload. - status ๐
- Operational endpoints for the admin API: liveness/readiness probes, a status summary, Prometheus metrics, and manual config reload.
- ui ๐
- Serves the admin web UI (React SPA node-graph editor) from assets
embedded into the binary at build time via
rust-embed. Mounted as the admin routerโs unauthenticated fallback; the SPA authenticates its own calls to the admin API.
Functionsยง
- build_
router ๐ - Builds the admin router: authed API routes, plus โ only when compiled with
the
uifeature ANDadmin.ui_enabledis true โ the unauthenticated SPA fallback. Without it, non-API paths get axumโs default 404. - not_
found ๐ - Unauthenticated 404 for non-API paths when the SPA fallback isnโt
mounted (
ui_enabled: false, or a binary built without theuifeature). See the comment inbuild_routerfor why this must be set explicitly rather than left as the routerโs implicit default. - start_
admin_ server - Binds the admin listener on
admin_config.bind:portand serves the admin API and UI until the server exits.