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
| import hmac | |
| import hashlib | |
| import time | |
| from flask import Flask, request, abort | |
| app = Flask(__name__) | |
| def verify_solo_webhook_signature(header, raw_body, secret, tolerance_seconds=300): | |
| """ | |
| Verify solo Webhooks signature |
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
| const crypto = require('crypto'); | |
| /** | |
| * Verify solo Webhooks signature | |
| * @param {string} header - X-Solo-Webhooks-Signature header value | |
| * @param {Buffer} rawBody - Raw request body as Buffer | |
| * @param {string} secret - Your webhook secret | |
| * @param {number} toleranceSeconds - Timestamp tolerance (default: 300s) | |
| * @returns {boolean} True if signature is valid | |
| */ |