chenzehaoo/moon_guard/lib/report does not have a README file

    Finding

    pub(all) struct Finding {
    title : String
    description : String
    risk_level : RiskLevel
    remediation : String
    }

    ReportStatus

    pub(all) enum ReportStatus {
    Pass
    Warning
    Fail
    } derive(Eq,
    Debug
    )

    RiskLevel

    pub(all) enum RiskLevel {
    Critical
    High
    Medium
    Low
    Info
    } derive(Eq)

    impl Show for RiskLevel

    SecurityReport

    pub(all) struct SecurityReport {
    package_name : String
    package_version : String
    overall_status : ReportStatus
    findings : Array[Finding]
    signature_verified : Bool
    typosquat_suspects : Array[String]
    file_count : Int
    risk_score : Double
    audit_timestamp : String
    }

    SecurityReport::add_finding

    fn SecurityReport::add_finding(self : SecurityReport, f : Finding) -> Unit

    SecurityReport::new

    fn SecurityReport::new(package_name : String, package_version : String) -> SecurityReport

    SecurityReport::recompute_score

    fn SecurityReport::recompute_score(self : SecurityReport) -> Unit

    Recompute risk_score and clamp to [0, 10]. Call after batch-adding findings so callers don't have to track the running total.

    SecurityReport::summary

    fn SecurityReport::summary(self : SecurityReport) -> String

    TyposquatSummaryEntry

    pub(all) struct TyposquatSummaryEntry {
    suspect : String
    hit_count : Int
    first_similar_to : String
    first_attack : String
    }

    make_finding

    fn make_finding(title : String, description : String, risk : RiskLevel, remediation : String) -> Finding

    Convenience constructor that wires a Finding together from common fields. Cuts down on the boilerplate at audit call sites.

    report_to_json

    fn report_to_json(report : SecurityReport) -> String

    Source Files