Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gateway/platforms/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,15 @@ def _header(name: str) -> str:
).hexdigest()
return hmac.compare_digest(generic_sig, expected)

# Asana: X-Hook-Signature = <hex HMAC-SHA256 of raw body>
# Secret is established during the Asana webhook handshake (X-Hook-Secret).
asana_sig = request.headers.get("X-Hook-Signature", "")
if asana_sig:
expected = hmac.new(
secret.encode(), body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(asana_sig, expected)

# No recognised signature header but secret is configured → reject
logger.debug(
"[webhook] Secret configured but no signature header found"
Expand Down