Webhooks are global only: no way to route a single room's events to its own endpoint
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 1/100
Direzione di ricerca
The issue describes the server-side work in roomallocator.go, six webhook-emitting telemetry methods, config-sample.yaml, unit tests, and an end-to-end test; the implementation is already in draft PR livekit/livekit#4848. Review that PR and the protocol dependency livekit/protocol#1777 first. Work is complete when the protocol change lands and the server implementation and tests are accepted; the issue also asks maintainers to weigh in on how webhook configuration should be threaded.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Webhook delivery is configured once, globally:
webhook:
api_key: <api_key>
urls:
- https://your-host.com/handler
Every room's events go to those URLs. There is no way to say "this room's events go to this endpoint".
That is awkward for anything multi-tenant. If one deployment hosts rooms for several customers, teams, or environments, every event lands on one handler that then has to fan back out — and the routing key has to be smuggled through room metadata or reconstructed from the room name. The subscriber also cannot be given a per-room signing key, so one shared secret covers every tenant's traffic.
Why this is odd today
Egress already solves exactly this problem for its own resources. StartEgressRequest, RoomCompositeEgressRequest, TrackEgressRequest and friends all carry:
repeated WebhookConfig webhooks = N;
The request is kept in the resource state (EgressInfo.Request), and egress.GetEgressNotifyOptions turns it into a webhook.WithExtraWebhooks option at emit time.
The delivery machinery for this is already built and already generic: webhook.DefaultNotifier.QueueNotify sends to the static config URLs first, then to each extra webhook, resolving SigningKey through the KeyProvider and honouring per-webhook FilterParams. Rooms simply never supply the option.
Proposal
Give rooms the same treatment:
CreateRoomRequest.webhooks— attach webhooks to a single room at creation.RoomConfiguration.webhooks— attach them to a named room preset inconfig.yaml, selected withroom_preset.RoomInternal.webhooks— persist the resolved list. This is the analogue ofEgressInfo.Request. Deliberately not on the publicRoomproto, since entries hold signing keys andRoomis returned byListRooms.webhook.GetRoomNotifyOptions— mirror ofegress.GetEgressNotifyOptions.
Usage would be:
// CreateRoom
{
"name": "support-call",
"webhooks": [
{ "url": "https://tenant-a.example.com/hook", "signing_key": "APIxxx" }
]
}
Scope
Room webhooks should receive room, participant and track events only:
room_started, room_finished, participant_joined, participant_left, participant_connection_aborted, track_published, track_unpublished
Egress and ingress events should be excluded by an allowlist. Those resources already carry their own webhook config on the request that created them, so forwarding them to a room webhook would both duplicate delivery and leak beyond the room's scope.
The change is additive — behaviour is unchanged when no room webhooks are configured.
PRs
I have this implemented and tested across the two repos:
- livekit/protocol#1777 — the three proto fields and the
webhook.GetRoomNotifyOptionshelper, plus the event allowlist and its tests. - livekit/livekit#4848 — the server side: resolution in
roomallocator.go, threading through the six webhook-emitting telemetry methods,CreateRoomvalidation of URLs and signing keys, aconfig-sample.yamlnote, unit tests, and an end-to-end test asserting a room's own endpoint receives its events while the global endpoint still receives everything.
The server PR is a draft until the protocol one lands, since it needs the proto fields.
Happy to adjust the approach — in particular, threading the webhook list through the telemetry methods versus keeping a per-room registry inside telemetryService is a judgement call I'd like a maintainer's opinion on. I went with threading because RoomIDChanged re-keys a room mid-session and a keyed registry would then silently stop matching.
- Lingua principale
- Go
- Stelle
- 21.3k
- Fork
- 2.4k
- Merge medio
- 16h 47m
- PR unite (30g)
- 82
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di livekit/livekit
-
Buffer.writeRTX drops the RTCP returned by calc, so NACKs for other lost packets are never sentAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
livekit/livekit#4982 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Updating a SIP dispatch rule or inbound trunk to new trunks or numbers skips the conflict checkForse già presa @RaphaelFakhri l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
livekit/livekit#4959 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di livekit/livekit
Issue simili
-
Action Required: Fix Renovate ConfigurationForse già presa @thompson-tomo l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
open-telemetry/opentelemetry-collector#16170 ·
I maintainer di solito rispondono entro 1 giorno
-
automation awf compiler specifications
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
state:triage-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
puppe1990/amarra-cais#342 ·
I maintainer di solito rispondono entro 1 giorno
-
replay: a run cancelled during environment setup is logged as an ERROR (Instrument drops the cancellation)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno