feat(package): torb login, logout, owner and yank #283

Merged
argus merged 2 commits from loop/22-torb-login-owner-yank into main 2026-10-09 21:24:52 +00:00
Collaborator

Closes #22

Two commits:

  • feat(package): torb login and logout with stored registry tokens - torb login reads a token from standard input only, checks it with GET /api/1/tokens and stores it in credentials.trb (mode 0600, strict, one line per registry, TORB_CREDENTIALS names another file); torb logout removes the line. A request sends TORB_TOKEN, else the stored token (https or loopback http only, never a mirror), else trusted publishing. torb publish uses it.
  • feat(package): torb owner and torb yank over the registry API - torb owner list|add|remove (--role publisher default, --code/TORB_CODE as Torb-Code), torb yank <package> <version> --reason ... and --undo; on a file: registry yank appends the line itself and is refused for a signed index; login and owner refuse file:. 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 in tools/registry/tests/commands.test.trb (operator account, login, owner add, publish, yank, yank --undo, owner remove, logout) with a curl wrapper 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 wget too (--config startup 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.

Closes #22 Two commits: - `feat(package): torb login and logout with stored registry tokens` - `torb login` reads a token from standard input only, checks it with `GET /api/1/tokens` and stores it in `credentials.trb` (mode 0600, strict, one line per registry, `TORB_CREDENTIALS` names another file); `torb logout` removes the line. A request sends `TORB_TOKEN`, else the stored token (https or loopback http only, never a mirror), else trusted publishing. `torb publish` uses it. - `feat(package): torb owner and torb yank over the registry API` - `torb owner list|add|remove` (`--role publisher` default, `--code`/`TORB_CODE` as `Torb-Code`), `torb yank <package> <version> --reason ...` and `--undo`; on a `file:` registry yank appends the line itself and is refused for a signed index; `login` and `owner` refuse `file:`. 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 in `tools/registry/tests/commands.test.trb` (operator account, login, owner add, publish, yank, yank --undo, owner remove, logout) with a `curl` wrapper 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 `wget` too (`--config` startup 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.
`torb login [--registry <url>]` reads a token from standard input, checks it
with `GET /api/1/tokens` and stores it in the user's credentials.trb (torb
home, or $TORB_CREDENTIALS): a receiver script of `token` lines read
statically and strictly, created with mode 0600 before the token is
written. `torb logout` removes the registry's line.

`torb publish` now sends TORB_TOKEN, else the stored token of its registry
(https or loopback http only, never a mirror), else trusted publishing.

Refs #22
feat(package): torb owner and torb yank over the registry API
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
pdisc / pdisc (pull_request) Failing after 10s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the VS Code extension (editors/vscode) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Has been cancelled
5f61772a22
`torb owner list|add|remove <owner> [account]` reads an owner's members
without a token and adds, changes or removes one with the stored token
(`--role publisher` by default, `--code` or TORB_CODE as `Torb-Code`).
`torb yank <package> <version> --reason <text>` withdraws a version and
`--undo` takes it back; on a `file:` registry the yank or unyank line is
appended to the index itself, refused where the index is signed. The
registry is `--registry`, else the owner's `registry` binding, else the
public one; usage errors exit with 2, refusals with 1.

The network round in tools/registry/tests/commands.test.trb drives login,
owner add, publish, yank, yank --undo, owner remove and logout against
the write service and checks that the token is in no curl argument and
in nothing torb prints. New pages torb-owner and torb-yank; the design
records no longer list the commands as not built.

Closes #22
orion force-pushed loop/22-torb-login-owner-yank from 5f61772a22
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
pdisc / pdisc (pull_request) Failing after 10s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the VS Code extension (editors/vscode) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Has been cancelled
to 6f9d340b68
All checks were successful
ci / tier B (linux-x64) (pull_request) Successful in 9m11s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 4m24s
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 1m48s
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Successful in 5s
ci / what the change touches (push) Successful in 5s
pdisc / pdisc (push) Successful in 9s
ci / which runners exist (push) Successful in 0s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / the VS Code extension (editors/vscode) (push) Successful in 14s
ci / bootstrap (linux-x64) (push) Successful in 3m27s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 9m20s
ci / tier A (linux-x64) (push) Successful in 3m52s
ci / tools/release-sync and tools/registry (linux-x64) (push) Successful in 1m24s
ci / every host emits the same C (push) Successful in 4m33s
ci / tier B (linux-x64) (push) Successful in 10m2s
ci / pack the seed (push) Has been skipped
ci / archives (push) Has been skipped
ci / the playground (torb as WebAssembly) (push) Successful in 1m50s
ci / gates (push) Successful in 0s
2026-10-09 21:08:36 +00:00
Compare
argus approved these changes 2026-10-09 21:24:48 +00:00
argus left a comment

Approved 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).

Approved 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).
argus merged commit 6f9d340b68 into main 2026-10-09 21:24:52 +00:00
argus deleted branch loop/22-torb-login-owner-yank 2026-10-09 21:24:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!283
No description provided.