| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Cve.Sync.Step
Description
Advisory download, verification, and ownership transfer into the live slot.
Synopsis
- data CveFetch = CveFetch {}
- data FetchedObject = FetchedObject {
- foEtag :: DbEtag
- foPushedAt :: Maybe UTCTime
- newtype DbEtag = DbEtag Text
- data OsvDbFetchFault
- = OsvDbTooLarge Int
- | OsvDbNoEtag
- | OsvDbTransport TransportFault
- data SyncEnv = SyncEnv {
- syncFetch :: CveFetch
- syncEcosystem :: Ecosystem
- syncEpssRequirement :: EpssRequirement
- syncDbPath :: FilePath
- syncSlot :: CveSlot
- syncStoreRef :: Text
- data SyncOutcome
- = SyncSwapped DbEtag [(Text, Text)]
- | SyncUnchanged
- | SyncAbsent
- | SyncRejected DbEtag CveDbRejected
- | SyncFetchFaulted OsvDbFetchFault
- syncStep :: SyncEnv -> Maybe DbEtag -> IO SyncOutcome
- publishVerified :: SyncEnv -> IO () -> FilePath -> FetchedObject -> CveDb -> IO SyncOutcome
Documentation
The advisory transport supplied to one sync cycle.
Constructors
| CveFetch | |
Fields
| |
data FetchedObject Source #
Metadata from one HEAD or GET response. A download carries its own, so a publication racing HEAD cannot mislabel the bytes.
Constructors
| FetchedObject | |
Instances
| Show FetchedObject Source # | |
Defined in Ecluse.Runtime.Cve.Sync.Step Methods showsPrec :: Int -> FetchedObject -> ShowS # show :: FetchedObject -> String # showList :: [FetchedObject] -> ShowS # | |
| Eq FetchedObject Source # | |
Defined in Ecluse.Runtime.Cve.Sync.Step Methods (==) :: FetchedObject -> FetchedObject -> Bool # (/=) :: FetchedObject -> FetchedObject -> Bool # | |
data OsvDbFetchFault #
Constructors
| OsvDbTooLarge Int | |
| OsvDbNoEtag | |
| OsvDbTransport TransportFault |
Instances
| Show OsvDbFetchFault | |
Defined in Ecluse.Core.Cve.Types Methods showsPrec :: Int -> OsvDbFetchFault -> ShowS # show :: OsvDbFetchFault -> String # showList :: [OsvDbFetchFault] -> ShowS # | |
| Eq OsvDbFetchFault | |
Defined in Ecluse.Core.Cve.Types Methods (==) :: OsvDbFetchFault -> OsvDbFetchFault -> Bool # (/=) :: OsvDbFetchFault -> OsvDbFetchFault -> Bool # | |
Everything one ecosystem's sync task operates on.
Constructors
| SyncEnv | |
Fields
| |
data SyncOutcome Source #
The result of one sync cycle, for scheduling and observation.
Constructors
| SyncSwapped DbEtag [(Text, Text)] | Verification accepted a new artifact and it is now live (its ETag and provenance carried). |
| SyncUnchanged | No database replacement, though an accepted republication can advance publication time. |
| SyncAbsent | The object does not exist in the bucket (not yet published). |
| SyncRejected DbEtag CveDbRejected | The artifact downloaded, and verification refused it. The last-good generation serves on, and the sync remembers the ETag. |
| SyncFetchFaulted OsvDbFetchFault | The fetch itself failed (carried). The step learned nothing, so the last seen ETag stands and the schedule retries. |
Instances
| Show SyncOutcome Source # | |
Defined in Ecluse.Runtime.Cve.Sync.Step Methods showsPrec :: Int -> SyncOutcome -> ShowS # show :: SyncOutcome -> String # showList :: [SyncOutcome] -> ShowS # | |
syncStep :: SyncEnv -> Maybe DbEtag -> IO SyncOutcome Source #
One detect-download-verify-swap cycle against the last seen ETag. A failed fetch and a refused artifact are outcomes, not exceptions.
publishVerified :: SyncEnv -> IO () -> FilePath -> FetchedObject -> CveDb -> IO SyncOutcome Source #
Transfer under a mask, with a restored rename action. The slot owns the database from swap entry.