Skip to main content

Module debug

Module debug 

Source
Expand description

Admin API for debug mode: trace listing/retrieval and the plugin sandbox.

Every route except GET /api/debug/config responds 404 while debug.enabled is false. A 403 would confirm the surface exists, and these endpoints dump request contexts and execute plugins โ€” the highest value target on the box. The 404 is defence in depth behind the Basic Auth layer, not a replacement for it.

Discoverability is preserved two ways: each gated rejection logs a warning naming the exact config key, and GET /api/debug/config always answers so the web UI can render an explanatory empty state instead of a mystery.

Structsยง

StepWithChanges ๐Ÿ”’
A step plus the changes derived from the preceding snapshot.
TraceFilter ๐Ÿ”’
Optional filters for the trace list, so a developer can pull just the recent requests on the policy or route they are working on. All are ANDed; empty strings are ignored (a bare ?route= is not a filter).

Functionsยง

apply_filter ๐Ÿ”’
Keeps only the summaries matching every supplied filter.
bad_request ๐Ÿ”’
clear_traces ๐Ÿ”’
DELETE /api/debug/traces โ€” empties the buffer.
disabled ๐Ÿ”’
The 404 returned when debug mode is off, matching the shape the rest of the Admin API uses for a missing resource.
get_config ๐Ÿ”’
GET /api/debug/config โ€” the effective debug settings.
get_trace ๐Ÿ”’
GET /api/debug/traces/{id} โ€” one trace with computed changes.
list_traces ๐Ÿ”’
GET /api/debug/traces โ€” summaries, newest first.
non_empty ๐Ÿ”’
render_trace ๐Ÿ”’
Renders a trace with per-step changes computed at read time.
router
Builds the router for the /api/debug/* endpoints.
run_sandbox ๐Ÿ”’
POST /api/debug/sandbox โ€” run ad-hoc nodes or a named policy against a synthetic context.
source_str ๐Ÿ”’