fix: --json draws the same cells as the table
Some checks are pending
Check / Test & lint (linux) (push) Waiting to run
Check / Artifact round-trip (push) Waiting to run
Check / Test & lint (windows) (push) Waiting to run
Check / Supply chain (push) Waiting to run

The document built each row from the legs' raw statuses while the table went through build_domain_row, so a leg that answered with a Russian-rooted chain read RU CA on screen and ok in the document. Both now call the same function, which is the only way the two cannot drift again - Rule 5 asks exactly for that.
This commit is contained in:
Kirill Minovsky 2026-10-14 22:34:29 +03:00
parent c9d7750256
commit 65879ff2bd

View file

@ -1203,18 +1203,25 @@ pub(crate) async fn run_test_suite(
results.domain_inspection = Some(
entries
.iter()
.map(|e| crate::json::DomainRow {
domain: e.domain.clone(),
resolved: e.resolved.map(|ip| ip.to_string()),
http: e.http.status.as_str(),
http_detail: e.http.detail.clone(),
tls12: e.t12.status.as_str(),
tls12_detail: e.t12.detail.clone(),
tls13: e.t13.status.as_str(),
tls13_detail: e.t13.detail.clone(),
quic: e.quic.status.as_str(),
quic_detail: e.quic.detail.clone(),
cert_detail: e.cert_mark(),
.map(|e| {
// The same cells the table draws, from the same function:
// a `RU CA` badge in the table and an `ok` in the document
// is exactly the disagreement Rule 5 exists to prevent.
let (http, tls12, tls13, quic, _details) =
dpi_core::probe::domains::build_domain_row(e);
crate::json::DomainRow {
domain: e.domain.clone(),
resolved: e.resolved.map(|ip| ip.to_string()),
http: http.as_str(),
http_detail: e.http.detail.clone(),
tls12: tls12.as_str(),
tls12_detail: e.t12.detail.clone(),
tls13: tls13.as_str(),
tls13_detail: e.t13.detail.clone(),
quic: quic.as_str(),
quic_detail: e.quic.detail.clone(),
cert_detail: e.cert_mark(),
}
})
.collect(),
);