Skip to content

fix: update pnpr authentication configuration - #80

Merged
zkochan merged 1 commit into
mainfrom
fix/pnpr-auth-users
Nov 10, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix/pnpr-auth-users

Conversation

@zkochan

@zkochan zkochan commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

The registry cache job fails before any benchmarks run because pnpr 0.1.0-alpha.19 rejects auth.htpasswd. Use the current auth.users key, preserving the user file and single-user registration limit so the benchmark can still obtain a resolver token.

Fixes the startup failure in https://github.com/pnpm/benchmarks/actions/runs/42803586025.

Validation:

  • pnpm test — all 9 tests pass.
  • pnpm run lint — passes.
  • Smoke run with pnpm 12.19.0 and pnpr 0.1.0-alpha.19: server startup, user registration, cache population through both registry formats (including the update graph), level-19 zstd warm-up, and authenticated server-side resolution through the latency proxy all pass. The full benchmark suite was not run.

Summary by CodeRabbit

  • Bug Fixes
    • Updated pnpr authentication configuration to use the configured user file.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pnpr authentication configuration now uses auth.users. The configured user-file path and maxUsers: 1 remain unchanged.

Changes: pnpr Authentication Configuration

Layer / File(s) Summary
Update authentication subsection
pnprServer.js
The configuration now uses auth.users instead of auth.htpasswd. The user-file path and one-user limit remain unchanged.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: Minimal · up to dc6d8

The authentication configuration matches the pnpr version used by the benchmark. No merge-blocking issue was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the change to the pnpr authentication configuration.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the config with care,
And finds auth.users waiting there.
The file path stays, the limit too,
One user keeps the setting true.
Then off it hops through fields of dew.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a39855e-1c6a-4e88-8d0d-71bd88363500
Commits

Reviewing files that changed from the base of the PR and between 8e71514 and dc6d829.

Files selected for processing: 1

  • pnprServer.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

ast-grep (0.51.1)

pnprServer.js

[warning] 107-166: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.writeFileSync(configPath, [
storage: ${path.join(dir, 'storage')},
'auth:',
' users:',
file: ${path.join(dir, 'htpasswd')},
// The benchmark registers its own resolver user on startup.
' maxUsers: 1',
'registries:',
// The public npm registry. No packages: map, so it claims every
// name — the catch-all, and therefore last in the router's sources.
' npmjs:',
' type: upstream',
' url: https://registry.npmjs.org/',
' public: true',
// Bit publishes to a registry of its own, and alotta-packages
// depends on it. Declaring the scopes it serves is all the routing
// that is needed: every manager keeps installing from the one
// registry URL the benchmark hands it, and the names below are the
// only ones fetched from bit. Tarball URLs come back rewritten to
// pnpr's own address, so bit's packages cross the emulated link
// like every other package.
' bit:',
' type: upstream',
url: ${BIT_REGISTRY},
' public: true',
' packages:',
...BIT_SCOPES.map((scope) => '${scope}/*':),
// One URL in front of both: a router resolves a name to the first
// source whose declared packages claim it. defaultRegistry has to
// name this rather than a concrete registry — a concrete one
// resolves only its own namespace and answers Unclaimed for
// everything else, with no fall-through to a sibling.
' main:',
' type: router',
' sources: [bit, npmjs]',
// The same sources again, served as tars rather than .tgz files (see
// tarRegistryUrl). One storage behind both: a package pulled through
// either is cached once.
${TAR_REGISTRY}:,
' type: router',
' sources: [bit, npmjs]',
' tarballs: tar',
'defaultRegistry: main',
'resolver:',
' enabled: true',
// The accelerated scenario asks the server to resolve against this
// address — its own un-proxied tar registry — so the resolver's metadata fetches
// stay on loopback instead of crossing the emulated link and coming back
// in through the front door (see applyPnprServerRegistry). The server
// resolves against whatever registry the client sends but only if that
// registry is declared, so the address has to be listed as a route here.
'routes:',
' public:',
- registry: ${tarRegistryUrl(http://127.0.0.1:${port})},
'log:',
' type: stdout',
' format: pretty',
level: ${logLevel},
'',
].join('\n'))
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)

Additional comments: 1

pnprServer.js: 1

110-110: LGTM!

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix pnpr authentication configuration for benchmark startup

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replace the rejected auth.htpasswd key with auth.users so pnpr can start.
• Preserve the user file and registration limit needed to obtain a resolver token.
Diagram

graph TD
  A["Benchmark setup"] --> B["Generated config"] --> C["pnpr server"] --> D["User registration"] --> E["Resolver token"]
Loading
High-Level Assessment

Use the supported auth.users key. It fixes startup without changing the existing user file, registration limit, or token workflow.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
pnprServer.jsUse pnpr's current user authentication key +1/-1

Use pnpr's current user authentication key

• Changes the generated pnpr configuration from 'auth.htpasswd' to 'auth.users', which pnpr 0.1.0-alpha.19 accepts. The user file path and single-user limit remain unchanged.

pnprServer.js

@zkochan
zkochan merged commit 0131523 into main Nov 10, 2026
5 checks passed
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