feat(package): torb login, logout, owner and yank #283
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/22-torb-login-owner-yank"
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 #22
Two commits:
feat(package): torb login and logout with stored registry tokens-torb loginreads a token from standard input only, checks it withGET /api/1/tokensand stores it incredentials.trb(mode 0600, strict, one line per registry,TORB_CREDENTIALSnames another file);torb logoutremoves the line. A request sendsTORB_TOKEN, else the stored token (https or loopback http only, never a mirror), else trusted publishing.torb publishuses it.feat(package): torb owner and torb yank over the registry API-torb owner list|add|remove(--role publisherdefault,--code/TORB_CODEasTorb-Code),torb yank <package> <version> --reason ...and--undo; on afile:registry yank appends the line itself and is refused for a signed index;loginandownerrefusefile:. Registry:--registry, else the owner's binding, else the public registry. Usage errors exit 2, refusals 1.Tests: pure tests in
compiler/tests/registry-commands.test.trb; the network round intools/registry/tests/commands.test.trb(operator account, login, owner add, publish, yank, yank --undo, owner remove, logout) with acurlwrapper that records its arguments and asserts the token is in none of them and in no output.Also: every request now reads its headers from a file for
wgettoo (--configstartup file), and the header files are written 0600, so the token is never a process argument.Docs: new pages torb-login, torb-logout, torb-owner, torb-yank; torb-publish points at login; index and the-torb-command list the commands; RELEASE.md 7.11/7.13, ROADMAP and the registry README updated; skills/ regenerated.
5f61772a226f9d340b68login,logout,ownerandyankcommands #22Approved at
6f9d340b(CI green on this head). Checklist: tests ok (pure tests plus a network round asserting the token is in no curl argument, output or leftover header file); workflows unchanged; correctness ok (https/loopback-only rule rejects userinfo and lookalike hosts, 0600 file created before the secret is written, a refused token stores nothing); scope matches #22; security ok (token via stdin only, headers via 0600 files for curl and wget); docs ok, pdisc green. Non-blocking: wget follows redirects and re-sends custom headers, so consider --max-redirect=0 for authenticated requests in a follow-up (already true for publish).login,logout,ownerandyankcommands #22