docs: def validate_event(payload: bytes, *, signature: str, secret: str) -> None:
      """Validate the signature of a webhook event."""
      # https://developer.github.com/webhooks/securing/#validating-payloads-from-github
      signature_prefix = "sha1="
      if not signature.startswith(signature_prefix):
          raise ValidationFailure("signature does not start with "
                                             f"{repr(signature_prefix)}")
      hmac_ = hmac.new(secret.encode("UTF-8"), msg=payload, digestmod="sha1")
      calculated_sig = signature_prefix + hmac_.hexdigest()
      if not hmac.compare_digest(signature, calculated_sig):
          raise ValidationFailure("payload's signature does not align "
                                             "with the secret")