[Bug]: server rejects a lowercase or mixed-case bearer auth scheme with a correct key
Maintainer thường phản hồi trong vòng 3 ngày
@VISHNU0906 đang làm issue này rồi.
Từ ngày 6/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
The header check is the startswith("Bearer ") comparison in agentlightning/server/app.py. Reproduce with the TestClient snippet in the issue, using bearer and BeArEr against /api/rollouts. Read the closed, unmerged PR #672 first to see why it was not merged. Done when the scheme is matched case-insensitively, extra spaces after it are accepted, and a wrong key or different scheme still returns 401.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
The server rejects a valid API key when the Authorization header uses a lowercase or mixed-case auth scheme. agentlightning/server/app.py compares the header with startswith("Bearer "), so Authorization: bearer <valid key> and BeArEr <valid key> both return 401 Invalid or missing API key, while Bearer <valid key> succeeds.
RFC 7235 §2.1 makes the auth-scheme token case-insensitive and allows one or more spaces between scheme and credentials. Clients and gateways that normalize the scheme to lowercase therefore cannot authenticate, and the 401 does not point at the cause.
Steps to reproduce
from fastapi.testclient import TestClient
from agentlightning.server.app import create_app
app = create_app({"key": "secret", "default_proxy": {}})
client = TestClient(app)
client.get("/api/rollouts", params={"state_in": "queuing"}, headers={"Authorization": "bearer secret"})
# -> 401 Invalid or missing API key
With Authorization: Bearer secret the same request returns 200.
Expected behavior
A correct key is accepted for any valid auth-scheme casing and for extra spaces after the scheme. A wrong key or a different scheme still returns 401.
- Ngôn ngữ chính
- Python
- Star
- 18.9k
- Fork
- 1.7k
- Merge trung bình
- 5 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 microsoft/agent-lightning
-
Local workers fail for non-coroutine awaitable run resultsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/agent-lightning#666 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
RayPPOTrainer._dump_generations() missing gts argument in _train_step callCó thể đã có người làm @yunkai-yyk đã nhận 262 ngày trước. Đang mởbug v0.x verl
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
microsoft/agent-lightning#492 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement store v0.x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/agent-lightning#372 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
SWE-smith command timeouts leave child processes runningCó thể đã có người làm @liuzhengyang699 đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoft/agent-lightning#697 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Prompt-token deduplication drops distinct image-conditioned transitionsCó thể đã có người làm @liuzhengyang699 đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 20/100
microsoft/agent-lightning#695 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của microsoft/agent-lightning
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
huggingface/accelerate#4511 ·
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 84/100
pylint-dev/pylint#11791 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rasterio granule reads never retry, so one 503 (Service Unavailable) fails the whole requestCó thể đã có người làm @chuckwondo đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
developmentseed/titiler-cmr#305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community enhancement
Độ 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 78/100
Maintainer thường phản hồi trong vòng 1 ngày