Rest API - Webhooks and Events
Consider this Python code snippet verifying a webhook signature:
What will be printed if the computed signature matches the header signature?
import hmac
import hashlib
secret = b'mysecret'
payload = b'payload data'
header_sig = 'a3f5c2d4e6b7f8a9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3'
computed_sig = hmac.new(secret, payload, hashlib.sha256).hexdigest()
if hmac.compare_digest(computed_sig, header_sig):
print('Valid signature')
else:
print('Invalid signature')What will be printed if the computed signature matches the header signature?
