chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# https://developers.facebook.com/docs/messenger-platform/reference/webhook-events#format
|
||||
expectedSignature = split(to_string!(.headers."x-hub-signature-256"), "=")[1]
|
||||
actualSignature = encode_base16(hmac(to_string!(.body), to_string!(.secrets.SANDBOX_CLIENT_SECRET)))
|
||||
if actualSignature != expectedSignature {
|
||||
null
|
||||
} else {
|
||||
body = parse_json!(.body)
|
||||
messagingEntry = body.entry[0].messaging[0]
|
||||
messagingEntry.sender.id
|
||||
}
|
||||
Reference in New Issue
Block a user