feat(api): add /api/system and per-package verdicts

Add a read-only /api/system endpoint with the effective scan policy,
scanner health, rescan, cache and pre-warming settings. It exposes no
credentials or paths.

The package list now carries a verdict (cleared, held, bypassed or
pending) with the reason and the applied bypass. /api/stats adds
bypassed_packages. The vulnerability detail response adds the decision,
a per-scanner severity breakdown and detected_by on each finding.
This commit is contained in:
2026-11-24 00:42:44 +00:00
parent 2b6f3bd892
commit 6ddc382d5b
7 changed files with 477 additions and 14 deletions
+3 -2
View File
@@ -95,7 +95,8 @@ type Config struct {
RescanAfter time.Duration // Rescan a cache hit whose scan result is older than this before serving (0 = off)
}
const defaultScanWaitTimeout = 30 * time.Second
// DefaultScanWaitTimeout is how long a first download waits for its scan when none is configured.
const DefaultScanWaitTimeout = 30 * time.Second
// cleanupBatchSize bounds how many rows one cleanup query reads.
const cleanupBatchSize = metadata.DefaultBatchSize
@@ -196,7 +197,7 @@ func New(storage storage.StorageBackend, metadata metadata.MetadataStore, scanne
}
if config.ScanWaitTimeout == 0 {
config.ScanWaitTimeout = defaultScanWaitTimeout
config.ScanWaitTimeout = DefaultScanWaitTimeout
}
if config.MaxPackageSize == 0 {