The client lab
The client guide tells people what to put into .npmrc,
settings.xml, daemon.json and thirty other files. The client lab is where
those configurations are run: every one of them is a script that the real
client executes against the real proxy.
The ecosystem tests already do that in CI for one client per ecosystem — on loopback, over plain HTTP, without access control. The lab covers what a deployment adds on top of that, and what the guide documents for it:
| Ecosystem tests | Client lab | |
|---|---|---|
| Runs | on every push | nightly, on demand, and when the lab or the guide changes |
| Clients | one per ecosystem (32) | every client the guide documents: also Yarn, pnpm, Bun, uv, Poetry, PDM, Gradle, containerd, skopeo, OpenTofu, micromamba, gem, puppet module, … |
| Proxy address | http://127.0.0.1:<port> |
https://proxy.example.com, with a certificate from a private CA |
| Access control | off | off, on (a token is required), and on with an anonymous role |
| Asserts | install, cache hit, refusal of a blocked package | the configuration works — CA, token and all; lock files say what the guide says they do; a limitation the guide states is still there |
| A client that asks another host | cannot reach it (no network) | cannot reach it, and is caught asking |
How it works
┌────────────── lab network (internal: no way out) ──────────────┐
│ │
│ client container proxy.example.com │
│ the real client, its own image ──► the real pullthrough ───┼──► registries
│ /etc/ssl/corp-ca.pem (the CA) HTTPS, private CA │
│ /etc/resolv.conf ──► dnslog │
│ answers proxy.example.com, │
│ logs every other name: NXDOMAIN │
└────────────────────────────────────────────────────────────────┘
-
The proxy is the binary built from the checkout, with
proxy.yaml: every upstream type —swiftin front of Tuist’s public registry,genericin front of Alpine’s package mirror (no lab script runs SwiftPM or apk yet; the ecosystem tests do) — under the names the guide uses, served ashttps://proxy.example.comwith a certificate from a CA the lab creates. There are three of them, one per mode, each on a network of its own:Mode Access control openoff authon: every request needs the token ( proxy-auth.yaml)anonon, and anonymous reads admitted for the Conan upstream alone ( proxy-anon.yaml) - A client runs in its ecosystem’s own container image on that network. It
gets the CA certificate at
/etc/ssl/corp-ca.pem— the path the guide uses — the mode in$LAB_MODEand, inauthandanon, the token in$PROXY_TOKEN. Nothing else: the script has to configure the client the way the guide says. - The name server
(
dnslog) is the client’s only resolver. It answers the proxy’s name, answers “no such domain” for every other one, and logs each question. After a run, the names a client looked up besides the proxy’s are the hosts it would have gone to. A run fails when a client asks for a host its script does not declare.
That last point is what the lab adds to “the client has no other network”. A package manager that tries the public registry first and shrugs when it does not answer installs just fine on a network without a way out — and talks to the registry directly on one that has it. The lab found one such configuration in the first hour (Composer, below), in a test that had been green in CI all along.
Run it
Requirements: Docker, Go, openssl, and network access to the public
registries. Every client runs in its own image; nothing else is installed.
make client-lab # start the lab, run every script (a while)
make client-lab CLIENTS="npm yarn pnpm" # a selection
make client-lab-report # write the result table below into this page
make client-lab-down
scripts/client-lab/lab.sh run npm auth # one script in one mode
scripts/client-lab/lab.sh logs npm auth # its output, the requests it made, the names it looked up
scripts/client-lab/lab.sh list # every script, with its image and modes
scripts/client-lab/lab.sh check # which scripts are missing a passing result
The lab’s CA and certificate last 30 days — a lab directory is scratch space —
and lab.sh up makes new ones when they are about to run out.
| Variable | Default | Meaning |
|---|---|---|
CLIENT_LAB_DIR |
$TMPDIR/pullthrough-client-lab |
Where the lab keeps its state: the CA, the proxies’ caches, logs, results. |
CLIENT_LAB_PROXY_BIN |
built from the checkout | A prebuilt, statically linked pullthrough for linux to test. |
CLIENT_LAB_PROXY_IMAGE |
alpine/git |
The image the proxy runs in: anything with git, CA certificates and wget. |
LAB_KEEP_IMAGES |
1 |
0 removes an image the lab pulled once its last script has run (small disks). |
LAB_KEEP_WORK |
0 |
1 keeps a run’s scratch directory for inspection. |
Results
Last run: 2026-11-12, linux/x86_64.
| Client | Version | No access control | Token required | Token required, anonymous role | Other hosts looked up | Script |
|---|---|---|---|---|---|---|
| ansible-galaxy | 2.21.6 | ✔ | ✔ | — | — | ansible.sh |
| APT | 2.6.1 | ✔ | ✔ | — | — | apt.sh |
| Bazel | 7.4.1 | ✔ | ✔ | — | — | bazel.sh |
| Homebrew | 4.6.20 | ✔ | ✔ | — | — | brew.sh |
| Bundler | 2.5.22 | ✔ | ✔ | — | — | bundler.sh |
| Bun | 1.1.45 | ✔ | ✔ | — | — | bun.sh |
| cabal | 3.16.1.0 | ✔ | ✔ | — | _mirrors.proxy.example.com | cabal.sh |
| cargo (–config flags) | 1.99.1 | ✔ | — | — | index.crates.io | cargo-flags.sh |
| cargo | 1.99.1 | ✔ | — | — | — | cargo.sh |
| cargo (with a token: refused) | 1.99.1 | — | ✔ | ✔ | — | cargo-token.sh |
| Composer | 2.11.2 | ✔ | ✔ | — | — | composer.sh |
| Conan 2 | 2.34.0 | ✔ | — | ✔ | — | conan.sh |
| Conan 2 (with a token: refused) | 2.34.0 | — | ✔ | — | — | conan-token.sh |
| conda | 24.9.2 | ✔ | ✔ | — | — | conda.sh |
| containerd | v1.7.25 | ✔ | ✔ | — | — | containerd.sh |
| cpanm | 1.7049 | ✔ | ✔ | — | — | cpanm.sh |
| R (install.packages) | 4.4.1 | ✔ | ✔ | — | — | cran.sh |
| dart pub | 3.5.4 | ✔ | ✔ | — | — | dart.sh |
| Deno | 2.9.8 | ✔ | ✔ | — | — | deno.sh |
| DNF | 4.14.0 | ✔ | ✔ | — | — | dnf.sh |
| Docker Engine (docker login) | 27.5.1 | — | ✔ | — | — | docker-login.sh |
| Docker Engine | 27.5.1 | ✔ | — | — | docker.io | docker.sh |
| RubyGems (gem) and a Gemfile source | 3.5.22 | ✔ | ✔ | — | — | gem.sh |
| Git | 2.49.1 | ✔ | ✔ | — | — | git.sh |
| go | 1.24.13 | ✔ | ✔ | — | — | go.sh |
| Gradle | 8.10.2 | ✔ | ✔ | — | — | gradle.sh |
| Helm | v3.16.3+gcfd0749 | ✔ | ✔ | — | — | helm.sh |
| mix (Hex) | 1.16.3 | ✔ | — | — | — | hex.sh |
| mix (with a token: refused) | 1.16.3 | — | ✔ | — | — | hex-token.sh |
| huggingface_hub | 2.4.0 | ✔ | ✔ | — | — | huggingface.sh |
| Julia Pkg | 1.10.13 | ✔ | ✔ | — | — | julia.sh |
| Composer (an existing lock file, written against packagist.org) | 2.11.2 | ✔ | ✔ | — | api.github.com | lock-composer.sh |
| npm (an existing lock file, written against npmjs.org) | 10.9.9 | ✔ | ✔ | — | — | lock-npm.sh |
| Poetry (an existing lock file, written against PyPI) | 2.5.1 | ✔ | ✔ | — | — | lock-poetry.sh |
| dart pub (an existing lock file, written against pub.dev) | 3.5.4 | ✔ | ✔ | — | — | lock-pub.sh |
| uv (an existing lock file, written against pypi.org) | 0.13.7 | ✔ | ✔ | — | — | lock-uv.sh |
| Yarn 1 (an existing lock file, written against the public registry) | 1.22.22 | ✔ | ✔ | — | registry.yarnpkg.com | lock-yarn-classic.sh |
| Maven (user name + password) | 3.9.16 | — | ✔ | — | — | maven-basic.sh |
| Maven | 3.9.16 | ✔ | ✔ | — | — | maven.sh |
| micromamba | 2.0.5 | ✔ | ✔ | — | — | micromamba.sh |
| Nix | 2.35.6 | ✔ | ✔ | — | — | nix.sh |
| npm (environment only) | 10.9.9 | ✔ | ✔ | — | — | npm-env.sh |
| npm (JSR packages through npm.jsr.io) | 10.9.9 | ✔ | ✔ | — | — | npm-jsr.sh |
| npm | 10.9.9 | ✔ | ✔ | — | — | npm.sh |
| NuGet (dotnet) | 8.0.428 | ✔ | — | — | — | nuget.sh |
| NuGet (with a token: refused) | 8.0.428 | — | ✔ | — | — | nuget-token.sh |
| ovsx | 1.4.0 | ✔ | ✔ | — | — | openvsx.sh |
| PDM | 2.29.7 | ✔ | ✔ | — | — | pdm.sh |
| pip (environment + ~/.netrc) | 25.0.1 | ✔ | ✔ | — | — | pip-netrc.sh |
| pip | 25.0.1 | ✔ | ✔ | — | — | pip.sh |
| pnpm | 9.15.0 | ✔ | ✔ | — | — | pnpm.sh |
| Poetry | 2.5.1 | ✔ | ✔ | — | — | poetry.sh |
| puppet module | 8.10.0 | ✔ | ✔ | — | — | puppet.sh |
| r10k | 5.0.3 | ✔ | ✔ | — | — | r10k.sh |
| cargo (a refused crate) | 1.99.1 | ✔ | — | — | — | refused-cargo.sh |
| go (a refused module) | 1.24.13 | ✔ | ✔ | — | — | refused-go.sh |
| npm (a refused package) | 10.9.9 | ✔ | ✔ | — | — | refused-npm.sh |
| pip (a refused package) | 25.0.1 | ✔ | ✔ | — | — | refused-pip.sh |
| skopeo (Podman, Buildah, CRI-O) | 1.17.0 | ✔ | ✔ | — | — | skopeo.sh |
| Terraform | v1.9.8 | ✔ | ✔ | — | — | terraform.sh |
| OpenTofu | v1.8.11 | ✔ | ✔ | — | — | tofu.sh |
| uv | 0.13.7 | ✔ | ✔ | — | — | uv.sh |
| Yarn 1 (classic) | 1.22.22 | ✔ | ✔ | — | — | yarn-classic.sh |
| Yarn 4 (berry) | 4.5.3 | ✔ | ✔ | — | — | yarn.sh |
✔ the script passed · — the script is not for that mode · Other hosts looked up: names besides the proxy’s that the client asked the name server for, all declared in the script.
A script named with a token: refused asserts a limitation: it passes
when the client still cannot do what the guide says it cannot (present a token,
mostly), and fails — telling the guide to be updated — when it can. So do
single steps of other scripts (git, helm, skopeo, terraform, tofu,
openvsx). The scripts named a refused package (crate, module) are
something else: they show what a client prints when the proxy blocks a
package.
A row is the result of the script as it is now. Each run records a fingerprint
of what its script executes, lab.sh document writes the table only when
every script has passed in every mode it is for, and a test fails when a
script has changed since its row was written — so an edited script has to be
run again before its ✔ is worth anything.
What the lab found
Running the documented configurations for real changed the documentation, the tooling and the proxy:
- OpenTofu could not install modules through the proxy. Its registry names a module’s source in a JSON body, which the Terraform backend dropped. Fixed in the backend (backends: terraform).
- Composer was leaking to packagist.org. Redefining the
packagistrepository — what the ecosystem test and the documentation did — does not switch packagist.org off in Composer 2.11; Composer kept askingrepo.packagist.org. Invisible without a way out; caught by the name server. The test, the guide andptctl confignow switch it off (Composer). - Composer and Yarn 1 install an existing lock file from the hosts it
names — GitHub,
registry.yarnpkg.com— not through the proxy; npm, uv, Poetry and pub do not. The guide now says what to do for each (moving a project). - A documented cargo configuration never worked.
CARGO_SOURCE_…environment variables are ignored by cargo;--configflags work (cargo). - Mix skips certificate verification on a machine with no system trust store at all — a slim container image — with a warning, instead of failing (Hex).
- Homebrew falls back to the public formula API when it cannot verify the proxy’s certificate — and no environment variable gives it the CA (Homebrew).
- dart pub trusts the system store only —
SSL_CERT_FILEis ignored (Dart). - Clients ask hosts that are not registries: Terraform asks
checkpoint-api.hashicorp.comfor new versions of itself, thehfcommand asks pypi.org, NuGet asks the signing CAs’ revocation servers while verifying package signatures, thedotnetcommand reports usage todc.services.visualstudio.com, brew updates itself fromgithub.com. Each page says how to switch that off, and each script that sets such a switch was also run without it to see what it is for. - Several clients cannot present a token to the proxy: cargo, NuGet,
Terraform and OpenTofu for providers, Conan, mix, ovsx; Maven only in some of
its forms. The guide says so per client, and the lab asserts these
limitations so that the guide follows when one is lifted
(which clients). The Docker
Engine, the library Podman, Buildah, CRI-O and skopeo share, Helm for OCI
charts and Git with a credential helper were on this list while the proxy
challenged every client with
Bearer: they read it as the address of a token service, or answer only aBasicchallenge. The proxy now challenges container registry and Git requests withBasic, and the lab asserts thatdocker login,skopeo login,helm registry loginand a Git credential helper work. ptctl configprinted configurations that cannot work: amix hex.repo addthat Hex rejects, credentials cargo and NuGet never send, a token in a Git URL, a conda channel alias whose credentials conda drops, aGOPROXYwith a,directfallback. Those are corrected; where its snippets still differ from the guide is listed on its page.- An anonymous role turns
401into403for requests without a token to other upstreams, which keeps a client that waits for a401from ever sending its token (access control).
Writing a script
A script is a POSIX sh file in
scripts/client-lab/clients that configures
one client the way the guide says and uses it. It starts with a few header
lines:
#!/bin/sh
# lab: client=npm the name in the result table (required)
# lab: image=node:22-slim the client's image, pinned (required)
# lab: modes=open auth the modes it is for (this is the default)
# lab: entrypoint=sh for images whose entrypoint is the tool itself
# lab: daemon=docker the client is a container engine: run it as a private daemon
# lab: user=0 for images that default to an unprivileged user
# lab: lookups=docker.io hosts besides the proxy the client is known to look up
set -eu
echo "LAB_CLIENT_VERSION=$(npm --version)"
Rules, most of which a test enforces:
- Write addresses and paths as the guide prints them
(
https://proxy.example.com/v1/npm/,/etc/ssl/corp-ca.pem), and give a command the guide prints a line of its own: a line of the guide is verified by being a whole line of the script. Write a configuration file with a here document, so that the script has the file’s lines as the guide shows them. - Add credential lines only when
$PROXY_TOKENis set, so one script serves every mode. - Assert what the guide claims — that a lock file does or does not name the proxy, that an alternative that looks right does not work.
- Run under
set -eu, and printLAB_CLIENT_VERSION=<version>. Write “this must not be there” asif grep -q … ; then echo …; exit 1; fi: a negated command (! grep -q …) never fails a script, whateverset -esuggests. - A switch that keeps the client from asking another host belongs on the
client’s page as well. A script that needs
DOTNET_CLI_TELEMETRY_OPTOUT=1to stay on the proxy has found something the page has to say: run it once without the switch, and write down which host it is for. - Then run it (
lab.sh run <name>), regenerate the table above (make client-lab-report, which refuses while a script is missing, failing or changed since it ran), and reference the script from the guide:
<!-- verified: lab:npm -->
(a fenced block whose every line is in scripts/client-lab/clients/npm.sh)
The markers a block of the guide may carry, and what
internal/clientguide checks for each:
| Marker | Meaning | Check |
|---|---|---|
verified: lab:<script> ci:<ecosystem> |
executed by these scripts | every line is a whole line one of them executes (a comment in a script is not executed), in the script’s order; the lines of a file are written by one script and nested as it nests them; every script named executes a line of the block; the block has no comments of its own |
output: lab:<script> |
what a run printed | the script exists; the block has no language |
proxy-config |
a fragment of the proxy’s configuration | it decodes as the proxy’s configuration: real settings, values of their types, upstream types that exist |
untested: <reason> |
not executed | a reason is given |
illustration |
not something to type | — |
What the check cannot show is that a block is complete: a block may be part of
a file — the registry line of an .npmrc under Configure, its token line
under Authenticate — so one that leaves out a line the client needs passes
all the same. Two things narrow that gap: a block of a configuration language
has to close the brackets it opens (a file cut short does not), and the lines
without which a configured client still goes to the public registry —
default_channels: [], { "packagist.org": false }, <clear />,
--mirror-only and the like — are listed in the test and have to be on their
pages. The rest is for a reader of the page to catch.
The same scripts stand behind ptctl config: for the ecosystems listed in the
test (heldGenerators), every line it prints is a line a lab script executes.
In CI
The Client lab workflow
(.github/workflows/client-lab.yml)
builds the proxy once, derives one job per client image from the scripts
themselves (lab.sh matrix), runs each group, and assembles the result table
into the run summary. It fails unless every script ran and passed in every
mode it is for. It runs nightly — a canary for client releases and registry
changes — on demand, and on changes to the lab or the guide; it does not gate
a push, because it depends on some thirty images and as many public registries
being up.
go test ./internal/clientguide/, which holds the guide to the scripts, is
part of the ordinary test run.