feat(registry): organisations that publish elsewhere, and the signed owner file #347
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/19-elsewhere-owners"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #19
The registry part of "elsewhere" owners and the signed owner file, split as decided in the issue: verified domains are #341, the client reading and printing an owner's file is #342, the re-check of domains is #343.
What it does
Compiler (
compiler/src/package)OwnerRecord,ownerMessage,renderOwner,readOwner(index.trb) forindex/<owner>/owner.trb: oneownerline,kind,created,changed, andelsewhere:/domain:where set, the one index file that is replaced whole.torb index owner 1, names the owner and carries every field, the empty ones too. Droppingelsewhere:, adding adomain:the registry never signed, or moving a file to another owner fails to verify.ownerSignature/verifiedOwner(signing.trb).changedgrows with every change (by a second where two fall in one). A file replaced whole has no record position, so this is what lets a client (#342) refuse an older signed file a mirror hands back.domainis in the type, the writer, the reader and the signed text from the start, so #341 changes no format.manifest.trb: a labeled integer argument (created: 1760000000) now lands inSetting.labeled; before, it was dropped.Registry (
tools/registry)PUT /api/1/owners/<owner>/elsewhere {url}andDELETE: organisations only (person400),ownerrole or operator,ownersaction andTorb-Codelike every owners call.https://plus a host name. Refused: an IP literal,localhost, a single-label name, the registry's own host, userinfo, a query, a fragment, and anything over 200 bytes. It is stored in one form (host lower case, a name beyond ASCII in itsxn--form, no port 443, no trailing/) and never fetched.200without using a code. An owner with a package here is a409, checked before the code is taken.409naming the URL and theregistry "<owner>", url: "..."binding: a publish (mayWritePackage), a new package (ensurePackage), trusted-publisher setup and the OIDC exchange.SELECT changes():UPDATE owners ... WHERE NOT EXISTS (packages)againstINSERT INTO packages ... WHERE NOT EXISTS (owner elsewhere).fillOwnerFilesrewrites each file that is missing or not byte-identical to what its row makes. That repairs a failed write and a stale or replayed file.owners.changed, migrated ascreatedfor existing owners.owneris reserved:index/<owner>/owner.trbwould be its index file. A pre-existing<x>/ownerpackage is printed at start and its owner file is not written over it.tools/registry/README.md(API rows, decision bullet, "not built yet") anddocs/design/RELEASE.md(7.1 as-built, the 7.14 row, 7.11).Tests
compiler/tests/packages.test.trb, group "The owner file":tools/registry/tests/elsewhere.test.trb(new, end to end over loopback):401/403/400/404;xn--form, the canonical form, the same-URL no-op, the operator;409with packages;ownerreserved;torb test, the registry tests with a stand-in SQLite shell):packages.test.trb"The owner file" 3/3,elsewhere.test.trb12/12,account.test.trb22/22 (migration from an old schema). Everything else is left to CI.Notes for review
changedwas added against replay;<x>/ownerpackage is printed.proved), and a package created between that check and the lockedUPDATEstill costs the code; the comment says so.ownerreservation is registry-side only; afile:registry does not enforce it.a83071990baa9488d58bChecklist (head
aa9488d):packages.test.trb, end-to-endelsewhere.test.trb(auth, bad URLs, canonical form, 409 with packages, publish/trusted-publisher/exchange refused, undo, start-up repair of missing and replayed files). CI green on this head (tier A/B, registry, gates, pdisc).changedonly grows; set/unset and package creation race-closed by single statements pluschanges(); URL canonicalised, never fetched, own host and IP/localhost/single-label refused; migration ofowners.changedbackfilled fromcreated;ownerpackage name reserved with a start-up notice for pre-existing clashes.sqlText, no secrets,ownersaction + code like the other owners calls.Non-blocking:
ownerreservation is registry-side only, as noted in the PR.