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.go33
1 files changed, 2 insertions, 31 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index aa5fd08..56fc7d2 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -19,36 +19,7 @@ const (
Single // Single authentication
)
-// TODO: parse cpe
-
-// CVSS V2 attack complexity
-type AccessComplexity int
-
-// Unmarshal CVSS V2 access complexity from JSON.
-func (me *AccessComplexity) 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 "LOW":
- *me = Low
- case "MEDIUM":
- *me = Medium
- case "HIGH":
- *me = High
- default:
- // return error
- return fmt.Errorf("unknown access complexity: %s", s)
- }
-
- // return success
- return nil
-}
-
+// TODO: parse cpe, cve id
// CVSS V2 authentication
type Authentication int
@@ -293,7 +264,7 @@ type CvssV2 struct {
AccessVector V2AccessVector `json:"accessVector"`
// attack complexity
- AccessComplexity AccessComplexity `json:"accessComplexity"`
+ AccessComplexity V2AccessComplexity `json:"accessComplexity"`
// authentication
Authentication Authentication `json:"authentication"`