From f4f3bf7f03e790b5d98004de3498c102bdac50ad Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 1 Feb 2022 12:31:05 -0500 Subject: internal/feed: add v3scope tests --- internal/feed/feed.go | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'internal/feed/feed.go') diff --git a/internal/feed/feed.go b/internal/feed/feed.go index 98e62ef..b9f7678 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -11,11 +11,6 @@ const ( Medium // medium complexity/priv req High // high complexity/priv req - Required // user interaction required - - Changed // scope changed - Unchanged // scope unchanged - Complete // complete integrity impact Partial // partial integrity impact @@ -29,32 +24,6 @@ const ( // TODO: parse cpe -// CVSS scope -type Scope int - -// Unmarshal CVSS scope from JSON. -func (me *Scope) 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 "CHANGED": - *me = Changed - case "UNCHANGED": - *me = Unchanged - default: - // return error - return fmt.Errorf("unknown scope: %s", s) - } - - // return success - return nil -} - // CVSS integrity/availability impact level type ImpactLevel int @@ -409,7 +378,7 @@ type CvssV3 struct { UserInteraction V3UserInteraction `json:"userInteraction"` // scope - Scope Scope `json:"scope"` + Scope V3Scope `json:"scope"` // integrity impact IntegrityImpact ImpactLevel `json:"integrityImpact"` -- cgit v1.2.3