Python SDK for DERO Merchant REST API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
621B

  1. from .crypto_util import valid_mac
  2. def verify_webhook_signature(req_body: str, req_signature: str, webhook_secret_key: str) -> bool:
  3. """Verifies the signature of a webhook request.
  4. Args:
  5. req_body:
  6. A string of the body of the webhook request.
  7. req_signature:
  8. A string of the SHA256 hex encoded signature of the body of the webhook request.
  9. webhook_secret_key:
  10. A string of the SHA256 hex encoded webhook secret key.
  11. Returns:
  12. A bool with the validity of the signature.
  13. """
  14. return valid_mac(req_body, req_signature, webhook_secret_key)