Webhook'lar
POST /cloud/webhooks ile oluşturun; 64 karakterlik gizli anahtar bir kez gösterilir. Her teslimi doğrulayın:
import hmac, hashlib, time
def valid(secret, ts, body, signature):
if abs(time.time() - int(ts)) > 300: return False
mac = hmac.new(secret.encode(), (ts + "." + body).encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest("sha256=" + mac, signature)
Başlıklar: X-Gyro-Event, X-Gyro-Delivery, X-Gyro-Timestamp, X-Gyro-Signature. 4 saniye içinde 2xx dönün.