Skip to content

fix: validate failure status values on the PUT endpoints (#135)#161

Merged
eboudrant merged 1 commit into
mainfrom
fix/validate-failure-status
Jul 2, 2026
Merged

fix: validate failure status values on the PUT endpoints (#135)#161
eboudrant merged 1 commit into
mainfrom
fix/validate-failure-status

Conversation

@eboudrant

@eboudrant eboudrant commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #135. The two status PUT endpoints wrote whatever string the client sent; computeStats only counts pending|accepted|rejected, so junk statuses silently distorted stats and hid failures from totals.

Both routes now whitelist pending|accepted|rejected (400 otherwise), and the batch route also 400s on non-array filenames.

Test plan

  • npm test158/158 (5 new in tests/node/handler.test.js: bogus status → 400 on both routes, non-array filenames → 400, valid statuses → 200 with updated stats).
  • Backend-only → baselines unaffected.

Note

Touches tests/node/handler.test.js, as does #157 (size=0) — both append independent suites, so at most a trivial merge-resolve depending on order.

Not enabling auto-merge.

@eboudrant eboudrant force-pushed the fix/validate-failure-status branch from 9d780fe to 3b123d1 Compare July 2, 2026 06:20
Reject statuses outside pending|accepted|rejected with a 400 on both
the single-failure and batch status routes, and reject a non-array
filenames on the batch route, so junk values can no longer distort
computeStats. Adds handler tests for both routes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
https://claude.ai/code/session_01BxexPASV1UbMj8ede48RLu
@eboudrant eboudrant force-pushed the fix/validate-failure-status branch from 3b123d1 to 8af2054 Compare July 2, 2026 13:55
@eboudrant eboudrant merged commit c0f9f9d into main Jul 2, 2026
7 checks passed
@eboudrant eboudrant deleted the fix/validate-failure-status branch July 2, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] Status update endpoints accept arbitrary status strings

2 participants