Skip to content

feat: Enterprise-grade Resilient Webhook Dispatcher with HMAC Signature#2154

Open
Ingenieralejo wants to merge 1 commit intoOpenSignLabs:stagingfrom
Ingenieralejo:staging
Open

feat: Enterprise-grade Resilient Webhook Dispatcher with HMAC Signature#2154
Ingenieralejo wants to merge 1 commit intoOpenSignLabs:stagingfrom
Ingenieralejo:staging

Conversation

@Ingenieralejo
Copy link
Copy Markdown

… Dispatcher with HMAC Signaturervice for webhook handling

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

@Ingenieralejo is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

Add webhookDispatcher.js to send secure, reliable webhook events
from OpenSignServer to user-configured endpoints.

Key improvements over a naive HTTP call:
- **HMAC-SHA256 signature** (X-OpenSign-Signature) on every payload,
  allowing receiving servers to verify authenticity and prevent MITM/
  replay attacks.
- **Smart exponential backoff** (2 s → 4 s → 8 s): retries on network
  failures and 5xx errors; drops 4xx immediately to avoid wasting CPU
  on permanent client-side misconfigurations.
- **Idempotency-Key** header (os_evt_{eventId}_attempt_{n}) so
  receiving servers can safely deduplicate retries and prevent double
  processing (e.g., a document being 'signed' twice on network glitch).
- **Structured result object** with success, �ttempts, statusCode,
  error, and isRetryable — enabling callers to log and audit every
  delivery outcome.

Files added:
- �pps/OpenSignServer/cloud/parsefunction/webhookDispatcher.js
  Core dispatcher module. Pure ESM, zero new dependencies (uses axios
  already present in OpenSignServer and Node.js built-in crypto).
- �pps/OpenSignServer/spec/webhookDispatcher.test.js
  16-case Jest test suite covering: signature integrity, determinism,
  successful delivery, header correctness, 5xx smart retry, network
  timeout retry, 429 retry, non-retryable 4xx blocking (6 status codes),
  MAX_RETRIES exhaustion, and idempotency key increment per attempt.
@Ingenieralejo
Copy link
Copy Markdown
Author

Updated: enterprise webhook dispatcher - HMAC-SHA256 + smart retry + idempotency. Files now at correct paths: apps/OpenSignServer/cloud/parsefunction/webhookDispatcher.js + apps/OpenSignServer/spec/webhookDispatcher.test.js

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.

1 participant