1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::{
blob::BlobMetadata, findings_store, matcher::Match, origin::OriginSet, rules::rule::Confidence,
validation_body::ValidationResponseBody,
};
// -------------------------------------------------------------------------------------------------
// FindingData
// -------------------------------------------------------------------------------------------------
/// A set of match data entries
pub type FindingData = Vec<FindingDataEntry>;
// -------------------------------------------------------------------------------------------------
// FindingDataEntry
// -------------------------------------------------------------------------------------------------
/// Data for a single `Match`
#[derive(Debug)]
pub struct FindingDataEntry {
pub origin: OriginSet,
pub blob_metadata: BlobMetadata,
pub match_id: findings_store::MatchIdInt,
pub match_val: Match,
pub match_comment: Option<String>,
pub match_confidence: Confidence,
pub visible: bool,
/// Validation Body
pub validation_response_body: ValidationResponseBody,
/// Validation Status Code
pub validation_response_status: u16,
/// Validation Success
pub validation_success: bool,
/// Semantic validation outcome.
pub validation_outcome: kingfisher_core::ValidationOutcome,
}
// -------------------------------------------------------------------------------------------------
// FindingMetadata
// -------------------------------------------------------------------------------------------------
/// Metadata for a group of matches that have identical rule name and match
/// content.
#[derive(Debug, Deserialize, Serialize, JsonSchema, Clone)]
pub struct FindingMetadata {
/// The content-based finding identifier for this group of matches
pub finding_id: String,
/// The name of the rule that detected each match
pub rule_name: String,
/// The textual identifier of the rule that detected each match
pub rule_text_id: String,
/// The structural identifier of the rule that detected each match
pub rule_finding_fingerprint: String,
/// Determines if a match is displayed to the user
pub visible: bool,
/// The number of matches in the group
pub num_matches: usize,
/// A comment assigned to this finding
pub comment: Option<String>,
}