Audit log API returns 500 when called with an Organisation API key
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start with audit/views.py, especially get_queryset at the line named in the server log, and trace how it filters audit records for dashboard users and API key users. Reproduce the request with an Organisation API key and check whether the endpoint returns the project audit log or an intentional 403 instead of a 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: self-hosted 2.295.2 (flagsmith/flagsmith:2.295.2, Docker Compose)
What happens
GET /api/v1/audit/?project=<id> returns HTTP 500 when authenticated with an Organisation API key (Authorization: Api-Key …). The same request works for a logged-in dashboard user.
Steps to reproduce
curl -i -H "Authorization: Api-Key $ORG_API_KEY" "http://localhost:8000/api/v1/audit/?project=1"
Server log
File "/app/audit/views.py", line 63, in get_queryset
TypeError: Field 'id' expected a number but got <api_keys.user.APIKeyUser object at 0x…>.
Expected
The audit log for the project (or a 403 if API keys aren't meant to read it), not a 500.
Notes
It looks like get_queryset filters on request.user as if it were an FFAdminUser; with an API key it is an APIKeyUser. Found while building FlagLens, a VS Code extension for self-hosted Flagsmith; it currently falls back to its own change journal.
- Ngôn ngữ chính
- Python
- Star
- 9.9k
- Fork
- 658
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 168
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 Flagsmith/flagsmith
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Flagsmith/flagsmith#9119 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix Button Alignment in SDK Installation SectionCó thể đã có người làm @manueldezman đã nhận 3 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Flagsmith/flagsmith#9056 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidanceCó thể đã có người làm @jcd1991 đã nhận 4 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Flagsmith/flagsmith#9045 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose whether an organisation is blocked for API usageCó thể đã có người làm @PiUnknown đã nhận 38 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Flagsmith/flagsmith#8773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Có thể đã có người làm @SAY-5 đã nhận 13 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Flagsmith/flagsmith#8510 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Flagsmith/flagsmith
Issue tương tự
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonCó thể đã có người làm @ronaldtse đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pydantic/pytest-examples#102 · 1 bình luận ·