class Attio::Util::WebhookSignature
def calculate_signature(payload, timestamp, secret)
def calculate_signature(payload, timestamp, secret) # Ensure payload is a string payload_string = payload.is_a?(String) ? payload : JSON.generate(payload) # Create the signed payload signed_payload = "#{timestamp}.#{payload_string}" # Calculate HMAC hmac = OpenSSL::HMAC.hexdigest("SHA256", secret, signed_payload) # Return in the format Attio uses "v1=#{hmac}" end