Skip to content

Commit

Permalink
Merge pull request #69 from WSE-research/62-security-reports-are-in-d…
Browse files Browse the repository at this point in the history
…atabase

added sql for table
  • Loading branch information
KnYL3R authored May 30, 2024
2 parents e31d283 + a71d4bd commit 1b9d504
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
19 changes: 19 additions & 0 deletions code/AmIVulnerable/Modells/Report.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;

namespace Modells {

public class Report {

/// <summary></summary>
[JsonPropertyName(nameof(AnalysedRepoUuid))]
public string AnalysedRepoUuid { get; set; } = "";

/// <summary></summary>
[JsonPropertyName(nameof(AnalysedRepoTag))]
public string? AnalysedRepoTag { get; set; } = null;

/// <summary></summary>
[JsonPropertyName(nameof(ReportMetrics))]
public object ReportMetrics { get; set; } = new ReportMetric();
}
}
23 changes: 23 additions & 0 deletions code/AmIVulnerable/Modells/ReportMetric.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;

namespace Modells {

public class ReportMetric {

/// <summary></summary>
[JsonPropertyName(nameof(TotalDirectVulnerabilities))]
public int TotalDirectVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(TotalTransitiveVulnerabilities))]
public int TotalTransitiveVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(MeanSeverityDirectVulnerabilities))]
public int MeanSeverityDirectVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(MeanSeverityTransitiveVulnerabilities))]
public int MeanSeverityTransitiveVulnerabilities { get; set; } = new int();
}
}
5 changes: 5 additions & 0 deletions code/AmIVulnerable/sql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

0 comments on commit 1b9d504

Please sign in to comment.