| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Pipeline.Packument
Description
Merge trusted private metadata with admitted public versions and serve conditional responses. Private access refusals stop the request even when the public origin succeeds. First-party names consult only the private origin.
Synopsis
- data PackumentReplies response = PackumentReplies {
- packumentOk :: ResponseHeaders -> LByteString -> response
- packumentNotModified :: ResponseHeaders -> response
- packumentUnauthorised :: ResponseHeaders -> Refusal -> response
- packumentForbidden :: ResponseHeaders -> Refusal -> response
- packumentNotFound :: ResponseHeaders -> Refusal -> response
- packumentInternal :: ResponseHeaders -> Refusal -> response
- packumentBadGateway :: ResponseHeaders -> Refusal -> response
- packumentUnavailable :: ResponseHeaders -> Refusal -> response
- packumentAction :: PackumentReplies response -> Method -> PackageName -> ResponseAction response
- servePackument :: PackumentReplies response -> PackageName -> Request -> (response -> IO ResponseReceived) -> Handler ResponseReceived
- headPackument :: PackumentReplies response -> PackageName -> Request -> (response -> IO ResponseReceived) -> Handler ResponseReceived
- firstPartyMissDecision :: PackageName -> OriginMiss -> ServeDecision
- firstPartyMissReply :: PackumentReplies response -> Maybe HelpMessage -> PackageName -> OriginMiss -> response
- packumentETag :: Text -> [Text] -> PackageName -> [(Provenance, ContentDigest, [(Text, [EntryKey])])] -> ETag
- assembleServedBody :: AdapterMetadata -> Text -> [Contribution] -> MergePlan -> CachedDoc
- outputBasisBytes :: MergePlan -> [Contribution] -> Int
Documentation
data PackumentReplies response Source #
The route-owned ways the ecosystem-neutral packument pipeline may answer.
Constructors
| PackumentReplies | |
Fields
| |
packumentAction :: PackumentReplies response -> Method -> PackageName -> ResponseAction response Source #
The action a read route names for a package unit. A HEAD takes the head-mode handler,
which runs the identical gating and merge but withholds the body.
servePackument :: PackumentReplies response -> PackageName -> Request -> (response -> IO ResponseReceived) -> Handler ResponseReceived Source #
Serve merged metadata while retaining private access authority and package identity checks.
headPackument :: PackumentReplies response -> PackageName -> Request -> (response -> IO ResponseReceived) -> Handler ResponseReceived Source #
Serve the packument's GET status and headers without its body.
The first-party private miss (exported for its unit spec)
firstPartyMissDecision :: PackageName -> OriginMiss -> ServeDecision Source #
Classify a first-party absence as a policy refusal and an unread origin as an outage.
firstPartyMissReply :: PackumentReplies response -> Maybe HelpMessage -> PackageName -> OriginMiss -> response Source #
Render a settled absence as 404 and an unread origin as 503 without Retry-After.
The derived validator (exported for its unit spec)
packumentETag :: Text -> [Text] -> PackageName -> [(Provenance, ContentDigest, [(Text, [EntryKey])])] -> ETag Source #
A validator derived from framed inputs so unchanged requests skip assembly. Bump the salt when assembly behaviour changes.
The served body and its output charge basis (exported for the residency probe and a unit spec)
assembleServedBody :: AdapterMetadata -> Text -> [Contribution] -> MergePlan -> CachedDoc Source #
The served document of a merge whose plan names the sources by their position.
outputBasisBytes :: MergePlan -> [Contribution] -> Int Source #
The source bytes a listing's output charge scales: the larger of two estimates, anchored on the largest source and on the base document, each adding the others' bytes pro rata for versions it lacks.