WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

common.py 374B

1234567891011121314
  1. import hashlib
  2. import os
  3. BASE_URL = os.environ["LAS_BASE_URL"]
  4. SECRET = os.environ["LAS_SECRET"]
  5. def get_hook_key(service, identifier):
  6. nonce = (service + SECRET + identifier).encode("ascii")
  7. return hashlib.sha256(nonce).hexdigest()
  8. def get_hook_url(service, identifier):
  9. return f"{BASE_URL}hooks/{service}/{identifier}/{get_hook_key(service, identifier)}"