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.go32
1 files changed, 1 insertions, 31 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index 38a7767..4b18b9d 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -29,36 +29,6 @@ const (
// TODO: parse cpe
-// CVSS privileges required
-type PrivilegesRequired int
-
-// Unmarshal CVSS privileges required from JSON.
-func (me *PrivilegesRequired) 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 "LOW":
- *me = Low
- case "MEDIUM":
- *me = Medium
- case "HIGH":
- *me = High
- default:
- // return error
- return fmt.Errorf("unknown privileges required: %s", s)
- }
-
- // return success
- return nil
-}
-
// CVSS user interaction
type UserInteraction int
@@ -459,7 +429,7 @@ type CvssV3 struct {
AttackComplexity V3AttackComplexity `json:"attackComplexity"`
// privileges required
- PrivilegesRequired PrivilegesRequired `json:"privilegesRequired"`
+ PrivilegesRequired V3PrivilegesRequired `json:"privilegesRequired"`
// user interaction
UserInteraction UserInteraction `json:"userInteraction"`