add cvss version to metadata constructor

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-05-25 15:40:45 -04:00 committed by Alfredo Deza
parent 96fed8e60c
commit abc711a6be

View file

@ -13,9 +13,10 @@ type Metadata struct {
}
type Cvss struct {
Version string
Vector string
Metrics CvssMetrics
Version string
Vector string
Metrics CvssMetrics
VendorMetadata interface{}
}
type CvssMetrics struct {
@ -42,12 +43,14 @@ func NewCvss(m []db.Cvss) []Cvss {
var cvss []Cvss
for _, score := range m {
cvss = append(cvss, Cvss{
Vector: score.Vector,
Version: score.Version,
Vector: score.Vector,
Metrics: CvssMetrics{
BaseScore: score.Metrics.BaseScore,
ExploitabilityScore: score.Metrics.ExploitabilityScore,
ImpactScore: score.Metrics.ImpactScore,
},
VendorMetadata: score.VendorMetadata,
})
}
return cvss