Skip to main content

Module engine_api

Module engine_api 

Source
Expand description

Engine-core HTTP admin API.

Mounted at /api/v1/engine/core/* by the engine binary so the engine console (/engine/console) has structured JSON to render.

Endpoints (all return JSON):

  • GET /api/v1/engine/core/info public, no auth
  • GET /api/v1/engine/core/health public, no auth
  • GET /api/v1/engine/core/active-modules public, no auth
  • GET /api/v1/engine/core/modules admin
  • POST /api/v1/engine/core/modules/{name}/toggle admin
  • GET /api/v1/engine/core/instances admin
  • GET /api/v1/engine/core/audit admin
  • GET /api/v1/engine/core/config admin (secrets redacted)

Admin-gated endpoints reuse the same Authorization: Bearer ... check the auth admin router uses (compared in constant-ish time against EngineState.admin_api_keys). When admin_api_keys is empty every admin endpoint returns 401 — locking the surface entirely. info, health, and active-modules are always public so dashboards can render the header bar + cross-nav before an operator has supplied credentials.

Backend-agnostic: handlers branch on the BackendConfig variant to call into either PgEngineSchema or SqliteEngineSchema. SQLite engines are single-instance so the instances endpoint typically returns one row; the shape stays identical so the UI doesn’t care.

Structs§

AuditEntry
AuditQuery
EngineInfo
InstanceEntry
ListAuditResponse
ListInstancesResponse
ListModulesResponse
ModuleEntry
PageQuery
ToggleBody
ToggleResponse

Functions§

router
Build the engine-core admin router. Bound to EngineState<S> so handlers can pluck the workflow store, the parsed config, and the admin keys list off the parent state.