Skip to content

Commit

Permalink
Update the model to match the latest version of the OSV schema (googl…
Browse files Browse the repository at this point in the history
…e#403)

- Adds "related" field.
- Adds constants for Rocky Linux and AlmaLinux.
- Add new reference types "DETECTION", "DISCUSSION", and "INTRODUCED"

---------

Signed-off-by: Caleb Brown <calebbrown@google.com>
  • Loading branch information
calebbrown committed Jun 8, 2023
1 parent b5af6c7 commit 5738bec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/models/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const (
EcosystemGitHubActions Ecosystem = "GitHub Actions"
EcosystemPub Ecosystem = "Pub"
EcosystemConanCenter Ecosystem = "ConanCenter"
EcosystemRockyLinux Ecosystem = "Rocky Linux"
EcosystemAlmaLinux Ecosystem = "AlmaLinux"
)

type SeverityType string
Expand All @@ -40,13 +42,16 @@ const (
type ReferenceType string

const (
ReferenceAdvisory ReferenceType = "ADVISORY"
ReferenceArticle ReferenceType = "ARTICLE"
ReferenceReport ReferenceType = "REPORT"
ReferenceFix ReferenceType = "FIX"
ReferencePackage ReferenceType = "PACKAGE"
ReferenceEvidence ReferenceType = "EVIDENCE"
ReferenceWeb ReferenceType = "WEB"
ReferenceAdvisory ReferenceType = "ADVISORY"
ReferenceArticle ReferenceType = "ARTICLE"
ReferenceDetection ReferenceType = "DETECTION"
ReferenceDiscussion ReferenceType = "DISCUSSION"
ReferenceReport ReferenceType = "REPORT"
ReferenceFix ReferenceType = "FIX"
ReferenceIntroduced ReferenceType = "INTRODUCED"
ReferencePackage ReferenceType = "PACKAGE"
ReferenceEvidence ReferenceType = "EVIDENCE"
ReferenceWeb ReferenceType = "WEB"
)

type CreditType string
Expand Down
1 change: 1 addition & 0 deletions pkg/models/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type Vulnerability struct {
Modified time.Time `json:"modified"`
Published time.Time `json:"published"`
Aliases []string `json:"aliases,omitempty"`
Related []string `json:"related,omitempty"`
Summary string `json:"summary"`
Details string `json:"details"`
Affected []Affected `json:"affected"`
Expand Down

0 comments on commit 5738bec

Please sign in to comment.