Skip to content

feat: validate signed webhook ingestion - #6

Merged
fabiorosa merged 6 commits into
mainfrom
agent/signed-ingestion
Jul 29, 2026
Merged

feat: validate signed webhook ingestion#6
fabiorosa merged 6 commits into
mainfrom
agent/signed-ingestion

Conversation

@fabiorosa

@fabiorosa fabiorosa commented Jul 29, 2026

Copy link
Copy Markdown
Owner

What changed

  • defines signed-ingestion Zod contracts and safe response shapes
  • adds framework-independent payload digest, replay-window, and HMAC rules
  • preserves exact JSON request bytes for signature verification
  • reads encrypted endpoint signing material through a narrow internal lookup
  • accepts valid signed objects and rejects unsafe headers, timestamps, media
    types, payload shapes, endpoint states, signatures, and sizes
  • documents the public signing contract and the WOP-103 persistence boundary

Why

AfterHook needs a defensible ingestion boundary before event persistence or
delivery exists. Keeping this slice transport-focused makes the raw HTTP and
cryptographic contract independently reviewable. WOP-103 will own authoritative
event creation and duplicate resolution.

Validation

  • 18 contract, domain, and Fastify tests
  • 3 PostgreSQL repository integration tests
  • 2 Chromium setup and mobile keyboard checks
  • formatting, lint, strict TypeScript, migration, integration, and build gates
  • complete root npm run quality passed locally on Windows

Closes #5

Define the raw-body HMAC, replay window, payload digest, and bounded idempotency metadata before transport integration. Refs #5
Verify the exact raw body against encrypted endpoint signing material and reject stale, malformed, disabled, or oversized requests safely. Refs #5
Keep numeric serialization explicit and use the repository lookup as the endpoint-state guard. Refs #5
Document the raw signing contract, scope boundary, validation evidence, and public review state. Refs #5
Return a stable internal error without blaming request validation or exposing the underlying server cause. Refs #5
Keep main accurate after the authorized merge and route the next session to a separate WOP-103 issue. Refs #5
@fabiorosa
fabiorosa marked this pull request as ready for review July 29, 2026 03:37
@fabiorosa
fabiorosa merged commit 8fb44d0 into main Jul 29, 2026
2 checks passed
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.

feat: validate signed webhook ingestion

1 participant