Skip to content

Commit

Permalink
lib: add support for "related" field
Browse files Browse the repository at this point in the history
The "related" field in our advisory format was documented but not
implemented.  Implement it.
  • Loading branch information
frasertweedale authored and mihaimaruseac committed Jun 28, 2023
1 parent 2180474 commit 760eafa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/hsec-tools/src/Security/Advisories/Definition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data Advisory = Advisory
, advisoryCWEs :: [CWE]
, advisoryKeywords :: [Keyword]
, advisoryAliases :: [Text]
, advisoryRelated :: [Text]
, advisoryAffected :: [Affected]
, advisoryReferences :: [Reference]
, advisoryPandoc :: Pandoc -- ^ Parsed document, without TOML front matter
Expand Down
4 changes: 4 additions & 0 deletions code/hsec-tools/src/Security/Advisories/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ parseAdvisoryTable oob policy table doc summary details html = runTableParser $
aliases <-
fromMaybe []
<$> optional advisory "aliases" (isArrayOf isString)
related <-
fromMaybe []
<$> optional advisory "related" (isArrayOf isString)

affected <- mandatory table "affected" (isArrayOf parseAffected)
references <- mandatory table "references" (isArrayOf parseReference)
Expand All @@ -188,6 +191,7 @@ parseAdvisoryTable oob policy table doc summary details html = runTableParser $
, advisoryCWEs = cats
, advisoryKeywords = kwds
, advisoryAliases = aliases
, advisoryRelated = related
, advisoryAffected = affected
, advisoryReferences = references
, advisoryPandoc = doc
Expand Down

0 comments on commit 760eafa

Please sign in to comment.