diff --git a/code/AmIVulnerable/Modells/Report.cs b/code/AmIVulnerable/Modells/Report.cs new file mode 100644 index 0000000..84837c7 --- /dev/null +++ b/code/AmIVulnerable/Modells/Report.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace Modells { + + public class Report { + + /// + [JsonPropertyName(nameof(AnalysedRepoUuid))] + public string AnalysedRepoUuid { get; set; } = ""; + + /// + [JsonPropertyName(nameof(AnalysedRepoTag))] + public string? AnalysedRepoTag { get; set; } = null; + + /// + [JsonPropertyName(nameof(ReportMetrics))] + public object ReportMetrics { get; set; } = new ReportMetric(); + } +} diff --git a/code/AmIVulnerable/Modells/ReportMetric.cs b/code/AmIVulnerable/Modells/ReportMetric.cs new file mode 100644 index 0000000..a7ec03c --- /dev/null +++ b/code/AmIVulnerable/Modells/ReportMetric.cs @@ -0,0 +1,23 @@ +using System.Text.Json.Serialization; + +namespace Modells { + + public class ReportMetric { + + /// + [JsonPropertyName(nameof(TotalDirectVulnerabilities))] + public int TotalDirectVulnerabilities { get; set; } = new int(); + + /// + [JsonPropertyName(nameof(TotalTransitiveVulnerabilities))] + public int TotalTransitiveVulnerabilities { get; set; } = new int(); + + /// + [JsonPropertyName(nameof(MeanSeverityDirectVulnerabilities))] + public int MeanSeverityDirectVulnerabilities { get; set; } = new int(); + + /// + [JsonPropertyName(nameof(MeanSeverityTransitiveVulnerabilities))] + public int MeanSeverityTransitiveVulnerabilities { get; set; } = new int(); + } +} diff --git a/code/AmIVulnerable/sql/init.sql b/code/AmIVulnerable/sql/init.sql index 3053aef..71468ac 100644 --- a/code/AmIVulnerable/sql/init.sql +++ b/code/AmIVulnerable/sql/init.sql @@ -46,3 +46,8 @@ CREATE TABLE IF NOT EXISTS cve.repositories( repoDesignation VARCHAR(300) NOT NULL, tag VARCHAR(500) DEFAULT '' ); + +CREATE TABLE IF NOT EXISTS cve.reports( + guid VARCHAR(36) PRIMARY KEY NOT NULL, + metrics JSON NOT NULL +);