feat: JSON API checks #76

Merged
Sebi merged 3 commits from feat/json-check into main 2026-11-22 11:12:26 +00:00
Owner

Stacked on #75.

  • New check type json: GET or POST (JSON body), headers, expected status (default 2xx), TLS verification, 1–10 conditions that must all hold. Paths a.b[0].c (optional $.), operators == != < <= > >= contains exists absent; numbers compare numerically, contains works on strings and arrays. Messages like queue.depth is 42, expected < 10.
  • HTTP and JSON share fetch with the network guard (no private targets on shared checkers).
  • Console: type "JSON API" with method, body, status, headers (Name: value lines, also for HTTP now) and condition rows.
  • API: header values are redacted for members without write access.
  • Fix: the form serializer sent fields of disabled fieldsets (other monitor types), so same-named settings overwrote each other; it now uses :disabled. Numbered field names build arrays. Browser tests cover it (verified to fail on the old code) and all pages in internal/web/testdata now run with a time limit.

Closes #26

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

Stacked on #75. - New check type `json`: GET or POST (JSON body), headers, expected status (default 2xx), TLS verification, 1–10 conditions that must all hold. Paths `a.b[0].c` (optional `$.`), operators `== != < <= > >= contains exists absent`; numbers compare numerically, `contains` works on strings and arrays. Messages like `queue.depth is 42, expected < 10`. - HTTP and JSON share `fetch` with the network guard (no private targets on shared checkers). - Console: type "JSON API" with method, body, status, headers (`Name: value` lines, also for HTTP now) and condition rows. - API: header values are redacted for members without write access. - **Fix:** the form serializer sent fields of disabled fieldsets (other monitor types), so same-named settings overwrote each other; it now uses `:disabled`. Numbered field names build arrays. Browser tests cover it (verified to fail on the old code) and all pages in `internal/web/testdata` now run with a time limit. Closes #26 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M8 External Sources milestone 2026-11-22 10:45:26 +00:00
Sebi changed target branch from feat/heartbeats to main 2026-11-22 11:11:22 +00:00
Sebi added 5 commits 2026-11-22 11:11:22 +00:00
Refs #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A heartbeat monitor has a secret ping URL instead of a target and
regions. Jobs call it with GET, HEAD or POST after each run, or /fail
with an optional message. When no ping arrives within the interval plus
a grace period, a failure is recorded and evaluated like a checker
result, so confirmations, maintenance and notifications apply. One API
replica at a time checks deadlines. The URL is shown only to members who
may edit the monitor, since it can report the job healthy.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The serializer checked the disabled property, which only reflects a
field's own attribute, so settings of other monitor types were sent too
and fields with the same name overwrote each other. Forms also gain
arrays from numbered names and header lines. Browser tests now run every
page in testdata, with a time limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A JSON check requests a URL with GET or POST, optional headers and body,
and requires the expected status and every condition: paths like
checks[0].state compared with ==, !=, <, <=, >, >=, contains, exists or
absent. Failures name the path, the value found and the expectation.
HTTP and JSON checks share the request code and its network guard.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Readers no longer see request header values, which typically hold
credentials.

Closes #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 58c29074dd into main 2026-11-22 11:12:25 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#76