test_shisho_policy/decision/
data_entry.rs

1use super::severity::Severity;
2use serde::Deserialize;
3
4/// these are the data entries of policy results to help the definition of how you handle security matters.
5/// They are the aggregation of datasets for showing/searching/filtering results.
6#[derive(Deserialize, Debug, Default)]
7pub struct DecisionEntry<T> {
8    /// [EDITABLE] this is a generic data type to store the information of founded security risks such as file locations, service name, the type of security risks, etc.
9    pub data: T,
10
11    /// [RESERVED] the identifier, `policy_report_id`(`policyReportId` in a GraphQL query) coming from `Input Data` should be set. This is editable but is reserved for a specific purpose.
12    pub resource_id: ResourceId,
13
14    /// [EDITABLE] this indicates the risk level.  
15    pub severity: Severity,
16}
17
18/// the identifier, `policy_report_id`(`policyReportId` in a GraphQL query) coming from `Input Data` should be set. This is editable but is reserved for a specific purpose.
19#[derive(Deserialize, Debug, Default)]
20pub struct ResourceId {
21    pub value: String,
22}
23
24impl ResourceId {
25    pub fn new(resource_id: &str) -> ResourceId {
26        ResourceId {
27            value: resource_id.to_string(),
28        }
29    }
30}