Expose recent-errors for Paperclip via api_key (BIT-684)

Add Fastify GET /v1/paperclip/recent-errors returning CRM-compatible JSON (data
envelope, project_slug per row, status open for open/investigating incidents).

Admin UI proxies the public path /api/error-monitoring/recent-errors to the API
base; middleware bypasses the session redirect for that path only.

Auth matches CRM env names: ERROR_RESOLVE_API_KEY or ERROR_REPORTING_API_KEY for
?api_key=, DEBUG_VIEW_ERRORS_KEY for ?view_errors=.

Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-684
Paperclip-Run: cf7cb964-6953-4476-af09-3feb5d10da17
Made-with: Cursor
This commit is contained in:
David Santos committed 2026-04-01 14:18:00 +00:00
1 parent c899cef6e1
commit 6811dba303
6 files changed
+203

No files matched your search

+4
View File
@@ -15,6 +15,10 @@ JWT_SECRET=change_me_in_production_64_bytes_minimum
# Cookie signing — generate with: openssl rand -base64 32
COOKIE_SECRET=change_me_in_production_32_bytes_minimum
# Recent-errors for Paperclip (optional — if unset, GET /v1/paperclip/recent-errors returns 503)
# ERROR_RESOLVE_API_KEY=same_as_CRM_or_shared_hub_secret
# DEBUG_VIEW_ERRORS_KEY=read_only_alternate_query_param_view_errors
# Rate limits (optional — defaults shown)
# RATE_INGEST_MAX=1000
# RATE_INGEST_WINDOW_MS=60000