Feat/webhook receiver endpoint#210
Merged
Jagadeeshftw merged 3 commits intoApr 26, 2026
Merged
Conversation
- Fix OUT_OF_RANGE check to use int64 max (9223372036854775807) and extract integer part before BigInt comparison (old code stripped the decimal point, giving wrong magnitude) - Add normalizeDecimalString helper to strip trailing fractional zeros - validateDecimalString returns normalized value - serializeToDecimalString normalizes string pass-through via result.value - decimalStringField in schemas.ts applies .transform(normalizeDecimalString) - Tests: new normalizeDecimalString suite, int64 boundary cases, trailing-zero normalization round-trips
- Mount webhooksRouter in app.ts under /internal/webhooks - Add POST /internal/webhooks/receive: reads raw body, verifies HMAC signature via verifyWebhookSignature, registers delivery id for dedup, echoes parsed event back on success - Add registerDeliveryId to WebhookDeliveryStore and WebhookService - Fix pre-existing TS errors in webhooks.ts (TS7030, TS2379) - Tests: 8 cases covering valid delivery, missing headers, stale timestamp, signature mismatch, duplicate delivery, oversized payload
|
@Keengfk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
i Added POST /internal/webhooks/receive — an endpoint that accepts an inbound webhook, verifies the
HMAC-SHA256 signature against FLUXORA_WEBHOOK_SECRET, enforces the full verification contract (missing
headers → 401, stale timestamp → 401, bad signature → 401, duplicate delivery id → 409, oversized body →
413), then echoes the parsed event back on success. Also wired the router into app.ts, added
registerDeliveryId to the store/service for dedup tracking, fixed pre-existing TypeScript errors in the
route file, and wrote 8 tests covering every failure mode.
closes #129