| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Package.Filter.Internal
Description
The per-artifact location check behind Ecluse.Core.Package.Filter: a safe filename, the https normalisation, and an authority the document's upstream honours, in that order.
Importing this module opts out of the public surface's stability promises. It exists so a spec can hold the check to a per-artifact reference.
Synopsis
- data ArtifactOrigin = ArtifactOrigin {}
- artifactOrigin :: AllowedHostPorts -> Text -> ArtifactOrigin
- data ArtifactRefusal = ArtifactRefusal {
- refusedFile :: Text
- refusedReason :: Text
- refusedUrl :: Text
- resolveArtifact :: ArtifactOrigin -> Artifact -> Either ArtifactRefusal Artifact
Documentation
data ArtifactOrigin Source #
The inputs every artifact of one document is checked against, derived once from its upstream.
Constructors
| ArtifactOrigin | |
Fields
| |
artifactOrigin :: AllowedHostPorts -> Text -> ArtifactOrigin Source #
Derive a document's ArtifactOrigin from its ecosystem's artifact hosts and upstream base URL.
data ArtifactRefusal Source #
Why one artifact was refused, for the drop record that reports it.
Constructors
| ArtifactRefusal | |
Fields
| |
Instances
| Show ArtifactRefusal Source # | |
Defined in Ecluse.Core.Package.Filter.Internal Methods showsPrec :: Int -> ArtifactRefusal -> ShowS # show :: ArtifactRefusal -> String # showList :: [ArtifactRefusal] -> ShowS # | |
| Eq ArtifactRefusal Source # | |
Defined in Ecluse.Core.Package.Filter.Internal Methods (==) :: ArtifactRefusal -> ArtifactRefusal -> Bool # (/=) :: ArtifactRefusal -> ArtifactRefusal -> Bool # | |
resolveArtifact :: ArtifactOrigin -> Artifact -> Either ArtifactRefusal Artifact Source #
Check an artifact's filename, its https normalisation, then its authority. A non-https (loopback) upstream skips normalisation, but not the authority check, which the download gate also applies.