fix(security): signal when scan comparison is truncated (#658)

Compare endpoint loads up to 1000 findings per scan. When a scan exceeds
this cap, the response now includes truncated=true and row_limit, and
the comparison sheet surfaces a banner so users understand the diff may
be incomplete. Also exposes total_vulnerabilities on scanA/scanB for UI
use and logs a warning when truncation occurs.
This commit is contained in:
Anso
2026-04-17 13:53:53 -04:00
committed by GitHub
parent f4e3c267cd
commit c211f655c3
6 changed files with 92 additions and 6 deletions
+4 -2
View File
@@ -143,9 +143,11 @@ export interface ScanCompareVulnerability {
}
export interface ScanCompareResult {
scanA: { id: number; scanned_at: number; image_ref: string };
scanB: { id: number; scanned_at: number; image_ref: string };
scanA: { id: number; scanned_at: number; image_ref: string; total_vulnerabilities?: number };
scanB: { id: number; scanned_at: number; image_ref: string; total_vulnerabilities?: number };
added: ScanCompareVulnerability[];
removed: ScanCompareVulnerability[];
unchanged: ScanCompareVulnerability[];
truncated?: boolean;
row_limit?: number;
}