feat: Update docker-compose configuration to use environment variables for sensitive data, enhance testing documentation with new LaTeX files for capacity planning, and refine README for clarity on compilation and testing processes.

This commit is contained in:
erik
2026-07-17 08:32:00 -05:00
parent e47ef4f8c6
commit dc3fcc2280
89 changed files with 5331 additions and 1210 deletions
+37
View File
@@ -182,6 +182,43 @@ def list_job_files(download_job_id: str, _: str = Depends(require_bearer)) -> di
raise HTTPException(status_code=502, detail=f"Error listando MinIO: {e}") from e
@app.get("/jobs/{download_job_id}/object")
def get_job_object(
download_job_id: str,
key: str = Query(..., min_length=1, description="Object key bajo downloads_prefix"),
_: str = Depends(require_bearer),
):
"""Stream de un PDF del resultado MinIO (solo keys del prefijo del job)."""
job = store.get_job(download_job_id)
if not job:
raise HTTPException(status_code=404, detail="Job no encontrado")
prefix = (job.downloads_prefix or f"downloads/{download_job_id}/").lstrip("/")
if not prefix.endswith("/"):
prefix += "/"
normalized = key.lstrip("/")
if not normalized.startswith(prefix):
raise HTTPException(status_code=403, detail="Key fuera del prefijo del job")
if not normalized.lower().endswith(".pdf"):
raise HTTPException(status_code=400, detail="Solo se permiten objetos PDF")
if ".." in normalized.split("/"):
raise HTTPException(status_code=400, detail="Key no permitida")
if normalized.endswith("_manifest.json"):
raise HTTPException(status_code=400, detail="Key no permitida")
try:
data = minio.get_bytes(normalized)
except Exception as e:
raise HTTPException(status_code=502, detail=f"Error leyendo MinIO: {e}") from e
filename = Path(normalized).name
return Response(
content=data,
media_type="application/pdf",
headers={"Content-Disposition": f'inline; filename="{filename}"'},
)
@app.get("/jobs/{download_job_id}/events")
def get_events(
download_job_id: str,