fix: deliver RDP bundle via SAC HTTP zip download, not WinRM chunks (0.20.15)

This commit is contained in:
2026-06-20 19:51:45 +10:00
parent ca90f5c296
commit 6acbfe22de
6 changed files with 153 additions and 121 deletions
+15
View File
@@ -1,6 +1,7 @@
from typing import Any
from fastapi import APIRouter, Depends, HTTPException, Query
from fastapi.responses import Response
from pydantic import BaseModel, Field
from sqlalchemy.orm import Session
@@ -59,3 +60,17 @@ def post_agent_command_result(
raise HTTPException(status_code=404, detail="Command not found")
db.commit()
return {"status": cmd.status, "command_uuid": cmd.command_uuid}
@router.get("/rdp-bundle/{token}")
def download_rdp_bundle(token: str) -> Response:
from app.services.rdp_bundle_delivery import get_rdp_bundle_zip
data = get_rdp_bundle_zip(token)
if not data:
raise HTTPException(status_code=404, detail="Bundle not found or expired")
return Response(
content=data,
media_type="application/zip",
headers={"Content-Disposition": 'attachment; filename="sac-rdp-bundle.zip"'},
)