Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-http-client

Native Luce Base HTTP/1.1 client. MIT OR Apache-2.0. Cleartext requests use numeric IPv4 addresses. The https export uses native TLS 1.3. https.fetch retains an explicitly supplied P-256 issuer pin for private servers.

A library written in luce-base. Latest release 0.5.2.

Install#

luc add dymokomi/luce-http-client

Documentation#

luce-http-client

Native Luce Base HTTP/1.1 client. MIT OR Apache-2.0. Cleartext requests use numeric IPv4 addresses. The https export uses native TLS 1.3. https.fetch retains an explicitly supplied P-256 issuer pin for private servers. https.fetch_public validates the complete public certificate path under the built-in ISRG Root X2 P-384 trust anchor; callers with another explicit P-384 anchor can use https.fetch_p384_chain. This is a deliberately bounded public profile rather than a system CA store. There is no redirect handling or connection pool.

Cleartext request, get and post accept timeout_ms (default 30000) and an optional borrowed net.Cancellation*. One absolute deadline covers connection, request writes and response reads; partial progress does not restart it. Zero means an immediate deadline; overflowing durations are rejected. Operations use the pinned standard library's nonblocking connection/deadline stream. Keep any cancellation object alive until the call returns. Timeout/cancellation closes the connection and is an error, never partial success; discard the output buffer. These options do not yet apply to the separate HTTPS/TLS path.

Both clients use one bounded incremental response decoder over the standard library HTTP framing APIs. It handles fixed length, chunked (including validated trailers), EOF-delimited and up to eight interim responses. Malformed framing, truncation and output overflow fail instead of returning partial success. Heads are limited to 32 KiB; cleartext output capacity is capped at 64 MiB, HTTPS at the supplied output buffer size. Smaller caller buffers remain hard bounds; the client does not allocate a maximum-size buffer automatically. This is buffered, not streaming package installation. Discard output after any error. Completion stops at the framed response boundary; coalesced extra bytes are rejected, but a separate later response is not read. Upgrades and CONNECT tunnels are unsupported.

HTTPS request headers use the bounded standard encoder; bodies are sent in 16 KiB TLS records. Established connections close on success and failure. Underlying TLS trust, alerts, timeouts, secret lifecycle and independent-server interoperability still require further audit before production package downloads.

Tests cover every fixed/chunked fixture truncation, fragmentation sizes, malformed lengths/chunks/trailers, request injection, and independent Python socket framing. Cleartext tests also cover silent and continuously dripping peers, zero/overflow timeouts, pre-request/in-flight cancellation, and successful requests afterward. Large-transfer fixtures compare every byte of 17 MiB fixed/chunked/EOF responses, the exact 64 MiB bound, and upload/download of a real tracked compiler bootstrap source. Oversized output capacity and smaller-buffer overflow are rejected. The native HTTPS fixture uses ephemeral test credentials; it is not independent TLS interoperability evidence. No language sources are changed.

luc test

tests/framing and tests/secure are self-contained; tests/origin starts the Python origin (origin.py) and runs the drivers in tests/origin/drivers/ against it.

Dependencies#

PackageVersion
dymokomi/luce-cryptonewest
dymokomi/luce-stdnewest
dymokomi/luce-tlsnewest

Versions#

0.5.2

Browse source · pack · commit 41580562e9cf

SHA-256 4e6b05b68aff5f7688d0b3b89877034826b5b4eaa62f2a707d52c5d06f204069

luce-http-client 0.5.2: batch release

0.5.1

Browse source · pack · commit 7cc2fd773388

SHA-256 589d3c4929eca1389d922ac147852a26ad65b1a2b94a22adc7a6b53af0073952

dependencies name no version