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§
- Publish
Receipt - Publish receipt as returned by the registry.
- Remote
Ref - A remote package reference:
@ns/nameorns/name, optional@versionpin after the name (acme/auth-context@1.2.0). - Version
Info - 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.tokenunlocks private packages; public ones need none.- parse_
remote_ ref - Parse a remote reference. Returns
Nonefor 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_TOKENenv. Used for publish (ctxp_…) and for installing private packages (ctxp_…or the read-onlyctxr_…, GL #524). - registry_
base - Resolve the registry base URL: explicit flag >
CTXPKG_REGISTRYenv > 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.