ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Cve.Sync.Step

Description

Advisory download, verification, and ownership transfer into the live slot.

Synopsis

Documentation

data CveFetch Source #

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 

Fields

newtype DbEtag #

Constructors

DbEtag Text 

Instances

Instances details
Show DbEtag 
Instance details

Defined in Ecluse.Core.Cve.Types

Eq DbEtag 
Instance details

Defined in Ecluse.Core.Cve.Types

Methods

(==) :: DbEtag -> DbEtag -> Bool #

(/=) :: DbEtag -> DbEtag -> Bool #

data OsvDbFetchFault #

Constructors

OsvDbTooLarge Int 
OsvDbNoEtag 
OsvDbTransport TransportFault 

Instances

Instances details
Show OsvDbFetchFault 
Instance details

Defined in Ecluse.Core.Cve.Types

Eq OsvDbFetchFault 
Instance details

Defined in Ecluse.Core.Cve.Types

data SyncEnv Source #

Everything one ecosystem's sync task operates on.

Constructors

SyncEnv 

Fields

  • syncFetch :: CveFetch

    The transport for this ecosystem's object key.

  • syncEcosystem :: Ecosystem

    The ecosystem the artifact must verify as.

  • syncEpssRequirement :: EpssRequirement

    Whether this ecosystem requires successful EPSS enrichment.

  • syncDbPath :: FilePath

    The canonical on-disk artifact path (the stable per-ecosystem name).

  • syncSlot :: CveSlot

    The slot this task's swaps publish to.

  • syncStoreRef :: Text

    How the configured store reads back, for the reports that name where an artifact belongs.

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

Instances details
Show SyncOutcome Source # 
Instance details

Defined in Ecluse.Runtime.Cve.Sync.Step

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.