Skip to content

Commit 2c00a40

Browse files
committed
chore: bump hsec-tools 0.3.0.0
1 parent 1d19f91 commit 2c00a40

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

code/hsec-tools/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.3.0.0
2+
3+
* Move `isVersionAffectedBy` and `isVersionRangeAffectedBy` to `Security.Advisories.Core` (`hsec-core`)
4+
* Add support for GHC component in `query is-affected`
5+
16
## 0.2.0.2
27

38
* Update `tasty` dependency bounds

code/hsec-tools/hsec-tools.cabal

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: hsec-tools
3-
version: 0.2.0.2
3+
version: 0.3.0.0
44

55
-- A short (one-line) description of the package.
66
synopsis:
@@ -65,7 +65,7 @@ library
6565
, directory <2
6666
, extra >=1.7 && <1.9
6767
, filepath >=1.4 && <1.6
68-
, hsec-core ^>= 0.2
68+
, hsec-core >= 0.2.1.0 && <0.3
6969
, file-embed >=0.0.13.0 && <0.0.17
7070
, lucid >=2.9.0 && < 3
7171
, mtl >=2.2 && <2.4
@@ -106,17 +106,17 @@ executable hsec-tools
106106
-- LANGUAGE extensions used by modules in this package.
107107
-- other-extensions:
108108
build-depends:
109-
, aeson >=2.0.1.0 && <3
110-
, base >=4.14 && <5
111-
, bytestring >=0.10 && <0.13
112-
, Cabal-syntax >=3.8.1.0 && <3.15
113-
, filepath >=1.4 && <1.6
114-
, hsec-core ^>= 0.2
109+
, aeson >=2.0.1.0 && <3
110+
, base >=4.14 && <5
111+
, bytestring >=0.10 && <0.13
112+
, Cabal-syntax >=3.8.1.0 && <3.15
113+
, filepath >=1.4 && <1.6
114+
, hsec-core >= 0.2.1.0 && <0.3
115115
, hsec-tools
116-
, optparse-applicative >=0.17 && <0.19
117-
, text >=1.2 && <3
116+
, optparse-applicative >=0.17 && <0.19
117+
, text >=1.2 && <3
118118
, transformers
119-
, validation-selective >=0.1 && <1
119+
, validation-selective >=0.1 && <1
120120

121121
hs-source-dirs: app
122122
default-language: Haskell2010

code/hsec-tools/src/Security/Advisories/Queries.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module Security.Advisories.Queries
55
where
66

77
import Control.Monad.IO.Class (MonadIO)
8-
import Data.Text (Text)
98
import Distribution.Types.Version (Version)
109
import Distribution.Types.VersionRange (VersionRange)
1110
import Validation (Validation(..))
@@ -16,22 +15,22 @@ import Security.Advisories.Parse
1615

1716
type QueryResult = Validation [(FilePath, ParseAdvisoryError)] [Advisory]
1817

19-
-- | List the advisories matching a package name and a version
18+
-- | List the advisories matching a component and a version
2019
listVersionAffectedBy
2120
:: MonadIO m
22-
=> FilePath -> Text -> Version -> m QueryResult
21+
=> FilePath -> ComponentIdentifier -> Version -> m QueryResult
2322
listVersionAffectedBy = listAffectedByHelper isVersionAffectedBy
2423

25-
-- | List the advisories matching a package name and a version range
24+
-- | List the advisories matching a component and a version range
2625
listVersionRangeAffectedBy
2726
:: (MonadIO m)
28-
=> FilePath -> Text -> VersionRange -> m QueryResult
27+
=> FilePath -> ComponentIdentifier -> VersionRange -> m QueryResult
2928
listVersionRangeAffectedBy = listAffectedByHelper isVersionRangeAffectedBy
3029

3130
-- | Helper function for 'listVersionAffectedBy' and 'listVersionRangeAffectedBy'
3231
listAffectedByHelper
3332
:: (MonadIO m)
34-
=> (ComponentIdentifier -> a -> Advisory -> Bool) -> FilePath -> Text -> a -> m QueryResult
35-
listAffectedByHelper checkAffectedBy root queryPackageName queryVersionish =
36-
fmap (filter (checkAffectedBy (Hackage queryPackageName) queryVersionish)) <$>
33+
=> (ComponentIdentifier -> a -> Advisory -> Bool) -> FilePath -> ComponentIdentifier -> a -> m QueryResult
34+
listAffectedByHelper checkAffectedBy root queryComponent queryVersionish =
35+
fmap (filter (checkAffectedBy queryComponent queryVersionish)) <$>
3736
listAdvisories root

0 commit comments

Comments
 (0)