feat(reliability): idempotency store, custom webhook replay protection, correlation ids

Add LICENSE (MIT), an IdempotencyStore abstraction with a KV implementation and provider-scoped delivery keys, optional replay protection for custom webhooks (X-WebHooker-Timestamp + X-WebHooker-Nonce), and per-request correlation ids in webhook responses and logs.
This commit is contained in:
RhenCloud 2026-08-15 14:39:41 +08:00
parent 92ba2203a5
commit 737dd7af98
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
15 changed files with 378 additions and 26 deletions

View file

@ -198,7 +198,7 @@ describe("processWebhook", () => {
const second = await processWebhook(env, body, headers, makeWait().waitUntil, "team-a");
expect(first.status).toBe(200);
expect(second.status).toBe(200);
expect(second.body).toEqual({ ok: true, duplicate: true });
expect(second.body).toEqual({ ok: true, duplicate: true, requestId: expect.any(String) });
expect(fetched).toHaveLength(1);
});