| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Worker.Integrity
Description
Verify artifact bytes before publication into the trusted mirror. The gate uses current metadata from admission, never digests from the queue. SRI components at the strongest algorithm are alternatives. A weaker digest cannot rescue a mismatch, because that would permit substitution through a broken hash.
Synopsis
Documentation
data IntegrityResult Source #
Whether fetched bytes may enter the mirror, with a refusal detail for the operator.
Constructors
| IntegrityVerified | The bytes matched the selected digest or one of its SRI alternatives. |
| IntegrityMismatch Text | The selected digest mismatched or its algorithm cannot be computed. |
Instances
| Show IntegrityResult Source # | |
Defined in Ecluse.Core.Worker.Integrity Methods showsPrec :: Int -> IntegrityResult -> ShowS # show :: IntegrityResult -> String # showList :: [IntegrityResult] -> ShowS # | |
| Eq IntegrityResult Source # | |
Defined in Ecluse.Core.Worker.Integrity Methods (==) :: IntegrityResult -> IntegrityResult -> Bool # (/=) :: IntegrityResult -> IntegrityResult -> Bool # | |
verifyIntegrity :: NonEmpty Hash -> ByteString -> IntegrityResult Source #
Verify the strongest selected digest, allowing only its same-algorithm SRI alternatives. A weaker match or an uncomputable selected algorithm never permits publication.