Expand description
bynk registry serve and bynk registry token (packaging slice 4c, #2287,
decisions A, D and E): a reference server that puts the publish API in
front of a static registry directory.
It serves the directory’s files by GET and the API under /api:
PUT /api/<org>/<package>/<version>with abynk-tree-v1archive body admits the upload by the same rules asbynk registry add, signs its line with the server’s key, and answers201with the line (200with the existing line when the same tree was already published, #2311);POST /api/<org>/<package>/<version>/yank(or/unyank) flipsyanked.
A request carries Authorization: Bearer <token>; the tokens file holds
only each token’s sha256, the organisations it may act for, and what it
can (publish, yank). Requests are handled one at a time, so writes to
a registry are serialised. It speaks plain HTTP and binds loopback by
default: put a TLS-terminating proxy in front to serve beyond this machine.
Constants§
- DEFAULT_
LISTEN - The default address: loopback only.
Functions§
- mint
bynk registry token: mint a token fororganisationsthatcanthe given actions, append its hash totokens_file, and return the token — shown once, never stored.- serve
bynk registry serve: servedirwith the publish API, signing withkey_fileand authorising withtokens_file, onlisten.readyis told the address actually bound, once listening. Runs until the process ends.