-
-
Save leafusergithub/93458e6dbec4d6efc84bf18936953f54 to your computer and use it in GitHub Desktop.
Alerts verify event
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 the request body received with your secret | |
| expected_sig = hmac.digest(msg=request_body_bytes, | |
| key=bytes('your secret', 'utf-8'), | |
| digest='sha256') | |
| # Get the signature in the X-Leaf-Signature header | |
| request_sig = base64.b64decode(sig_header) | |
| # Compare both | |
| hmac.compare_digest(expected_sig, request_sig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment