fix: separate public and authenticated file endpoints
Deploy Dashboard (Dev) / deploy-dev (push) Has been cancelled
Run Tests / Backend Tests (push) Failing after 5m3s
Run Tests / Frontend Tests (push) Failing after 3m56s
Run Tests / Backend Tests (pull_request) Failing after 5m10s
Run Tests / Frontend Tests (pull_request) Failing after 14m30s
Run Tests / Test Summary (push) Failing after 16s
Run Tests / Test Summary (pull_request) Failing after 18s
Deploy Dashboard (Dev) / deploy-dev (push) Has been cancelled
Run Tests / Backend Tests (push) Failing after 5m3s
Run Tests / Frontend Tests (push) Failing after 3m56s
Run Tests / Backend Tests (pull_request) Failing after 5m10s
Run Tests / Frontend Tests (pull_request) Failing after 14m30s
Run Tests / Test Summary (push) Failing after 16s
Run Tests / Test Summary (pull_request) Failing after 18s
This commit is contained in:
@@ -13,6 +13,7 @@ from config import VOLUME_ROOT
|
||||
from rbac import require_admin
|
||||
|
||||
router = APIRouter()
|
||||
public_router = APIRouter() # For endpoints that don't require auth
|
||||
logger = logging.getLogger(__name__)
|
||||
BASE = Path(VOLUME_ROOT)
|
||||
|
||||
@@ -117,7 +118,7 @@ def create_download_token(path: str):
|
||||
raise HTTPException(status_code=403, detail="Access denied")
|
||||
|
||||
|
||||
@router.get("/download")
|
||||
@public_router.get("/download")
|
||||
def download(path: str = None, token: str = Query(None)):
|
||||
"""Download a file. Supports both authenticated access (path param) and token-based access (token param)."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user