ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry

Description

Registry payloads and typed failures shared by the protocol capabilities. Read responses retain the HTTP status so metadata projection cannot erase access refusals.

Synopsis

Fetch payload

data RegistryResponse Source #

Upstream status and bytes retained before protocol decoding.

Constructors

RegistryResponse 

Fields

data BodyOutcome a Source #

The answer to a read that consumes only a 2xx body.

Constructors

SuccessBody Int a

The 2xx status and the consumer's result.

UnreadStatus Int

A status outside 2xx. The consumer never ran, so no result exists.

Instances

Instances details
Functor BodyOutcome Source # 
Instance details

Defined in Ecluse.Core.Registry

Methods

fmap :: (a -> b) -> BodyOutcome a -> BodyOutcome b #

(<$) :: a -> BodyOutcome b -> BodyOutcome a #

Show a => Show (BodyOutcome a) Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq a => Eq (BodyOutcome a) Source # 
Instance details

Defined in Ecluse.Core.Registry

isAuthorisationFailure :: Int -> Bool Source #

Whether an upstream status explicitly refuses authentication or authorisation.

isSuccessStatus :: Int -> Bool Source #

Whether an upstream status reports success. Every leg reads this one test, so none can drift.

Publish descriptor

data MirrorArtifact Source #

The artifact descriptor the mirror publish uses.

Constructors

MirrorArtifact 

Fields

  • maFilename :: Filename

    The artifact's on-the-wire filename, the _attachments key in the publish document.

  • maHashes :: NonEmpty Hash

    The integrity digests, at least one. The tamper gate verified the fetched bytes against this floor-checked set.

  • maSize :: Maybe Int

    Registry-declared size, which may describe the unpacked tree rather than transferred bytes.

Instances

Instances details
Show MirrorArtifact Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq MirrorArtifact Source # 
Instance details

Defined in Ecluse.Core.Registry

firstHashValue :: HashAlg -> MirrorArtifact -> Maybe Text Source #

The digest value of the first Hash with the given HashAlg, or Nothing when the artifact carries none.

Errors

newtype ParseError Source #

A protocol decode failure for the caller to classify.

Constructors

ParseError 

Fields

Instances

Instances details
Show ParseError Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq ParseError Source # 
Instance details

Defined in Ecluse.Core.Registry

data FetchFault Source #

A request-formation, response-bound, or transport failure before a usable response.

Constructors

FetchUrlUnformable UrlFormationError

The request URL could not be formed from the base URL and the package identity.

FetchBoundExceeded LimitError

The peer's body crossed the response-size bound, and the read refused it fail-closed.

FetchTransport TransportFault

The adapter classified a failed or interrupted exchange.

Instances

Instances details
Show FetchFault Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq FetchFault Source # 
Instance details

Defined in Ecluse.Core.Registry

newtype PublishError Source #

Why publishing an artifact to a registry failed, the fault mpPublishArtifact reports.

Constructors

PublishError 

Fields

Instances

Instances details
Show PublishError Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq PublishError Source # 
Instance details

Defined in Ecluse.Core.Registry

data PublishFault Source #

Separate exchange faults from registry rejections so workers can choose retry or drop.

Constructors

PublishFetch FetchFault

An exchange failure whose retry disposition follows the shared fetch-fault model.

PublishRejected PublishError

The registry answered and rejected the write (a non-2xx, non-409 status). Retryable.

PublishSourceUnavailable Text

The writer had no usable source version object, so it formed no request. Not retryable.

Instances

Instances details
Show PublishFault Source # 
Instance details

Defined in Ecluse.Core.Registry

Eq PublishFault Source # 
Instance details

Defined in Ecluse.Core.Registry

data UrlFormationError Source #

Why an upstream request URL could not be formed from configuration and a parsed PackageName.

Constructors

EmptyBaseUrl

The configured base URL is empty, so no request URL can be formed.

UnparseableUrl Text

The formed URL string could not be parsed into a request. Carries the offending URL.

renderUrlFormationError :: UrlFormationError -> Text Source #

Render a URL formation failure with its URL reduced to an authority, excluding userinfo and queries.

data PublishRelayResponse Source #

The response from the publication target after relaying a publish document.

Constructors

PublishRelayResponse 

Fields