Generic webhooks: broken, unused, and not org-scoped. Fix or remove?
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start by tracing webhook dispatch in src/app/services/validation.py:175, then inspect the webhook model, CRUD, schemas, /webhooks endpoint, and migrations mentioned in the issue. The issue presents two unresolved options: remove the mechanism or make it org-scoped with a public payload schema; confirm the project’s decision before changing anything. Done means implementing the selected option consistently, including the database migration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
The generic webhook mechanism (introduced in #367) sends every validated detection to every URL in the webhooks table (src/app/services/validation.py:175). Nothing uses it today:
- Slack notifications go through
organization.slack_hook/slack_client(#478), not this table. - The only row we knew of in prod was a leftover Slack URL from before #478. It never worked and only produced
400 invalid_payloadlog noise. It has been deleted. - Rows can only be added through the admin
/webhooksendpoint. The Python client does not expose it.
Problems if we keep it
- Double-encoded payload.
dispatch_webhookpassesmodel_dump_json()(astr) to httpxjson=, so consumers receive a quoted JSON string instead of an object. #623 fixes this. - No org scoping.
Webhookhas noorganization_idandWebhookCRUD.fetch_all()is global, so every webhook receives every organization's detections. A partner registered here would see other orgs' data. - Raw DB row as payload. We send the
Detectionrow as-is (bucket_key,crop_bucket_key,pose_id, etc.). There is no public schema, so any change to the model silently breaks consumers.
Options
- A. Remove it. Drop the model, endpoint, CRUD, schemas and the dispatch loop, and add a migration to drop
webhooks. Close #623. - B. Make it usable. Merge #623, add
organization_idtoWebhookand filter dispatch by the sequence's org, and send a dedicated public payload schema (alert id, camera, location, azimuth, timestamps, platform URL) instead of the raw row.
- Lingua principale
- Python
- Stelle
- 30
- Fork
- 15
- Merge medio
- 4g 15h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la 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 pyronear/pyro-api
-
type: feat
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
I maintainer di solito rispondono entro 3 giorni
-
Return the number of alerts per day over a periodForse già presa @Majyles l’ha presa 6 giorni fa. Apertatype: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
pyronear/pyro-api#719 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di pyronear/pyro-api
Issue simili
-
Support .aac audio uploadsForse già presa @julien731 l’ha presa oggi. Apertafeature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nimblehq/audio-transcriber#153 ·
-
help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
antonyrag/ragleap-core#1062 ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#4321 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Git-Hospital/githealthcheck#61 ·
I maintainer di solito rispondono entro 1 giorno
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ramnes/notion-sdk-py#433 ·