Python

Script webhooks and chat against the bridge.

import hmac, hashlib, time, requests, os
body = b'{"alert":"disk full"}'
ts = str(int(time.time()))
sig = hmac.new(os.environ['SECRET'].encode(), f'{ts}.'.encode()+body, hashlib.sha256).hexdigest()
requests.post(os.environ['HOOK_URL'], data=body, headers={
  'X-OpenBot-Timestamp': ts,
  'X-OpenBot-Signature': f'sha256={sig}',
  'X-OpenBot-Event-Id': 'alert-1',
  'content-type': 'application/json',
})