chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
value = body.entry[0].changes[0].value
|
||||
if !is_nullish(value.statuses) && length!(value.statuses) > 0 {
|
||||
value.statuses[0].recipient_id
|
||||
} else {
|
||||
value.contacts[0].wa_id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user