Skip to main content

Module protocol

Module protocol 

Source
Expand description

The registry protocol’s data (packaging slice 4a, #2274, decision D; track design/tracks/packaging.md §6.1): a registry’s config.json, its index lines, and the canonical payloads their signatures cover.

I/O- and crypto-free (first-party registry R2, #2336, decision B), so the client, the reference server and the hosted registry’s wasm module build the very same bytes. Signature checks take a verify function: bynk passes one over ring, and the hosted registry verifies with bynk.crypto. A key is written ed25519:<base64 of the 32-byte public key>, and its fingerprint ed25519-fp:<base64 of sha256(public key)>.

Structs§

Config
A registry’s config.json.
IndexLine
One version line of a package’s index file.
KeyEntry
One link of the key-rotation chain: a key, and (after the first) the previous key’s signature over { "key": …, "registry": id }.
Requirement
A dependency or npm requirement in an index line. A dependency or npm requirement in an index line.
Signers
#2316: who may sign a registry’s index lines.

Constants§

PROTOCOL
The protocol version a registry without delegation speaks.
PROTOCOL_DELEGATION
#2316 (D): the protocol version a config.json with delegations or revoked must declare; this toolchain reads both.
WITHDRAWN_MAX
#2330 (A): the longest withdrawn reason, in characters.

Functions§

canonical
value as canonical JSON: object keys in byte-wise order (serde_json’s map is ordered unless preserve_order is on, so keys are re-sorted here regardless), no insignificant whitespace.
delegation_payload
#2316: the payload a delegation’s signature covers.
fingerprint
ed25519-fp:<base64 of sha256(public key)>.
key_bytes
The raw public key of ed25519:<base64>.
revocation_payload
#2316: the payload a revocation’s signature covers.
rotation_payload
The payload a rotation link’s signature covers.

Type Aliases§

Verify
Whether sig (base64) is key’s signature over payload: the check the signer walks below are given.