Mirror GitHub commit 954b20931bd23bf971072a5ec79424ac03b09d6b (committed 2026-09-12T11:35:28+03:00), pushed 2026-09-12T08:35:36Z
7cfea77 verified Download hackathon-techex/sipa_scan_ledger/adapter.py from SoulInPsyAbstract/websecure: direct link, hf CLI and curl.
- Browser
- Download file 968 Bytes
-
https://huggingface.co/datasets/SoulInPsyAbstract/websecure/resolve/main/hackathon-techex/sipa_scan_ledger/adapter.py
- Command line
-
hf download hf://datasets/SoulInPsyAbstract/websecure/hackathon-techex/sipa_scan_ledger/adapter.py
-
curl -L -o adapter.py https://huggingface.co/datasets/SoulInPsyAbstract/websecure/resolve/main/hackathon-techex/sipa_scan_ledger/adapter.py
968 Bytes
| """Bridges this module to the existing, unmodified scan_own_domains.py. | |
| That script's main() builds and prints exactly this shape: | |
| {"ran_at": "<iso8601>", "targets": {"<host>": [{"severity", "title", ...}, ...], ...}} | |
| (see scan_own_domains.py's own main(), read directly from the repo before | |
| writing this - not guessed). This adapter turns that report dict into one | |
| ScanRecord per host. It does not import or call scan_own_domains.py itself, | |
| so this track can be built and tested without touching the existing script. | |
| """ | |
| from __future__ import annotations | |
| from .record import Finding, ScanRecord | |
| def records_from_self_scan_report(report: dict) -> list[ScanRecord]: | |
| ran_at = report["ran_at"] | |
| records = [] | |
| for host, findings in report.get("targets", {}).items(): | |
| records.append(ScanRecord( | |
| target=host, | |
| scanned_at=ran_at, | |
| findings=[Finding.from_dict(f) for f in findings], | |
| )) | |
| return records | |