Run backend and web with a shared configurable port, add local webhook and secret-generation helpers with tests, and document current app-auth and fixture workflows.
27 lines
858 B
Python
27 lines
858 B
Python
"""Local fixture webhook receiver: ACK only, no signature or integration verification."""
|
|
|
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
|
|
|
|
class FixtureWebhookHandler(BaseHTTPRequestHandler):
|
|
def do_POST(self) -> None:
|
|
if self.path != "/notifications":
|
|
self.send_error(404)
|
|
return
|
|
try:
|
|
length = int(self.headers.get("Content-Length", "0"))
|
|
except ValueError:
|
|
self.send_error(400)
|
|
return
|
|
if not 0 <= length <= 8192:
|
|
self.send_error(413)
|
|
return
|
|
self.rfile.read(length)
|
|
self.send_response(202)
|
|
self.end_headers()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print("Fixture webhook receiver: http://127.0.0.1:9001/notifications", flush=True)
|
|
HTTPServer(("127.0.0.1", 9001), FixtureWebhookHandler).serve_forever()
|