mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-22 11:24:18 +00:00
test: add 111 tests for trigger-server security and validation logic (#774)
Add comprehensive test coverage for the trigger-server HTTP service (.claude/skills/setup-agent-team/trigger-server.ts), which had zero test coverage despite recent security-critical changes (PRs #745, #747). Tests cover: - Timing-safe Bearer token auth (17 tests including injection attempts) - VALID_REASONS allowlist enforcement (13 tests including injection) - Issue parameter validation regex (17 tests including shell injection) - Issue dedup logic (8 tests) - Capacity checking (6 tests) - reapAndEnforce process cleanup (9 tests including boundary cases) - Health response structure (4 tests) - Streaming response metadata (4 tests) - Environment variable parsing (5 tests) - Route matching logic (10 tests) - Full validation flow with priority ordering (8 tests) Agent: test-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cdf6f1dba5
commit
a290815108
1 changed files with 1010 additions and 0 deletions
1010
cli/src/__tests__/trigger-server.test.ts
Normal file
1010
cli/src/__tests__/trigger-server.test.ts
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue