fix: add authentication to GPU detail, topology, and history endpoints#696
fix: add authentication to GPU detail, topology, and history endpoints#696yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Conversation
All three GPU router endpoints were missing Depends(verify_api_key), allowing unauthenticated access to GPU metrics, topology, and history data. Every other non-health endpoint in the dashboard API requires authentication via Bearer token. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lightheartdevs
left a comment
There was a problem hiding this comment.
Audit Review
The fix is correct — these are the only three non-health endpoints in dashboard-api without auth. They expose GPU UUIDs, per-GPU VRAM usage, temperature, power draw, service assignments, and 5-minute utilization history.
The implementation is clean: imports Depends and verify_api_key, adds dependencies=[Depends(verify_api_key)] to the three route decorators. Matches the pattern used everywhere else in the codebase.
Blocking: Frontend doesn't pass auth headers
The dashboard frontend (useGPUDetailed.js) calls these endpoints without an Authorization header:
fetch('/api/gpu/detailed') // No authMerging this PR alone will break the GPU panel on the dashboard with 401s. Needs a coordinated frontend change to pass Authorization: Bearer ${DASHBOARD_API_KEY}.
Either include the frontend fix in this PR, or open a companion frontend PR to merge simultaneously.
|
Thanks for the review! I investigated the concern about The dashboard frontend does use bare In location /api/ {
...
proxy_set_header Authorization "Bearer ${DASHBOARD_API_KEY}";
}The This is the same mechanism that serves every other authenticated endpoint in the codebase — Adding auth to these 3 GPU endpoints closes the last remaining auth gap in dashboard-api, which also protects the directly-exposed port 3002 against unauthorized LAN access (requests that bypass the nginx proxy entirely). No frontend changes needed — the PR is safe to merge as-is. |
What
Add missing authentication to three GPU API endpoints that were accessible without credentials.
Why
GET /api/gpu/detailed,/api/gpu/topology, and/api/gpu/historyhad noDepends(verify_api_key)— every other non-health endpoint in dashboard-api requires auth. These endpoints expose per-GPU UUIDs, VRAM usage, topology, and utilization history.How
Dependsandverify_api_keyimports togpu.pydependencies=[Depends(verify_api_key)]to all 3 route decoratorsupdates.pyconventionTesting
Review
Critique Guardian: APPROVED (all four pillars clean)
Platform Impact
All platforms