diff options
Diffstat (limited to 'grasp-audit')
| -rw-r--r-- | grasp-audit/src/probe.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/grasp-audit/src/probe.rs b/grasp-audit/src/probe.rs index 1a8687e..ecbbcc9 100644 --- a/grasp-audit/src/probe.rs +++ b/grasp-audit/src/probe.rs | |||
| @@ -447,7 +447,20 @@ pub async fn run_probe( | |||
| 447 | .json::<serde_json::Value>() | 447 | .json::<serde_json::Value>() |
| 448 | .await | 448 | .await |
| 449 | .ok() | 449 | .ok() |
| 450 | .and_then(|v| v.get("name").and_then(|n| n.as_str()).map(|s| s.to_string())); | 450 | .map(|v| { |
| 451 | let name = v.get("name").and_then(|n| n.as_str()).unwrap_or("unknown"); | ||
| 452 | // software is typically a repo URL; take the last path segment | ||
| 453 | let software = v | ||
| 454 | .get("software") | ||
| 455 | .and_then(|s| s.as_str()) | ||
| 456 | .map(|s| s.trim_end_matches('/').rsplit('/').next().unwrap_or(s)) | ||
| 457 | .unwrap_or("unknown"); | ||
| 458 | let version = v | ||
| 459 | .get("version") | ||
| 460 | .and_then(|ver| ver.as_str()) | ||
| 461 | .unwrap_or("unknown"); | ||
| 462 | format!("{} ({} v{})", name, software, version) | ||
| 463 | }); | ||
| 451 | checks.push(ProbeCheck { | 464 | checks.push(ProbeCheck { |
| 452 | name: "nip11_fetch", | 465 | name: "nip11_fetch", |
| 453 | passed: true, | 466 | passed: true, |