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Β§
- acme π
- Admin surface for ACME-managed certificates: read-only status plus a
βrenew nowβ nudge. Configuration stays in
system.yaml(restart-gated like every TLS setting), so there is deliberately no CRUD here. Responses never include key material β only whatCertMetarecords. - auth π
- HTTP Basic Auth middleware for the admin API.
- cache π
DELETE /api/cache/{id}β purge everything aproxy-cachepair cached.- 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.
- env_
vars π - Admin API endpoint serving environment variable names. Consumed by the UI for dynamic configuration and secrets management.
- mcp π
- Admin API companions to the MCP server, for the web UI: connection status
(never token values) and the rendered prompt texts behind βCopy as agent
promptβ. Basic-Auth like the rest of
/api; answer whether or not MCP is enabled β rendering a prompt exposes nothing a Basic Auth user cannot already read. - plugin_
configs π - Admin API endpoints for plugin config CRUD. Mutations rewrite the in-memory gateway config and trigger validation + recompilation of every policy (plugin configs are resolved at compile time), so a breaking edit or a delete-while-referenced is rejected with 400 before anything changes.
- 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. - sessions π
- Admin surface for server-side sessions: list and revoke. Meta only β session payloads are sealed and never leave the store through this API.
- status π
- Operational endpoints for the admin API: liveness/readiness probes, a status summary, Prometheus metrics, and manual config reload.
- stores π
- Admin CRUD for the
stores:resource (named redis/valkey connections). - supernodes π
- Admin API endpoints for supernode CRUD. Mutations rewrite the in-memory gateway config and trigger validation + recompilation of every policy (supernodes are inlined at compile time), so a breaking edit or a delete-while-referenced is rejected with 400 before anything changes.
- 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. - vars π
- Admin API endpoint serving the context-variable catalog (src/vars/catalog.rs) β consumed by the UIβs autocomplete and var legend.
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.