WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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