Module sarif_parse
Expand description
SARIF 2.1.0 subset parser for external scanner findings.
Implements the minimal robust parse subset verified against SARIF 2.1.0:
rule_id:result.ruleIdelserun.tool.driver.rules[ruleIndex].idpath:locations[0].physicalLocation.artifactLocation.uri, withfile://scheme and leading./stripped;uriBaseId-agnosticstart_line/end_line: NULLABLE (absent in many dialects)level: result → ruledefaultConfiguration.level→"warning"fingerprint:partialFingerprints.primaryLocationLineHash→ anypartialFingerprintsvalue → anyfingerprintsvalue → self-hashsha256(engine|rule_id|path|start_line)message.text
Unparseable individual results are skipped with tracing::warn; a
document that is not SARIF at all (missing version or runs) returns
Err.
Structs§
- External
Finding - A single normalized external finding extracted from a SARIF document.
Functions§
- parse_
sarif_ with_ engines - Parse a SARIF 2.1.0 document once, returning both the normalized findings and every scanner engine name present across all runs.
- self_
hash_ fingerprint - Compute the self-hash fingerprint fallback:
sha256(engine|rule_id|path| start_line), prefixedsha256:. An absentstart_linecontributes an empty final part.