- scanner/engine.py — Playwright-движок сканирования - scanner/models.py — Pydantic модели - scanner/checks/ — 5 проверок (cookie, privacy, forms, server, external) - api/server.py — FastAPI REST API - reports/generator.py — PDF через WeasyPrint + Jinja2 - main.py — CLI + сервер Проверки: ✅ cookie_banner — поиск cookie-баннера ✅ privacy_link — проверка ссылки на политику ✅ form_checkbox — проверка чекбоксов согласия ✅ server_location — геолокация сервера (RФ или нет) ✅ external_scripts — внешние скрипты аналитики
38 lines
709 B
Python
38 lines
709 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
|
|
|
|
class HealthResponse(BaseModel):
|
|
status: str
|
|
version: str = "1.0.0"
|
|
checks_count: int = 5
|
|
|
|
|
|
class ScanRequest(BaseModel):
|
|
url: str
|
|
checks: Optional[list[str]] = None
|
|
|
|
|
|
class CSVScanRequest(BaseModel):
|
|
urls: list[str]
|
|
checks: Optional[list[str]] = None
|
|
|
|
|
|
class ScanResultResponse(BaseModel):
|
|
scan_id: str
|
|
url: str
|
|
score: int
|
|
is_compliant: bool
|
|
summary: str
|
|
checks_passed: int
|
|
checks_failed: int
|
|
checks_errors: int
|
|
|
|
|
|
class BatchScanResultResponse(BaseModel):
|
|
scan_id: str
|
|
total: int
|
|
results: list[ScanResultResponse]
|
|
compliant_count: int
|
|
non_compliant_count: int
|