forked from mirrors/kingfisher
- Stored optional validation response bodies as boxed strings to avoid allocating empty payloads and to streamline validator caches. - Parallelized git cloning based on the configured job count and begin scanning repositories as soon as each clone finishes to reduce end-to-end scan times. - Combined per-repository results into a single aggregate summary after scans complete. - Added initial access-map support and report viewer html file. Currently beta features.
62 lines
2.2 KiB
Rust
62 lines
2.2 KiB
Rust
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,
|
|
}
|
|
// -------------------------------------------------------------------------------------------------
|
|
// 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>,
|
|
}
|