Skip to content

Commit efa211a

Browse files
Merge branch 'main' into claude/gallant-bell-4bo4oy-b-example-profiles
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
2 parents 4660a33 + e1c9a2b commit efa211a

16 files changed

Lines changed: 109 additions & 16 deletions

File tree

‎Cargo.lock‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ anyhow = "1.0"
1818
log = "0.4"
1919
serde = { version = "1.0", features = ["derive"] }
2020
serde_json = "1.0"
21+
# JCS (RFC 8785) for JSON artefacts: the estate tool behind JSON-POLICY rule
22+
# J-1. Not on crates.io, so pinned to a full commit SHA.
23+
ijson-jcs = { git = "https://github.com/hyperpolymath/ijson-jcs", rev = "3a9a4ee326a968a32b2f152b4faec243a2d00765" }
2124
# Pure safe-Rust YAML (replaces serde_yaml + unsafe-libyaml, RUSTSEC-2024-0449).
2225
serde-saphyr = "2.0"
2326
regex = "1.10"

‎src/abduct/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ pub fn write_report(report: &AbductReport, path: &Path) -> Result<()> {
257257
fs::create_dir_all(parent)
258258
.with_context(|| format!("creating report parent directory {}", parent.display()))?;
259259
}
260-
let json = serde_json::to_string_pretty(report).context("serializing abduct report")?;
260+
let json = crate::json::to_canonical_string(report).context("serializing abduct report")?;
261261
fs::write(path, json).with_context(|| format!("writing report {}", path.display()))?;
262262
Ok(())
263263
}

‎src/adjudicate/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub fn write_report(report: &AdjudicateReport, path: &Path) -> Result<()> {
227227
fs::create_dir_all(parent)
228228
.with_context(|| format!("creating report parent directory {}", parent.display()))?;
229229
}
230-
let json = serde_json::to_string_pretty(report).context("serializing adjudicate report")?;
230+
let json = crate::json::to_canonical_string(report).context("serializing adjudicate report")?;
231231
fs::write(path, json).with_context(|| format!("writing report {}", path.display()))?;
232232
Ok(())
233233
}

‎src/aggregate/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ pub fn write_report(report: &AggregateReport, path: &Path) -> Result<()> {
408408
fs::create_dir_all(parent).with_context(|| format!("creating {}", parent.display()))?;
409409
}
410410
}
411-
let json = serde_json::to_string_pretty(report).context("serializing aggregate report")?;
411+
let json = crate::json::to_canonical_string(report).context("serializing aggregate report")?;
412412
fs::write(path, json).with_context(|| format!("writing {}", path.display()))?;
413413
Ok(())
414414
}

‎src/amuck/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub fn write_report(report: &AmuckReport, path: &Path) -> Result<()> {
249249
fs::create_dir_all(parent)
250250
.with_context(|| format!("creating report parent directory {}", parent.display()))?;
251251
}
252-
let json = serde_json::to_string_pretty(report).context("serializing amuck report")?;
252+
let json = crate::json::to_canonical_string(report).context("serializing amuck report")?;
253253
fs::write(path, json).with_context(|| format!("writing report {}", path.display()))?;
254254
Ok(())
255255
}

‎src/assay/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub fn write_report(report: &AssayReport, path: &Path) -> Result<()> {
288288
fs::create_dir_all(parent).with_context(|| format!("creating {}", parent.display()))?;
289289
}
290290
}
291-
let json = serde_json::to_string_pretty(report).context("serializing assay report")?;
291+
let json = crate::json::to_canonical_string(report).context("serializing assay report")?;
292292
fs::write(path, json).with_context(|| format!("writing {}", path.display()))?;
293293
Ok(())
294294
}

‎src/assemblyline.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ pub fn write_report(report: &AssemblylineReport, path: &Path) -> Result<()> {
534534
if let Some(parent) = path.parent() {
535535
fs::create_dir_all(parent)?;
536536
}
537-
let json = serde_json::to_string_pretty(report)?;
537+
let json = crate::json::to_canonical_string(report)?;
538538
fs::write(path, json)?;
539539
Ok(())
540540
}

‎src/axial/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pub fn write_report(report: &AxialReport, path: &Path) -> Result<()> {
279279
fs::create_dir_all(parent)
280280
.with_context(|| format!("creating report parent directory {}", parent.display()))?;
281281
}
282-
let json = serde_json::to_string_pretty(report).context("serializing axial report")?;
282+
let json = crate::json::to_canonical_string(report).context("serializing axial report")?;
283283
fs::write(path, json).with_context(|| format!("writing report {}", path.display()))?;
284284
Ok(())
285285
}

‎src/bridge/registry.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl MitigationRegistry {
109109
if let Some(parent) = path.parent() {
110110
std::fs::create_dir_all(parent)?;
111111
}
112-
let content = serde_json::to_string_pretty(self)?;
112+
let content = crate::json::to_canonical_string(self)?;
113113
std::fs::write(&path, content)?;
114114
Ok(())
115115
}

0 commit comments

Comments
 (0)