ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Cargo.Publish.Body

Description

Native Cargo upload framing rejects ambiguous JSON and retains the exact archive bytes.

Synopsis

Documentation

data CargoUploadBody Source #

The decoded claims and archive remain paired with one fully consumed native body.

decodeUpload :: Limits -> ByteString -> Either ParseError CargoUploadBody Source #

Decode strict native framing and JSON under the configured request and metadata bounds.

readUpload :: Limits -> (Int -> IO ()) -> ByteString -> IO (Either ParseError (CargoUploadBody, Int)) Source #

Charge the JSON tree before decoding and return that reservation for archive work. The caller separately reserves the original body.

uploadName :: CargoUploadBody -> Text Source #

Preserve the declared published spelling for archive agreement.

uploadVersion :: CargoUploadBody -> Text Source #

Preserve the declared raw native version, including build metadata.

uploadArchive :: CargoUploadBody -> ByteString Source #

These bytes are a slice of the validated original body.

uploadMetadata :: CargoUploadBody -> Value Source #

Resolver claims retain the reservation acquired before JSON decoding.

encodeUpload :: Value -> ByteString -> Either ParseError LByteString Source #

Encode native uint32 framing without changing either the JSON value or verified archive bytes.