feat: HMAC-SHA1 webhook signature verification and idempotency guard for Make.com events#154
Draft
feat: HMAC-SHA1 webhook signature verification and idempotency guard for Make.com events#154
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ncy guard (#144) Agent-Logs-Url: https://github.com/Tryonme-com/tryonyou-app/sessions/c596bbd8-1257-4414-9582-b81ddd2e0f13 Co-authored-by: LVT-ENG <214667862+LVT-ENG@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate SHA1 signature and lock concurrency
feat: HMAC-SHA1 webhook signature verification and idempotency guard for Make.com events
Apr 9, 2026
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.
Incoming Make.com webhook events lacked signature verification and had no protection against concurrent duplicate processing, causing scenario-level concurrency errors.
Changes
api/peacock_core.pyverify_webhook_sha1_signature(payload, signature_header, secret)— validatesX-Hub-Signature: sha1=<digest>headers viahmac.compare_digest(timing-safe)IdempotencyGuard— thread-safe, TTL-based in-memory deduplication keyed onevent_id; auto-evicts expired entries and caps size at 10kapi/index.pymirror_digital_eventhandler now:401) whenMAKE_WEBHOOK_SECRETis set200 {"duplicate": true, "skipped": true}for already-seenevent_ids within TTL windowtests/test_peacock_core.pyExample
Signature verification is opt-in (no-op when
MAKE_WEBHOOK_SECRETis unset);event_iddeduplication is skipped for events that omit the field.