| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Cve.Internal
Description
Advisory handles, SQLite verification, and masked ownership transfer. The public Ecluse.Core.Cve module curates these operations.
Synopsis
- data AdvisoryRange = AdvisoryRange {
- arCveId :: Text
- arSeverity :: Maybe Double
- arIntroduced :: Maybe Text
- arUpperBound :: UpperBound
- arEpss :: Maybe Double
- data CveDbRejected
- verifyConnection :: Ecosystem -> EpssRequirement -> Connection -> IO (Either CveDbRejected ())
- acceptConnection :: IO Connection -> (Connection -> IO ()) -> (Connection -> IO (Either CveDbRejected a)) -> (Connection -> a -> IO b) -> IO (Either CveDbRejected b)
- transferCveDb :: Ecosystem -> EpssRequirement -> FilePath -> (CveDb -> IO a) -> IO (Either CveDbRejected a)
- data CveDb = CveDb {
- cveDbLookup :: CveLookup
- cveDbClose :: IO ()
- cveDbMeta :: [(Text, Text)]
- cveDbProvenance :: AdvisoryProvenance
- data CveLookup = CveLookup {
- cveAdvisoriesFor :: Text -> IO [AdvisoryRange]
- cveCoveredNames :: IO [Text]
- data CveQueryFault = CveQueryFault {}
- advisoriesQuery :: Connection -> Text -> IO [AdvisoryRange]
- coveredNamesQuery :: Connection -> IO [Text]
- toRange :: (Text, Maybe Text, Maybe Text, Maybe Text, Maybe Double, Maybe Double) -> AdvisoryRange
- provenanceQuery :: Connection -> IO [(Text, Text)]
Documentation
data AdvisoryRange Source #
An advisory segment with nullable CVSS and EPSS scores and verbatim version bounds. The introduced bound is inclusive. Absence means the segment starts at the beginning.
Constructors
| AdvisoryRange | |
Fields
| |
Instances
| Show AdvisoryRange Source # | |
Defined in Ecluse.Core.Cve.Internal Methods showsPrec :: Int -> AdvisoryRange -> ShowS # show :: AdvisoryRange -> String # showList :: [AdvisoryRange] -> ShowS # | |
| Eq AdvisoryRange Source # | |
Defined in Ecluse.Core.Cve.Internal Methods (==) :: AdvisoryRange -> AdvisoryRange -> Bool # (/=) :: AdvisoryRange -> AdvisoryRange -> Bool # | |
data CveDbRejected Source #
Why the hardened open refused an artifact before building a handle over it. A rejection is a value, not a fault, so the caller can keep the last known-good database.
Constructors
| CveDbWrongEpoch Int | The artifact's |
| CveDbIntegrityFailed [Text] | SQLite refused the file or reported integrity faults, carrying its error or report. |
| CveDbSchemaNonConformant Text | A required relation is absent, non-strict, or lacks a column with its required type. |
| CveDbEcosystemMismatch (Maybe Text) | The ecosystem marker differs from the requested ecosystem or is absent. |
| CveDbEpssNotEstablished | Required feed enrichment lacks the exact success marker. |
Instances
| Show CveDbRejected Source # | |
Defined in Ecluse.Core.Cve.Internal Methods showsPrec :: Int -> CveDbRejected -> ShowS # show :: CveDbRejected -> String # showList :: [CveDbRejected] -> ShowS # | |
| Eq CveDbRejected Source # | |
Defined in Ecluse.Core.Cve.Internal Methods (==) :: CveDbRejected -> CveDbRejected -> Bool # (/=) :: CveDbRejected -> CveDbRejected -> Bool # | |
verifyConnection :: Ecosystem -> EpssRequirement -> Connection -> IO (Either CveDbRejected ()) Source #
Harden and verify the connection. Its owner remains responsible for closing it.
acceptConnection :: IO Connection -> (Connection -> IO ()) -> (Connection -> IO (Either CveDbRejected a)) -> (Connection -> a -> IO b) -> IO (Either CveDbRejected b) Source #
Acquire masked, verify under the caller's mask state, then transfer ownership to the masked continuation.
transferCveDb :: Ecosystem -> EpssRequirement -> FilePath -> (CveDb -> IO a) -> IO (Either CveDbRejected a) Source #
Transfer an accepted database to a masked owner. Verification retains the caller's masking state.
One opened artifact. Its holder owns the connection's lifetime, and hands a consumer cveDbLookup only.
Constructors
| CveDb | |
Fields
| |
Query by canonical package key, with an npm scope inline. A display name is never a query key.
Constructors
| CveLookup | |
Fields
| |
data CveQueryFault Source #
A database query fault for the rule's resilience policy to classify.
Constructors
| CveQueryFault | |
Instances
| Exception CveQueryFault Source # | |
Defined in Ecluse.Core.Cve.Internal Methods toException :: CveQueryFault -> SomeException # fromException :: SomeException -> Maybe CveQueryFault # displayException :: CveQueryFault -> String # backtraceDesired :: CveQueryFault -> Bool # | |
| Show CveQueryFault Source # | |
Defined in Ecluse.Core.Cve.Internal Methods showsPrec :: Int -> CveQueryFault -> ShowS # show :: CveQueryFault -> String # showList :: [CveQueryFault] -> ShowS # | |
| Eq CveQueryFault Source # | |
Defined in Ecluse.Core.Cve.Internal Methods (==) :: CveQueryFault -> CveQueryFault -> Bool # (/=) :: CveQueryFault -> CveQueryFault -> Bool # | |
advisoriesQuery :: Connection -> Text -> IO [AdvisoryRange] Source #
Every advisory segment recorded against a package name.
coveredNamesQuery :: Connection -> IO [Text] Source #
Every package name this artifact records an advisory against, each once. The name index covers the scan, and the result is what a store sweep intersects its listing with.
toRange :: (Text, Maybe Text, Maybe Text, Maybe Text, Maybe Double, Maybe Double) -> AdvisoryRange Source #
One artifact row as an advisory segment, decoding the two nullable bound columns into the segment's single upper bound.
provenanceQuery :: Connection -> IO [(Text, Text)] Source #
The artifact's meta provenance rows, key-sorted for a deterministic snapshot.
It runs only on an accepted connection, so the (Text, Text) decode cannot throw.