Backend refactor reconciliation + ASPA verification fix + silent-failure audit #2

Merged
rene.fichtmueller merged 12 commits from merge-prod-snapshot into main 2026-07-16 20:18:49 +00:00
Showing only changes of commit 46f96755ac - Show all commits

View File

@ -4187,15 +4187,22 @@ const server = http.createServer(async (req, res) => {
var asnInPaths = neighbours.map(function(n) { return n.asn; });
var bogonAsns = asnInPaths.filter(checkBogonAsn);
// "pass" must mean prefixes/neighbours were actually fetched and checked clean --
// not that the upstream RIPE Stat calls failed and left nothing to check.
var bogonDataUnavailable = !prefixData && !neighbourData;
// not that the upstream source failed and left nothing to check. A source is
// unavailable if it's falsy (fetchRipeStatCached network failure) OR if it's a
// truthy object with status:"error" (local-db-client.js's DB-error signal --
// see the 2026-07-16 audit; that object is NOT null, so a plain `!x` check
// alone misses this case and would show "pass" on 0 checked prefixes).
function isSourceUnavailable(x) { return !x || x.status === "error"; }
var prefixesUnavailable = isSourceUnavailable(prefixData);
var neighboursUnavailable = isSourceUnavailable(neighbourData);
var bogonDataUnavailable = prefixesUnavailable && neighboursUnavailable;
var bogonResult = {
status: bogonDataUnavailable ? "info" : (bogonPrefixes.length === 0 && bogonAsns.length === 0 ? "pass" : "fail"),
bogon_prefixes: bogonPrefixes,
bogon_asns_in_paths: bogonAsns,
total_prefixes_checked: allPrefixes.length,
prefixes_source_unavailable: !prefixData,
neighbours_source_unavailable: !neighbourData,
prefixes_source_unavailable: prefixesUnavailable,
neighbours_source_unavailable: neighboursUnavailable,
};
// Phase 2: All API-dependent validations in parallel