From a9cdb059f16659fa765e674cd9d917998140ab66 Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Tue, 17 Sep 2024 09:27:50 +0200 Subject: [PATCH] add cvss base score and vector string to api response --- .../gardenlinux/glvd/db/SourcePackageCve.java | 54 +++++++++++++++++-- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/gardenlinux/glvd/db/SourcePackageCve.java b/src/main/java/io/gardenlinux/glvd/db/SourcePackageCve.java index 306b3b7..e32af8b 100644 --- a/src/main/java/io/gardenlinux/glvd/db/SourcePackageCve.java +++ b/src/main/java/io/gardenlinux/glvd/db/SourcePackageCve.java @@ -28,33 +28,54 @@ public class SourcePackageCve { @Column(name = "cve_published_date", nullable = false) private String cvePublishedDate; + @Column(name = "base_score_v40", nullable = true) + private Float baseScoreV40; + + @Column(name = "base_score_v31", nullable = true) + private Float baseScoreV31; + + @Column(name = "base_score_v30", nullable = true) + private Float baseScoreV30; + + @Column(name = "vector_string_v40", nullable = true) + private String vectorStringV40; + + @Column(name = "vector_string_v31", nullable = true) + private String vectorStringV31; + + @Column(name = "vector_string_v30", nullable = true) + private String vectorStringV30; + public SourcePackageCve() { } - public SourcePackageCve(String cveId, @Nonnull String sourcePackageName, @Nonnull String sourcePackageVersion, @Nonnull String gardenlinuxVersion, boolean isVulnerable, @Nonnull String cvePublishedDate) { + public SourcePackageCve(String cveId, String sourcePackageName, String sourcePackageVersion, String gardenlinuxVersion, boolean isVulnerable, String cvePublishedDate, Float baseScoreV40, Float baseScoreV31, Float baseScoreV30, String vectorStringV40, String vectorStringV31, String vectorStringV30) { this.cveId = cveId; this.sourcePackageName = sourcePackageName; this.sourcePackageVersion = sourcePackageVersion; this.gardenlinuxVersion = gardenlinuxVersion; this.isVulnerable = isVulnerable; this.cvePublishedDate = cvePublishedDate; + this.baseScoreV40 = baseScoreV40; + this.baseScoreV31 = baseScoreV31; + this.baseScoreV30 = baseScoreV30; + this.vectorStringV40 = vectorStringV40; + this.vectorStringV31 = vectorStringV31; + this.vectorStringV30 = vectorStringV30; } public String getCveId() { return cveId; } - @Nonnull public String getSourcePackageName() { return sourcePackageName; } - @Nonnull public String getSourcePackageVersion() { return sourcePackageVersion; } - @Nonnull public String getGardenlinuxVersion() { return gardenlinuxVersion; } @@ -63,8 +84,31 @@ public boolean isVulnerable() { return isVulnerable; } - @Nonnull public String getCvePublishedDate() { return cvePublishedDate; } + + public Float getBaseScoreV40() { + return baseScoreV40; + } + + public Float getBaseScoreV31() { + return baseScoreV31; + } + + public Float getBaseScoreV30() { + return baseScoreV30; + } + + public String getVectorStringV40() { + return vectorStringV40; + } + + public String getVectorStringV31() { + return vectorStringV31; + } + + public String getVectorStringV30() { + return vectorStringV30; + } } \ No newline at end of file