| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Pipeline.Packument
Description
Merge authorised private metadata with admitted public versions. First-party names use only private metadata, and a private read that fails refuses every name with the status its cause sets.
Synopsis
- data PackumentReplies response = PackumentReplies {
- packumentDeniedText :: [ServeDecision] -> Text
- packumentOk :: ResponseHeaders -> LByteString -> response
- packumentNotModified :: ResponseHeaders -> response
- packumentUnauthorised :: ResponseHeaders -> Refusal -> response
- packumentPrivateRefused :: Int -> ResponseHeaders -> Refusal -> response
- packumentForbidden :: ResponseHeaders -> Refusal -> response
- packumentDenied :: ResponseHeaders -> Refusal -> response
- packumentNotFound :: ResponseHeaders -> Refusal -> response
- packumentNotAcceptable :: ResponseHeaders -> Refusal -> response
- packumentInternal :: ResponseHeaders -> Refusal -> response
- packumentBadGateway :: ResponseHeaders -> Refusal -> response
- packumentUnavailable :: ResponseHeaders -> Refusal -> response
- data DocumentRejectionObserver response = DocumentRejectionObserver {
- observeVersionRejection :: EvalContext -> PackageDetails -> Rejection -> IO ()
- onCheckedNoSurvivorAdmission :: IO response
- coordinateVersions :: Set Text
- 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
- withObservedAdmittedDocument :: PackumentReplies response -> MemoryTicket -> (Int -> IO ()) -> (Int -> IO (Either response ())) -> Maybe (DocumentRejectionObserver response) -> PackageName -> Request -> Maybe response -> (CachedDoc -> Int -> Map Text Provenance -> Handler response) -> Handler response
- answerMetadataBytes :: PackumentReplies response -> PackumentDeps -> MemoryTicket -> Request -> ByteString -> Handler response
- answerDigestedMetadataBytes :: PackumentReplies response -> PackumentDeps -> MemoryTicket -> Request -> Digest SHA256 -> ByteString -> Handler response
- mapPackumentReplies :: (a -> b) -> PackumentReplies a -> PackumentReplies b
- firstPartyMissDecision :: PackageName -> OriginMiss -> ServeDecision
- firstPartyMissReply :: PackumentReplies response -> Maybe HelpMessage -> PackageName -> OriginMiss -> response
- noSurvivors :: PackumentReplies response -> Maybe HelpMessage -> PackumentStatus -> [ServeDecision] -> response
- notFoundReply :: MetricsPort -> PackumentReplies response -> Maybe HelpMessage -> Text -> IO response
Documentation
data PackumentReplies response Source #
The route-owned ways the ecosystem-neutral packument pipeline may answer.
Constructors
| PackumentReplies | |
Fields
| |
data DocumentRejectionObserver response Source #
Observe checked version and file rejections for native coordinate resolution.
Constructors
| DocumentRejectionObserver | |
Fields
| |
packumentAction :: PackumentReplies response -> Method -> PackageName -> ResponseAction response Source #
GET and HEAD use the same gate and merge. HEAD 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.
withObservedAdmittedDocument :: PackumentReplies response -> MemoryTicket -> (Int -> IO ()) -> (Int -> IO (Either response ())) -> Maybe (DocumentRejectionObserver response) -> PackageName -> Request -> Maybe response -> (CachedDoc -> Int -> Map Text Provenance -> Handler response) -> Handler response Source #
Observe source sizes and checked rejections, including admission with no surviving contribution.
A caller that supplies an absent answer receives it for a name both origins answered 404 for.
answerMetadataBytes :: PackumentReplies response -> PackumentDeps -> MemoryTicket -> Request -> ByteString -> Handler response Source #
Finalise bounded native bytes only after current authorisation, admission and validation.
answerDigestedMetadataBytes :: PackumentReplies response -> PackumentDeps -> MemoryTicket -> Request -> Digest SHA256 -> ByteString -> Handler response Source #
answerMetadataBytes with the caller's SHA-256 of the same bytes, so a caller that also sends it hashes once.
mapPackumentReplies :: (a -> b) -> PackumentReplies a -> PackumentReplies b Source #
Change only response construction while retaining shared admission and refusal decisions.
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 by its cause.
firstPartyMissReply :: PackumentReplies response -> Maybe HelpMessage -> PackageName -> OriginMiss -> response Source #
Render a settled absence as 404, an unavailable origin as 503 with its delay, and an invalid reply as 502.
The refusal when no version survives (exported for its unit spec)
noSurvivors :: PackumentReplies response -> Maybe HelpMessage -> PackumentStatus -> [ServeDecision] -> response Source #
Answer an empty listing, finishing the selected refusal text before writing the reply.
The 404 for a name no upstream lists a version of
notFoundReply :: MetricsPort -> PackumentReplies response -> Maybe HelpMessage -> Text -> IO response Source #
Answer 404 with this cause, recorded as the artifact path records a missing version.