[Bug]: server rejects a lowercase or mixed-case bearer auth scheme with a correct key
Los mantenedores suelen responder en 3 días
@VISHNU0906 ya está trabajando en esto.
Desde el 6/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- authentication, backend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 18.9k
- Forks
- 1.7k
- Merge medio
- 5 d 19 h
- PR fusionados (30 d)
- 14
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/agent-lightning
-
Local workers fail for non-coroutine awaitable run resultsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/agent-lightning#666 ·
Los mantenedores suelen responder en 3 días
-
RayPPOTrainer._dump_generations() missing gts argument in _train_step callPosiblemente ocupada @yunkai-yyk la tomó hace 261 días. Abiertobug v0.x verl
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
microsoft/agent-lightning#492 ·
Los mantenedores suelen responder en 3 días
-
enhancement store v0.x
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/agent-lightning#372 · 10 comentarios ·
Los mantenedores suelen responder en 3 días
-
SWE-smith command timeouts leave child processes runningPosiblemente ocupada @liuzhengyang699 la tomó hace 1 día. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
microsoft/agent-lightning#697 ·
Los mantenedores suelen responder en 3 días
-
Prompt-token deduplication drops distinct image-conditioned transitionsPosiblemente ocupada @liuzhengyang699 la tomó hace 1 día. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 20/100
microsoft/agent-lightning#695 ·
Los mantenedores suelen responder en 3 días
Todos los issues de microsoft/agent-lightning
Issues similares
-
binding:python bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-webui/open-terminal#210 ·
-
triage/confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agentscope-ai/agentscope#3807 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#150542 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
triton-inference-server/server#9069 ·
Los mantenedores suelen responder en 1 día