Generic webhooks: broken, unused, and not org-scoped. Fix or remove?
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 30
- Fork
- 15
- Merge trung bình
- 3 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyronear/pyro-api
-
type: feat
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Return the number of alerts per day over a periodCó thể đã có người làm @Majyles đã nhận 6 ngày trước. Đang mởtype: feat
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
pyronear/pyro-api#719 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type: feat
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Application metrics of the APIĐang mởtype: feat
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 2 ngày
-
type: feat
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của pyronear/pyro-api
Issue tương tự
-
app: scripts status: backlog type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
netbox-community/netbox-scripts#68 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
marin-community/marin#10765 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
flathub/com.unity.UnityHub#230 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Claiming namespace `lang2hong`Đang mởnamespace operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 63/100
EclipseFdn/open-vsx.org#14910 ·
Maintainer thường phản hồi trong vòng 1 ngày