procurement-ingest/tests
Adam Moussa 5746de001e
fix(webhook): address Open SWE review — require webhook URL, guard seq, bound client timeouts
Triaged all 29 Open SWE findings (6 posted + 23 below-threshold). Fixed the
three genuine ones; the rest are refuted/unreachable/intentional (details
replied on the PR).

- #0/#22 (high): SHOC_WEBHOOK_URL now has NO hardcoded default. A dropped env
  var previously fell back to the dev endpoint and would ship prod work-order
  data there; deliver() now fails closed (retryable) on an unset/non-https
  URL. The CDK env var is the single source.
- #9/#26 (high): capture record["dynamodb"]["SequenceNumber"] once, safely,
  before delivery. The catch-all exists so an exception can't re-deliver the
  whole batch — it must not itself KeyError on the subscript. A record without
  a SequenceNumber (unreachable for real streams) is logged + skipped.
- #16/#17: bound the Secrets Manager + SQS client timeouts (botocore Config:
  3s connect / 5s read / 2 retries) so a slow AWS call can't hang the
  invocation toward its 60s timeout and re-deliver the batch.

Dismissed (confirmed sound): HMAC scope is contract-pinned + golden-vector
shared (changing it is a breaking cross-party change); the replay script's
hardcoded prod account is a deliberate fail-closed guard, and its required
--url + dry-run-default + https-only are its intended operator-runbook design.

753 pytest / 85.7%, ruff, cdk synth green. No IAM/auth/Lambda-signature
change, so the mandatory cross-family gates are unaffected.
2026-07-24 17:40:13 -04:00
..
support feat(webhook): SHOC WO webhook emitter — dark-ship streams, HMAC secret + rotation 2026-07-24 14:54:07 -04:00
requirements.txt test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00
test_api_handlers.py feat(api): Redocly lint gate + SHOC-themed /docs (Redoc theming, topbar, collapsible samples) (#130) 2026-07-24 18:04:30 +00:00
test_api_pagination_moto.py feat(api): procurement-api read stack + OpenAPI docs (SHOC reconciliation path) (#127) 2026-07-23 19:32:20 -04:00
test_api_spec_drift.py feat(api): Redocly lint gate + SHOC-themed /docs (Redoc theming, topbar, collapsible samples) (#130) 2026-07-24 18:04:30 +00:00
test_bundle_consistency.py feat(webhook): SHOC WO webhook emitter — dark-ship streams, HMAC secret + rotation 2026-07-24 14:54:07 -04:00
test_cross_account_principal_pin.py fix(webhook): kms:ViaService pins, https-only delivery, cross-account principal CI pin 2026-07-24 15:00:15 -04:00
test_handler_auth_seam.py test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00
test_parse_raw_email.py Add pytest suite and enable tests in CI (#95) 2026-07-15 19:06:20 -04:00
test_replay_shoc_webhooks_contract.py feat(webhook): SHOC WO webhook emitter — dark-ship streams, HMAC secret + rotation 2026-07-24 14:54:07 -04:00
test_reprocess_contract.py Migrate to seahaven-prod: deploy role, backfill tooling, account-portability fixes (#125) 2026-07-23 17:08:47 -04:00
test_ses_auth.py fix(ses_auth): harden comment stripping and alarm evaluation window (#103) 2026-07-16 19:00:40 +00:00
test_shoc_emitter_delivery.py fix(webhook): address Open SWE review — require webhook URL, guard seq, bound client timeouts 2026-07-24 17:40:13 -04:00
test_shoc_emitter_envelope.py feat(webhook): SHOC WO webhook emitter — dark-ship streams, HMAC secret + rotation 2026-07-24 14:54:07 -04:00
test_shoc_emitter_handler.py fix(webhook): address Open SWE review — require webhook URL, guard seq, bound client timeouts 2026-07-24 17:40:13 -04:00
test_shoc_hmac_rotator.py harden(webhook): resolve /sh-security-review findings (1 confirmed medium + cheap fixes) 2026-07-24 15:23:24 -04:00
test_web_ui_auth.py feat(api): procurement-api read stack + OpenAPI docs (SHOC reconciliation path) (#127) 2026-07-23 19:32:20 -04:00
test_web_ui_handlers.py test: consolidate test roots — one loader, shared support, enforced CI floor (phase 8) (#118) 2026-07-20 16:19:15 -04:00