Skip to content

feat(lockfiles): give aube, npm, Bun and Yarn opted-in registry credentials - #178

Merged
sweepies merged 5 commits into
mainfrom
feat/lockfile-registry-credentials
Nov 4, 2026
Merged

sweepies merged 5 commits into
mainfrom
feat/lockfile-registry-credentials

Conversation

@sweepies

@sweepies sweepies commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Part of #157, phase 4: lockfile tools and private registries.

What

  • New operator setting tools on a registries entry, default false. It needs auth. It is refused on a mirrorOf entry, since lockfile tools read the registries the repository names, never a mirror. It is also refused when any other entry sits under its prefix, since npm, aube and Bun would send the broader entry's credential there, and when the prefix holds = or ;, which .npmrc keys cannot.

  • With tools = true, aube, npm, Bun and Yarn get the credentials as per-prefix user configuration in the job's private HOME:

    • npm, aube and Bun: //host/path/:_authToken or :_auth;
    • Yarn: npmRegistries.

    The files are owner-only, never written through an existing link, and removed on every exit path.

Trust model

tools = true trusts every repository that may use the entry, and every package those repositories depend on, with the credential.

These tools run with lifecycle scripts off, but they still prepare git dependencies by running their build scripts: npm's pacote runs npm install --force in the dependency, with no --ignore-scripts. The runner has no sandbox, so that code can read the credential.

The docs say this plainly and point at allowedInstallations. This is the same exposure Renovate's hostRules have.

Within that model:

  • The repository's own registry, proxy and TLS settings apply as each tool reads them. npm, aube and Bun match credentials by host whatever the scheme, so a repo setting that uses plain HTTP or turns TLS off, or a registry serving HTTP tarball URLs, sends the credential unencrypted. The docs say so. Sanitising every tool's config was tried for two review rounds and could not be made complete.
  • A tool that fails while holding credentials shows none of its output, which could quote the private registry's answer in a report, dashboard or public page.
  • patchula serve gives the runner its tools entries (it built the runner without them at first).
  • Bundler, dotnet, uv and Poetry never get credentials.

Docs

guide/lockfiles.md, guide/sources.md, reference/settings.mdx, renovate/compatibility.md, renovate/departures.md.

Follow-ups

  • Cargo (CARGO_REGISTRIES_<NAME>_TOKEN), Go (.netrc), Composer (COMPOSER_AUTH) and Terraform (TF_TOKEN_<host>) tool credentials, on the same plumbing and trust model.
  • Yarn Berry interpolates ${VAR} in .yarnrc.yml, so a Basic password containing ${ would make every credentialed Yarn run fail, with its output withheld. Secrets are read per batch, so settings validation cannot catch it; yarn_auth could refuse such an entry with a clear message.
  • Credential files in run-*/driver/home survive a SIGKILL or OOM kill (mode 0600, on the cache volume). Sweeping stale run-* directories at startup would close this.
  • A real sandbox for lockfile tools, such as a credential-injecting proxy, would let tools stop being a trust grant.

…ntials

A registry entry with `tools = true` also gives its credentials to the
lockfile tools that run no repository or package code. They are written as
per-host user configuration in the job's private home, owner-only, for the
npm-family run alone, and removed afterwards. Bundler, dotnet, uv and Poetry
never get them. `tools` needs `auth` and is refused on a mirror entry.

Refs #157
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 68473ce Commit Preview URL

Branch Preview URL
Nov 04 2026, 07:36 AM

…e leaks review found

npm, aube, Bun and Yarn can still run a git dependency's build scripts, so
`tools = true` trusts the repositories that may use an entry, and their
dependencies, with its credential; the docs now say so. Within that:

- Yarn runs with an allowlist of `.yarnrc.yml` settings, so no repository
  proxy, TLS or plain-HTTP setting applies.
- A run stops when a committed file names a credentialed host over plain
  HTTP, which npm, aube and Bun would send the credential to.
- No other entry may sit under a tools entry's prefix, where these tools
  would send the broader entry's credential.
- Tool output is redacted of every registry secret.
- Credential files never write through an existing link and are removed on
  every exit path, the aube configuration included.
…tool credentials

`patchula serve` built its lockfile runner without the tools entries, so
`tools = true` only worked from the CLI. It now gets them.

The repository is trusted with a tools credential, so its own registry,
proxy and TLS settings apply as each tool reads them. The plain-HTTP scan
and the Yarn settings allowlist go: neither could cover every file and URL
the tools read, and the allowlist broke Yarn setups for operators who never
set `tools`. The docs say what a plain-HTTP or TLS-off setting exposes.
…registry credentials

A failing npm-family tool can quote what a private registry answered, and
failure reasons reach reports, dashboards and public pages. When it held
credentials, the reason now names the tool and nothing it printed, which
replaces the secret redaction. Credentials are written before the
sanitised `.npmrc` files, so a failed write leaves nothing to restore, and
a tools prefix cannot hold `=` or `;`, which `.npmrc` keys cannot.
@sweepies
sweepies merged commit 587e52b into main Nov 4, 2026
12 checks passed
@sweepies
sweepies deleted the feat/lockfile-registry-credentials branch November 4, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant