WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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)}"