Skip to main content

Module automations

Module automations 

Source
Expand description

REST endpoints for automations (#220).

Scheduling and signature checking belong to prospero-core’s AutomationEngine; these handlers only resolve the route, hand over the request, and shape the reply — the one-directional api → core rule of ADR 0006.

One thing is deliberately not delegated: the trigger endpoint reads the raw request body. Axum’s Json extractor would give us a parsed value, and re-serializing that produces different bytes than the sender signed, so every honest caller’s signature would fail to verify.

Structs§

RunsQuery
Query for the run-history endpoint.

Constants§

SIGNATURE_HEADER
Header carrying a webhook’s HMAC signature, sha256=<hex>.

Functions§

create_automation
POST /api/automations — create one, returning a webhook key if it has a webhook trigger.
delete_automation
DELETE /api/automations/{id} — remove it and its run history.
list_automations
GET /api/automations — every configured automation.
list_runs
GET /api/automations/{id}/runs — recent runs, newest first.
run_now
POST /api/automations/{id}/run — fire it now, whatever its trigger.
set_enabled
PUT /api/automations/{id}/enabled — enable or disable without deleting.
trigger
POST /api/automations/{id}/trigger — an inbound signed webhook.