larzdispatch
One backend, N merchant apps, each with its own signed webhook.
A multi-tenant outbound webhook registry: register N destinations, each its own URL and signing secret, then send() looks one up by key, signs the payload, POSTs it, and reports whether it actually landed - true only on a real HTTP 200. Ported from a real production payment router that credits several different merchant apps from one shared backend, each with its own webhook URL and secret. Composes with the rest of the stack instead of reimplementing it: json for the body, webhook for the HMAC signature.
What you get
- Register N destinations, each its own URL + secret
- send() signs with webhook.sign() - no duplicated crypto
- true only on a real HTTP 200, never a swallowed exception
- One backend serving many merchant apps, cleanly
Try it
import "dispatch" as dispatch
let hub = dispatch.hub()
dispatch.register(hub, "cryptolarz", "http://127.0.0.1:1/webhook", "secret-a")
dispatch.register(hub, "drlarz", "https://gateway.example.com/webhook", "secret-b")
print("registered:", dispatch.destination(hub, "cryptolarz"))
print("send to a closed port:", dispatch.send(hub, "cryptolarz", {"user": "a@example.com", "amount_usd": 5}))
print("send to an unregistered app:", dispatch.send(hub, "unknown", {"x": 1}))registered: {url: http://127.0.0.1:1/webhook, secret: secret-a}
send to a closed port: false
send to an unregistered app: falseWhy it's in the Larz Stack
larzdispatch is a real Larzscript package (larzscript pkg install dispatch) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.