feat(health): validate query params, paginate deep checks, document API - #407
Merged
mikewheeleer merged 2 commits intoJul 28, 2026
Merged
Conversation
The pr-404 merge left literal <<<<<<</=======/>>>>>>> markers in devDependencies, producing invalid JSON and breaking npm install for every contributor. Resolves to typescript@^6.0.3 with typescript-eslint@^8.65.0: the currently published typescript-eslint (8.65.0) only supports typescript <6.1.0, so pairing it with the typescript@^7.0.2 side of the conflict leaves the dependency tree unresolvable.
- Reject unknown query parameters on /health, /api/v1/health/ready, and /api/v1/health/deep with a structured 400 invalid_request. - Add a checks array to /api/v1/health/deep exposing per-subsystem status (event log, usage/services/webhook/API-key stores, memory), with opaque-cursor pagination (limit default 10, max 50) matching the existing events-log cursor contract. - Add docs/health.md covering all three routes, the new pagination contract, and error codes. - Add src/health-deep.test.ts covering success, pagination, malformed cursor, and unknown-query-param rejection.
3 tasks
Contributor
|
@thlpkee20-wq clean implementation, merging with thanks 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #400
Closes #399
Closes #398
Closes #397
Covers the full health group of GrantFox campaign issues:
/health,/api/v1/health/ready, and/api/v1/health/deepnow reject any query parameter outside their documented allow-list with
a structured
400 invalid_request./api/v1/health/deepgains achecksarray (event log,usage/services/webhook/API-key store capacity, memory) with
opaque-cursor pagination (
limitdefault 10 / max 50, stablenextChecksCursor), matching the existing/api/v1/eventscursorcontract. A malformed or expired cursor returns
400 invalid_request.docs/health.mdcovering all three routes, thepagination contract, and error codes.
src/health-deep.test.tscovering success shape,pagination (first page / next page / stable repeat / exhausted page),
malformed cursor, and unknown-query-param rejection on all three routes.
Test plan
npm run buildnpm run lintnpm test— ran the full suite plus targeted runs ofhealth.test.js,health-deep.test.js,readiness.test.js,routes/operational.test.js,openapi-routes.test.js,middleware.test.js,query-params.test.js,schema-validation.test.js: all passing, 0 failures.Note
This branch is stacked on #406 (
fix/package-json-merge-conflict), whichresolves the unresolved merge-conflict markers currently on
mainthatbreak
npm install. That PR's commit will show in this diff until itmerges; the actual health-group change is the four files under
docs/and
src/.