| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Osv.Provenance
Description
Advisory source provenance and age diagnostics stored in the artifact metadata.
Synopsis
- data AdvisoryProvenance = AdvisoryProvenance {}
- noProvenance :: AdvisoryProvenance
- provenanceRows :: AdvisoryProvenance -> [(Text, Text)]
- decodeProvenance :: [(Text, Text)] -> AdvisoryProvenance
- data SourcePathRecording
- data RecordedSource = RecordedSource {
- rsOrigin :: Text
- rsPath :: RecordedPath
- data RecordedPath
- recordSource :: SourcePathRecording -> Text -> RecordedSource
- renderRecordedSource :: RecordedSource -> Text
- parseSourceTime :: Text -> Maybe UTCTime
- parseHttpDate :: Text -> Maybe UTCTime
- lastModifiedOf :: [ByteString] -> Maybe UTCTime
- data QuietTime = QuietTime {}
- defaultQuietTime :: NominalDiffTime
- data ProvenanceSource
- data SourceAge = SourceAge {}
- sourceAges :: UTCTime -> QuietTime -> AdvisoryProvenance -> [SourceAge]
- sourceQuiet :: SourceAge -> Bool
- renderSourceAge :: SourceAge -> Text
The recorded sources
data AdvisoryProvenance Source #
Source declarations. Missing values and keys from older artifacts remain Nothing.
Constructors
| AdvisoryProvenance | |
Fields
| |
Instances
| Show AdvisoryProvenance Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods showsPrec :: Int -> AdvisoryProvenance -> ShowS # show :: AdvisoryProvenance -> String # showList :: [AdvisoryProvenance] -> ShowS # | |
| Eq AdvisoryProvenance Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods (==) :: AdvisoryProvenance -> AdvisoryProvenance -> Bool # (/=) :: AdvisoryProvenance -> AdvisoryProvenance -> Bool # | |
noProvenance :: AdvisoryProvenance Source #
Nothing recorded, which is what an artifact compiled before these keys decodes to.
provenanceRows :: AdvisoryProvenance -> [(Text, Text)] Source #
The meta rows one provenance writes. A value the source did not supply writes no row.
decodeProvenance :: [(Text, Text)] -> AdvisoryProvenance Source #
Decode artifact metadata, treating absent, overlong, and unreadable values as missing.
How a source is recorded
data SourcePathRecording Source #
Whether an artifact records each source's path. Every consumer and every reader of the bucket can read the artifact.
Constructors
| FingerprintSourcePath | Record only the path's SHA-256, so a credential written into the path stays out of the artifact. |
| RecordSourcePath | Record the URL as |
Instances
| Show SourcePathRecording Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods showsPrec :: Int -> SourcePathRecording -> ShowS # show :: SourcePathRecording -> String # showList :: [SourcePathRecording] -> ShowS # | |
| Eq SourcePathRecording Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods (==) :: SourcePathRecording -> SourcePathRecording -> Bool # (/=) :: SourcePathRecording -> SourcePathRecording -> Bool # | |
data RecordedSource Source #
A source as an artifact records it. Userinfo, the query and the fragment are never part of it.
Constructors
| RecordedSource | |
Fields
| |
Instances
| Show RecordedSource Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods showsPrec :: Int -> RecordedSource -> ShowS # show :: RecordedSource -> String # showList :: [RecordedSource] -> ShowS # | |
| Eq RecordedSource Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods (==) :: RecordedSource -> RecordedSource -> Bool # (/=) :: RecordedSource -> RecordedSource -> Bool # | |
data RecordedPath Source #
A source's path, or the fingerprint that stands in for it.
Constructors
| PathAsFetched Text | The path as fetched. |
| PathSha256 Text | The SHA-256 of the path's UTF-8 bytes, in lowercase hex. |
Instances
| Show RecordedPath Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods showsPrec :: Int -> RecordedPath -> ShowS # show :: RecordedPath -> String # showList :: [RecordedPath] -> ShowS # | |
| Eq RecordedPath Source # | |
Defined in Ecluse.Core.Osv.Provenance | |
recordSource :: SourcePathRecording -> Text -> RecordedSource Source #
Record a fetched URL. A changed path changes the record under either choice.
renderRecordedSource :: RecordedSource -> Text Source #
The stored form. A fingerprint follows a slash, so dialledAuthorityLabel still reads the authority.
Source timestamps
parseSourceTime :: Text -> Maybe UTCTime Source #
Read RFC 3339, the EPSS offset form, or a bare date at UTC midnight. Invalid values remain absent.
parseHttpDate :: Text -> Maybe UTCTime Source #
Read the provenance date format, retaining its timezone and whitespace acceptance.
lastModifiedOf :: [ByteString] -> Maybe UTCTime Source #
The instant a response's Last-Modified names. An absent or unreadable header records nothing.
The quiet-time reading
Per-source age thresholds for the Pilot alarm.
Constructors
| QuietTime | |
Fields
| |
defaultQuietTime :: NominalDiffTime Source #
Seven days, the threshold a source with no configured value of its own is judged by.
data ProvenanceSource Source #
Which upstream an age was read from.
Constructors
| OsvExport | The ecosystem's advisory export, aged by its newest record |
| EpssFeed | The EPSS feed, aged by its declared |
Instances
| Show ProvenanceSource Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods showsPrec :: Int -> ProvenanceSource -> ShowS # show :: ProvenanceSource -> String # showList :: [ProvenanceSource] -> ShowS # | |
| Eq ProvenanceSource Source # | |
Defined in Ecluse.Core.Osv.Provenance Methods (==) :: ProvenanceSource -> ProvenanceSource -> Bool # (/=) :: ProvenanceSource -> ProvenanceSource -> Bool # | |
One source's age at an instant, with the threshold that decides whether it is quiet.
Constructors
| SourceAge | |
Fields
| |
sourceAges :: UTCTime -> QuietTime -> AdvisoryProvenance -> [SourceAge] Source #
Report ages only for sources with recorded timestamps.
sourceQuiet :: SourceAge -> Bool Source #
Whether this source has gone longer than its threshold without changing.
renderSourceAge :: SourceAge -> Text Source #
The age as an operator reads it, in the seconds its threshold is configured in.