feat: add engagement export service and endpoint (md/csv/pdf)
- New module backend/app/services/export.py with render_engagement_markdown,
render_engagement_csv, render_engagement_pdf, _render_engagement_html helper,
and _export_filename slugifier (NFKD + fallback "unnamed").
- Extend engagements_bp with GET /api/engagements/<int:eid>/export?format=md|csv|pdf,
gated @role_required("admin","redteam"). Returns 400 on missing/unknown format,
404 on unknown engagement, correct Content-Type + Content-Disposition headers.
- Reuses _enrich_techniques and _enrich_tactics from serializers.py; resilient
to MITRE bundle not loaded (returns empty tactics, no crash).
- Adds weasyprint>=60.0 to backend/requirements.txt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ Flask-SQLAlchemy==3.1.1
|
||||
Flask-Migrate==4.0.7
|
||||
PyJWT==2.9.0
|
||||
argon2-cffi==23.1.0
|
||||
weasyprint>=60.0
|
||||
pytest==8.3.3
|
||||
ruff==0.6.9
|
||||
mypy==1.11.2
|
||||
|
||||
Reference in New Issue
Block a user