| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Security.Advisories.Filesystem
Description
Helpers for the security-advisories file system.
Top-level functions that take a FilePath expect the path to the
top-level directory of the security-advisories repository (i.e.
it must have the advisories/ subdirectory).
Synopsis
- dirNameAdvisories :: FilePath
- dirNameReserved :: FilePath
- isSecurityAdvisoriesRepo :: FilePath -> IO Bool
- getReservedIds :: FilePath -> IO [HsecId]
- getAdvisoryIds :: FilePath -> IO [HsecId]
- getAllocatedIds :: FilePath -> IO [HsecId]
- greatestId :: Foldable t => t HsecId -> HsecId
- getGreatestId :: FilePath -> IO HsecId
- forReserved :: (MonadIO m, Monoid r) => FilePath -> (FilePath -> HsecId -> m r) -> m r
- forAdvisory :: (MonadIO m, Monoid r) => FilePath -> (FilePath -> HsecId -> m r) -> m r
- listAdvisories :: MonadIO m => FilePath -> m (Validation [ParseAdvisoryError] [Advisory])
Documentation
isSecurityAdvisoriesRepo :: FilePath -> IO Bool Source #
Check whether the directory appears to be the root of a
security-advisories filesystem. Only checks that the
advisories subdirectory exists.
getReservedIds :: FilePath -> IO [HsecId] Source #
Get a list of reserved HSEC IDs. The order is unspecified.
getAdvisoryIds :: FilePath -> IO [HsecId] Source #
Get a list of used IDs (does not include reserved IDs) There may be duplicates and the order is unspecified.
getAllocatedIds :: FilePath -> IO [HsecId] Source #
Get all allocated IDs, including reserved IDs. There may be duplicates and the order is unspecified.
greatestId :: Foldable t => t HsecId -> HsecId Source #
Return the greatest ID in a collection of IDs. If the
collection is empty, return the placeholder.
getGreatestId :: FilePath -> IO HsecId Source #
Return the greatest ID in the database, including reserved IDs.
If there are IDs in the database, returns the placeholder.
forReserved :: (MonadIO m, Monoid r) => FilePath -> (FilePath -> HsecId -> m r) -> m r Source #
Invoke a callback for each HSEC ID in the reserved directory. The results are combined monoidally.
forAdvisory :: (MonadIO m, Monoid r) => FilePath -> (FilePath -> HsecId -> m r) -> m r Source #
Invoke a callback for each HSEC ID under each of the advisory
subdirectories, excluding the reserved directory. The results
are combined monoidally.
The same ID could appear multiple times. In particular, the callback is invoked for symbolic links as well as regular files.
listAdvisories :: MonadIO m => FilePath -> m (Validation [ParseAdvisoryError] [Advisory]) Source #
List deduplicated parsed Advisories