Skip to content

Instantly share code, notes, and snippets.

@solo-micros
solo-micros / signature-verification.py
Created January 7, 2026 20:07
Signature Verification Python
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
@solo-micros
solo-micros / signature-verification.js
Created January 7, 2026 20:05
Signature Verification Javascript
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
*/