Greg commited on
Commit
3263790
·
1 Parent(s): 232390f

fix(ta-01): re-protect /photos/_debug with admin RBAC

Browse files
backend/app/api/v1/endpoints/photos.py CHANGED
@@ -3,6 +3,7 @@ from pathlib import Path
3
  from fastapi import APIRouter, Depends, HTTPException
4
  from fastapi.responses import FileResponse
5
  from app.dependencies.auth import get_current_user
 
6
  from app.models.user import User
7
  from app.storage import resolved_backend
8
 
@@ -10,8 +11,8 @@ router = APIRouter(prefix="/photos", tags=["photos"])
10
 
11
 
12
  @router.get("/_debug")
13
- def storage_debug():
14
- """Public diagnostic: which photo storage backend the running container
15
  actually resolves, and which related env vars are populated. Values are
16
  NEVER returned — only set/unset booleans plus the raw backend string."""
17
  def is_set(name: str) -> bool:
 
3
  from fastapi import APIRouter, Depends, HTTPException
4
  from fastapi.responses import FileResponse
5
  from app.dependencies.auth import get_current_user
6
+ from app.middleware.rbac import RBAC
7
  from app.models.user import User
8
  from app.storage import resolved_backend
9
 
 
11
 
12
 
13
  @router.get("/_debug")
14
+ def storage_debug(_: User = Depends(RBAC(["admin"]))):
15
+ """Admin-only diagnostic: which photo storage backend the running container
16
  actually resolves, and which related env vars are populated. Values are
17
  NEVER returned — only set/unset booleans plus the raw backend string."""
18
  def is_set(name: str) -> bool: