WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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