Commit Graph

4 Commits

Author SHA1 Message Date
Marker689
56786c7aef fix: race conditions in lock pop, CSV formula injection, serialize_finding None leak, consolidate plans, update docs 2026-05-11 22:31:41 +03:00
Marker689
3f44de1d98 refactor: Pydantic webhook payload models, lifespan task cancellation, dict/Pydantic compat helpers 2026-05-11 22:07:35 +03:00
Marker689
a6cd20e41c fix: try/except in _scan_component, serialize_finding to prevent data injection, DRY LLM template, SUPPORTED_ECOSYSTEMS constant 2026-05-11 19:45:49 +03:00
Marker689
c1258dde99 refactor: FastAPI best practices — return types, Pydantic schemas, middleware, code dedup
- Все 18 роутов получили return type annotations
- Создан schemas.py с Pydantic-моделями (ScanOut, PackageOut, FindingOut, ...)
- API-роуты: response_model на list/detail/export/stats
- 404 через HTTPException(404) вместо {'detail':'Not found'} (200)
- RequestLoggingMiddleware: method, path, status, duration_ms
- Глобальный exception handler: ловит необработанные исключения → 500
- _parse_flagged(): вынесен дублирующийся string→bool
- parse_package_path(): общий для web.py и api_packages.py
- selectinload: вынесены в top-level imports
- harvester: makedirs/mkdtemp/rmtree обёрнуты в asyncio.to_thread()
2026-05-10 12:53:33 +03:00