Expand description
kute fetch: take a vocabulary from a kute serve --registry by its
digest, and keep it only if it is that vocabulary.
The registry is not trusted and neither is the network between. What
is asked for is named by the hash of its content, the hash is
recomputed here from what arrives, and with --trusted-key a
signature is checked as kute verify checks one. So a registry, or
anyone on the path, can refuse, stall or send something else, and
something else is not kept. It can also see what was asked for and
what was sent: the connection is plain HTTP.
The client is written on std::net like the service, with every
bound in this file: one request, a deadline for the whole exchange, a
cap on the header block and on the body.
Enums§
- Taken
- What asking one registry for one digest came to.
Constants§
- LIST_
PATH - The registry routes, under the service’s
/v1/. - VIA_
HEADER - One GET. Returns the status and the body, which is at most
max_bytes. Sent by a registry asking another on a caller’s behalf. A registry that sees it answers from what it holds and asks nobody further, so a question travels one registry beyond the one it was put to and registries that name each other cannot pass it round.
Functions§
- fetch
- Fetch the vocabulary with this digest from the first of the registries that gives it and passes every check, and write it. The registries are asked in the order given; one that fails, lies or does not have it costs its share of the time and nothing else.
- is_
digest - A digest as the registry names files:
sha256:and 64 lowercase hex digits. Nothing else reaches a path. - list
- What each registry says it holds. Nothing in it is checked: it is the other side’s account, and a file is checked when it is fetched.
- parse_
url - Host and port, and the path the registry’s routes are under.
- take
- Ask one registry for the vocabulary with this digest and check what arrives: it parses, it is valid, its content has that digest, and its own test vectors pass. Signatures are not looked at here.