Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cvss base score and vector string to api response #41

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 49 additions & 5 deletions src/main/java/io/gardenlinux/glvd/db/SourcePackageCve.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
}
Loading