Documentation
¶
Overview ¶
Package graphhook serves the Meta Graph webhook endpoint shared by the Cloud API chat adapters (WhatsApp, Messenger): the one-time hub.challenge subscribe handshake and the X-Hub-Signature-256 raw-body HMAC check, both compared in constant time via hmac.Equal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶ added in v0.19.1
Handler serves a Graph webhook. GET echoes the raw hub.challenge with a 200 iff hub.mode is "subscribe" and hub.verify_token matches verifyToken, else 403. POST checks header = "sha256=" + hex(HMAC-SHA256(body, appSecret)) over the raw body BEFORE parsing (Meta signs the exact bytes sent), decodes it into a T and hands it to handle; a handle error replies 500 so Meta redelivers.
Types ¶
This section is empty.