-
Notifications
You must be signed in to change notification settings - Fork 13
/
msrc_vulnerability.go
38 lines (34 loc) · 1010 Bytes
/
msrc_vulnerability.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package unmarshal
import (
"io"
)
// MSRCVulnerability represents a single Msrc entry with vulnerability metadata
type MSRCVulnerability struct {
Cvss struct {
BaseScore float64 `json:"base_score"`
TemporalScore float64 `json:"temporal_score"`
Vector string `json:"vector"`
} `json:"cvss"`
FixedIn []struct {
ID string `json:"id"`
IsFirst bool `json:"is_first"`
IsLatest bool `json:"is_latest"`
Links []string `json:"links"`
} `json:"fixed_in"`
ID string `json:"id"`
Link string `json:"link"`
Product struct {
Family string `json:"family"`
ID string `json:"id"`
Name string `json:"name"`
} `json:"product"`
Severity string `json:"severity"`
Summary string `json:"summary"`
Vulnerable []string `json:"vulnerable"`
}
func (o MSRCVulnerability) IsEmpty() bool {
return o.ID == ""
}
func MSRCVulnerabilityEntries(reader io.Reader) ([]MSRCVulnerability, error) {
return unmarshalSingleOrMulti[MSRCVulnerability](reader)
}