Skip to main content

Module registry

Module registry 

Source
Expand description

Bot registries for apps: a signed catalog, a history file and a .zbot package, checked as the registry’s own browser verifier (zaun-registry-wasm) checks them.

An app pins one key per registry it trusts. verify_catalog picks the pinned key whose id the catalog names (a hint only; the signature decides) and gives the registry’s report, plus the verified catalog itself so the app reads package URLs, digests and permissions from what was verified. Failures are reports, never panics or errors.

Structs§

CatalogCheck
verify_catalog’s answer: the registry’s report and, when ok, the verified catalog.
CatalogReport
The result of verifyCatalog. When ok is false, only errors is meaningful. When ok is true but installable is false, the catalog has expired: show it with a warning, apply its advisories, yanks and revoked keys, and never install or update from it (errors then holds E-CATALOG-EXPIRED).
ErrorReport
One finding: {code, message, hint, severity}.
HistoryCheck
verify_history’s answer: the registry’s report and, when ok, the verified history.
HistoryReport
The result of verifyHistory. When ok is false, only errors is meaningful.
Identity
What a package’s header says about itself. Shown as fact only once the signature verifies; otherwise it is only what the file claims.
Inspection
The result of inspectPackage. Fields the file does not yield are null.
KeyIdReport
key_id’s answer.
SeenInput
What a caller stored for a registry after an earlier success: {serial, sha3}.

Functions§

inspect_package
What a .zbot file says, whether its signature verifies and whether it passes the registry’s package checks.
key_id
The id of a base64url public key: what a bot card’s source.registry_id is compared with.
verify_catalog
Verifies catalog.json bytes and the text of catalog.json.sig against the key of pinned (base64url public keys) that the catalog names, at Unix time now (seconds), after seen (the seen an earlier success returned for that registry, as JSON).
verify_history
Verifies the catalog as verify_catalog does (no stored serial), then history/<app_id>.json against the hash the verified catalog lists for it.