aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go41
1 files changed, 3 insertions, 38 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index 56fc7d2..affa5d2 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -6,47 +6,12 @@ import (
)
const (
- None = iota // no priv req/user interaction
- Low // low complexity/priv req
- Medium // medium complexity/priv req
- High // high complexity/priv req
-
- Critical // critical severity
-
- CvssVersion31 // CVSS version 3.1
- CvssVersion20 // CVSS version 2.0
-
- Single // Single authentication
+ CvssVersion31 = iota // CVSS version 3.1
+ CvssVersion20 // CVSS version 2.0
)
// TODO: parse cpe, cve id
-// CVSS V2 authentication
-type Authentication int
-
-// Unmarshal CVSS V2 authentication from JSON.
-func (me *Authentication) UnmarshalJSON(b []byte) error {
- // decode string, check for error
- var s string
- if err := json.Unmarshal(b, &s); err != nil {
- return err
- }
-
- // check value
- switch s {
- case "NONE":
- *me = None
- case "SINGLE":
- *me = Single
- default:
- // return error
- return fmt.Errorf("unknown authentication: %s", s)
- }
-
- // return success
- return nil
-}
-
// CVE metadata
type CveMetadata struct {
// CVE ID
@@ -267,7 +232,7 @@ type CvssV2 struct {
AccessComplexity V2AccessComplexity `json:"accessComplexity"`
// authentication
- Authentication Authentication `json:"authentication"`
+ Authentication V2Authentication `json:"authentication"`
ConfidentialityImpact V2Impact `json:"confidentialityImpact"`
IntegrityImpact V2Impact `json:"integrityImpact"`