Skip to main content

Module remote

Module remote 

Source
Expand description

Client for the hosted ctxpkg registry (GL #406) — publish, resolve, fetch.

Trust model: the registry is the authenticity gate, this client is the integrity gate. Every download is verified locally — artifact SHA-256 against the package index AND the embedded ed25519 manifest signature — so a compromised registry cannot hand us altered content undetected.

Structs§

PublishReceipt
Publish receipt as returned by the registry.
RemoteRef
A remote package reference: @ns/name or ns/name, optional @version pin after the name (acme/auth-context@1.2.0).
VersionInfo
One version entry from the package index.

Constants§

DEFAULT_REGISTRY
Default public registry, served via ctxpkg.com (nginx → control plane).

Functions§

download_verified
Download an artifact and verify its SHA-256 against the index entry.
fetch_versions
GET {base}/v1/packages/{ns}/{name}/index.json → all versions. token unlocks private packages; public ones need none.
parse_remote_ref
Parse a remote reference. Returns None for plain local names (no /).
preflight_bundle
Parse + verify a local bundle before any network call: must be a valid manifest with a verifying ed25519 signature, and the scoped name must match the publish target. Returns (namespace, name, version).
publish
PUT {base}/v1/packages/{ns}/{name}/{version} with the artifact bytes.
publish_token
Resolve the registry token: explicit flag > CTXPKG_TOKEN env. Used for publish (ctxp_…) and for installing private packages (ctxp_… or the read-only ctxr_…, GL #524).
registry_base
Resolve the registry base URL: explicit flag > CTXPKG_REGISTRY env > the public default. Trailing slashes are trimmed for clean joins.
select_version
Pick the version to install: an explicit pin (yanked allowed, warned by the caller) or the newest non-yanked version.