Repository navigation
Conversation
…egistry pacquet already reads the layered `.npmrc` cascade (user < auth.ini < project) and rescopes each source's unscoped per-registry settings before the merge, so a project `.npmrc` that only sets `registry=` cannot pull a user-level credential to another host. Four gaps in that rescope remained, all of them behaviors the TypeScript CLI already had; this closes them. - An unscoped `cert=` / `key=` kept its `\n` escapes literally, while the URL-scoped `//host/:cert=` spelling expanded them. The two spellings of the same identity now produce byte-identical PEMs: expansion moved into the parser, so it happens once for both. - The rescope moved the structured credentials but left `raw_ini_config` holding the unscoped key, so `pnpm config get` / `pnpm config list` reported a credential under a key that no longer had any effect. The raw INI keys are rewritten alongside the structured ones. - The deprecation warning identified the source as `<user>/.npmrc` or `auth.ini` rather than the path actually read, never mentioned `tokenHelper` (which was rescoped but omitted from the key list), and the unparseable-registry variant did not say why the settings were dropped. Both warnings now name the file, list every key, and match pnpm's wording. - `build_auth_headers` still had a fallback that keyed leftover unscoped credentials at `config.registry` — the resolved default registry, which repository config can move. That is the rebind the rescope exists to prevent, so the fallback is gone, along with the empty-string default slot in `AuthHeaders::from_creds_map` that fed it. A debug assertion documents that credentials reach header building already pinned. The `@pnpm/napi` bindings kept an equivalent slot. `authHeaderByUri` accepts `""` for the host's default-registry credential, and it was applied at whatever `config.registry` resolved to — reachable from the project's own `.npmrc`. Dropping it outright would have silently broken auth for embedders that pass it, so it is pinned the same way a `.npmrc` credential is: to the `registry` / `registries.default` of the same overlay, or npmjs when the overlay declares neither. An explicit key for that URI still wins, and an unparseable registry drops the header instead of sending it somewhere unintended. Closes #11950. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The release note used "unkeyed" for the empty-string authHeaderByUri entry; cspell has no entry for it and the pre-push hook rejects it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughUnscoped ChangesCredential pinning and auth-header updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ConfigCurrent
participant NpmrcAuth
participant AuthHeaders
ConfigCurrent->>NpmrcAuth: load trusted npmrc source
NpmrcAuth->>NpmrcAuth: pin unscoped settings to source registry
NpmrcAuth->>AuthHeaders: provide URI-scoped credentials
AuthHeaders-->>ConfigCurrent: build authorization headers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoPin unscoped .npmrc credentials/TLS to each source registry (remove default slot)
AI Description
Diagram
High-Level Assessment
Files changed (19)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains in the fix for the previously reported token-helper raw-key omission. Reviews (2): Last reviewed commit: "fix(pacquet): normalize auth keys and re..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13285 +/- ##
==========================================
+ Coverage 86.91% 86.95% +0.04%
==========================================
Files 530 530
Lines 90785 90874 +89
==========================================
+ Hits 78903 79023 +120
+ Misses 11882 11851 -31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review follow-ups on the rescope work:
- The deprecation warnings formatted the source path with `{:?}`, which
escapes backslashes — on Windows the message named
`"C:\\Users\\...\\.npmrc"`, and the two tests asserting the path appears
verbatim failed there. Quote the path instead of Debug-formatting it.
- An unscoped `tokenHelper` has no INI-readable spelling of its own
(`is_ini_config_key` mirrors npm, which has no unscoped form), so the
parser never captured it in `raw_ini_config` and the pinned key had
nothing to move. pacquet honors the setting, so `pnpm config get` and
`pnpm config list` should report it: take each setting's raw spelling
and structured value together, falling back to the parsed credential
for `tokenHelper`.
- `AuthHeaders::from_creds_map` collected caller keys verbatim and left
normalization to `from_map`, so `//reg.com` and `//reg.com/` survived as
two entries and collapsed later in whichever order the map iterated.
Normalize as they are collected. `normalize_auth_key` is public now so
the napi binding can apply the same rule rather than repeat it.
- `pin_unkeyed_header` had the same split: a host key spelled without the
trailing slash was not recognized as "already keyed at that URI", so the
pinned entry was inserted alongside it and the documented "explicit key
wins" guarantee depended on map order.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Parity note for the maintainer — one open question this PR surfaces but deliberately does not settle. pacquet honors an unscoped No This PR keeps pacquet’s existing behavior and only makes the reporting consistent with it: since pacquet honors the setting, Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 873bed6 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Re: Qodo’s new finding "tokenHelper output unredacted" — checked, and this is existing behavior in both stacks rather than something this change introduces.
The token is censored; the helper command line is not — in the TypeScript CLI exactly as in pacquet. What this PR changes is only which key a rescoped helper is reported under, so an unscoped Censoring Written by an agent (Claude Code, claude-opus-5). |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5894038782799997,
"stddev": 0.17650770455288714,
"median": 2.53019046798,
"user": 1.71623892,
"system": 1.46459798,
"min": 2.40030354648,
"max": 2.93074517448,
"times": [
2.5878778794799997,
2.77192542748,
2.48782484048,
2.93074517448,
2.76555491448,
2.4750622344799997,
2.4207540974799997,
2.40030354648,
2.48143457248,
2.57255609548
]
},
{
"command": "pacquet@main",
"mean": 2.56923699098,
"stddev": 0.12894134805414134,
"median": 2.53318228898,
"user": 1.6966427199999998,
"system": 1.3577521799999999,
"min": 2.4185442134799997,
"max": 2.82840972648,
"times": [
2.66799124448,
2.82840972648,
2.51850451948,
2.45127931148,
2.4185442134799997,
2.54786005848,
2.68758463448,
2.61080082248,
2.45202091448,
2.50937446448
]
},
{
"command": "pnpr@HEAD",
"mean": 1.46608257948,
"stddev": 0.10788586622979204,
"median": 1.43072458748,
"user": 1.1748959199999998,
"system": 1.17027248,
"min": 1.35254998548,
"max": 1.6904195824800001,
"times": [
1.41207908548,
1.37469400248,
1.43732357048,
1.4575167234800002,
1.60788809248,
1.51173585748,
1.4241256044800001,
1.6904195824800001,
1.39249329048,
1.35254998548
]
},
{
"command": "pnpr@main",
"mean": 1.5634894460800002,
"stddev": 0.1640341979159145,
"median": 1.5805900134800002,
"user": 1.1610765199999997,
"system": 1.2043981799999999,
"min": 1.3521255524800002,
"max": 1.8245379934800001,
"times": [
1.70693209348,
1.8245379934800001,
1.3983478234800002,
1.4879992184800002,
1.74506138648,
1.3521255524800002,
1.5969152904800001,
1.3617950754800001,
1.59553098948,
1.56564903748
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25151392261999994,
"stddev": 0.005153161481768966,
"median": 0.25014973962,
"user": 0.19191577999999998,
"system": 0.53124484,
"min": 0.24389575212000003,
"max": 0.26347151512,
"times": [
0.24895278412000002,
0.24841324212000002,
0.25302593412,
0.25033745512,
0.24943782112000001,
0.24389575212000003,
0.25320320912,
0.25443948912000003,
0.24996202412000001,
0.26347151512
]
},
{
"command": "pacquet@main",
"mean": 0.24548259792,
"stddev": 0.0048593059461414095,
"median": 0.24337151962000003,
"user": 0.18256867999999998,
"system": 0.5173360399999999,
"min": 0.23993684812000002,
"max": 0.25259706312,
"times": [
0.24089706612000003,
0.25259706312,
0.24050490312000003,
0.24349803912,
0.24971517812,
0.25049294012,
0.25077440312000004,
0.24324500012000003,
0.23993684812000002,
0.24316453812000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30337901802000006,
"stddev": 0.05277523919239371,
"median": 0.28475402462,
"user": 0.26195687999999995,
"system": 0.5945544399999999,
"min": 0.24404683712000003,
"max": 0.38622447712,
"times": [
0.25438597812,
0.26207905012000005,
0.26596179912,
0.24404683712000003,
0.26013896812000004,
0.30354625012,
0.35966691812,
0.34931375112,
0.38622447712,
0.34842615112
]
},
{
"command": "pnpr@main",
"mean": 0.31753438292,
"stddev": 0.06003489999026671,
"median": 0.31513344312,
"user": 0.26759278000000003,
"system": 0.62565554,
"min": 0.25049832912000003,
"max": 0.39270821012,
"times": [
0.37570246012,
0.35926183112000004,
0.36882504312000003,
0.37228407012000003,
0.39270821012,
0.27100505512,
0.25899945012000003,
0.26489532112,
0.25049832912000003,
0.26116405912
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7684903238799996,
"stddev": 0.03197829436374807,
"median": 2.7679985717799998,
"user": 1.64819286,
"system": 1.28756212,
"min": 2.71821937828,
"max": 2.83065150928,
"times": [
2.7841837692799998,
2.76943354728,
2.73676533928,
2.7665635962799997,
2.74719373328,
2.71821937828,
2.77652154228,
2.83065150928,
2.75685495928,
2.79851586428
]
},
{
"command": "pacquet@main",
"mean": 2.83119073788,
"stddev": 0.04439940014264501,
"median": 2.81359236428,
"user": 1.82764616,
"system": 1.38462902,
"min": 2.76369969528,
"max": 2.89668783428,
"times": [
2.80391454428,
2.89668783428,
2.85716220628,
2.86832706928,
2.81218930728,
2.81499542128,
2.80366301128,
2.8920070502799997,
2.7992612392800003,
2.76369969528
]
},
{
"command": "pnpr@HEAD",
"mean": 1.75798870318,
"stddev": 0.1450274890887556,
"median": 1.7203363827799998,
"user": 1.55699836,
"system": 1.7616428199999998,
"min": 1.56250191628,
"max": 1.93759170428,
"times": [
1.6791917882799998,
1.64583729828,
1.56250191628,
1.5997555722799999,
1.6741577532799998,
1.76148097728,
1.9304269622799999,
1.93759170428,
1.87244977828,
1.91649328128
]
},
{
"command": "pnpr@main",
"mean": 1.94915540248,
"stddev": 0.10307700091271556,
"median": 1.90132892528,
"user": 1.8383432600000003,
"system": 2.1214659199999994,
"min": 1.86292972228,
"max": 2.16495375028,
"times": [
2.16495375028,
1.89030718028,
1.91460231328,
1.98542647828,
1.88433586828,
1.90120019328,
2.10040009928,
1.90145765728,
1.86292972228,
1.88594076228
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8452841963400001,
"stddev": 0.07547644104347706,
"median": 0.8379906569400002,
"user": 1.03043972,
"system": 0.8792536599999998,
"min": 0.7406835084400001,
"max": 0.9448374124400001,
"times": [
0.9131669144400001,
0.9211464484400002,
0.8272408124400001,
0.8487405014400001,
0.7406835084400001,
0.7965594704400001,
0.7828609474400001,
0.9448374124400001,
0.9205423884400001,
0.7570635594400001
]
},
{
"command": "pacquet@main",
"mean": 0.94664953234,
"stddev": 0.15383649229712146,
"median": 0.9047645474400001,
"user": 1.16224552,
"system": 0.9117825599999998,
"min": 0.7314592964400001,
"max": 1.19974181744,
"times": [
0.8412128894400001,
0.9329491634400001,
0.7314592964400001,
0.8386722374400001,
0.8077471064400001,
1.0437877554400001,
0.8765799314400001,
1.07831864944,
1.11602647644,
1.19974181744
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36691759193999995,
"stddev": 0.0575070057561744,
"median": 0.34783915394,
"user": 0.26276081999999995,
"system": 0.59437226,
"min": 0.31111382044,
"max": 0.5104159704400001,
"times": [
0.33709235944,
0.35053357744,
0.40864343244,
0.35506136844,
0.33034207544,
0.33673257044,
0.31111382044,
0.34514473044,
0.38409601444,
0.5104159704400001
]
},
{
"command": "pnpr@main",
"mean": 0.31037215934,
"stddev": 0.010153931837327131,
"median": 0.31304081244000004,
"user": 0.20438672000000002,
"system": 0.52782356,
"min": 0.29473801644000003,
"max": 0.32437708744,
"times": [
0.32166037644,
0.29755872744,
0.30035594444,
0.29473801644000003,
0.31404189344,
0.31203973144,
0.32437708744,
0.30673868544,
0.31644493144,
0.31576619944
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9898193202199999,
"stddev": 0.05085714684167928,
"median": 1.98645832562,
"user": 1.0777170200000001,
"system": 0.7863787600000001,
"min": 1.92382824812,
"max": 2.07457662712,
"times": [
2.07457662712,
2.03006358912,
2.01739512712,
1.95315801412,
1.94310161112,
2.01849494212,
1.92382824812,
1.94725888412,
1.95552152412,
2.03479463512
]
},
{
"command": "pacquet@main",
"mean": 1.9606262186199999,
"stddev": 0.01462562301248194,
"median": 1.9588786416200001,
"user": 1.02642542,
"system": 0.79005046,
"min": 1.94351669412,
"max": 1.98300906312,
"times": [
1.97298967012,
1.95126816712,
1.9565610151200001,
1.97124813412,
1.97679155212,
1.94351669412,
1.94575511612,
1.98300906312,
1.9611962681200001,
1.94392650612
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30420280662,
"stddev": 0.010503100686117022,
"median": 0.30259728912,
"user": 0.20523642,
"system": 0.5102300599999999,
"min": 0.28834439612,
"max": 0.31947089312,
"times": [
0.30293538712,
0.29768567512,
0.28834439612,
0.29566001512,
0.29515911912,
0.31862890511999997,
0.30911801612,
0.31276646812,
0.30225919112,
0.31947089312
]
},
{
"command": "pnpr@main",
"mean": 0.32261653621999997,
"stddev": 0.008174248264079198,
"median": 0.32257379111999995,
"user": 0.21571392,
"system": 0.57550026,
"min": 0.30877315512,
"max": 0.33466615212,
"times": [
0.33450841512,
0.32504467612,
0.31791734312,
0.31706586712,
0.32133868711999997,
0.32380889512,
0.33466615212,
0.32694662412,
0.31609554712,
0.30877315512
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36818556856000006,
"stddev": 0.01296102044099009,
"median": 0.36248789976000007,
"user": 0.35718759999999994,
"system": 0.06034406,
"min": 0.35581894126,
"max": 0.39438027026,
"times": [
0.38020524626,
0.36331212426000004,
0.35919898526000005,
0.36466224026000005,
0.38313493126000003,
0.36166367526000004,
0.36090472326,
0.35857454826,
0.35581894126,
0.39438027026
]
},
{
"command": "pacquet@main",
"mean": 0.38639907306000004,
"stddev": 0.031720585326764056,
"median": 0.38602137026000005,
"user": 0.37119289999999994,
"system": 0.06618485999999998,
"min": 0.34864254526000005,
"max": 0.44903075726,
"times": [
0.38287559226,
0.38916714826000004,
0.41968542926,
0.44903075726,
0.34864254526000005,
0.35528166826,
0.36701452726,
0.35584719526,
0.39488079526000003,
0.40156507226000004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08870375869750001,
"stddev": 0.0024710061170727404,
"median": 0.08866353826000001,
"user": 0.022700518750000002,
"system": 0.009174126874999999,
"min": 0.08469094126,
"max": 0.09530577026,
"times": [
0.08920769926000001,
0.08586827226,
0.09008997426000001,
0.09432800726,
0.08615764726,
0.08905365826,
0.08844254626,
0.08873479826,
0.08893914226,
0.09096491526,
0.09034923326000001,
0.08910690026000001,
0.09141710726,
0.09530577026,
0.08806865126,
0.08469094126,
0.08640966226,
0.08713587226000001,
0.08618887626,
0.08859227826,
0.08708882326,
0.08614216826,
0.08734282226000001,
0.08627204326,
0.08795563826000001,
0.08902714826000001,
0.09120211126000001,
0.09251292426,
0.08572401826,
0.08984461126,
0.08920864226,
0.08714737426000001
]
},
{
"command": "pnpr@main",
"mean": 0.09105681835999999,
"stddev": 0.0026248959591571638,
"median": 0.09126096226,
"user": 0.023034366666666663,
"system": 0.010646384666666665,
"min": 0.08562108426000001,
"max": 0.09576133126,
"times": [
0.09294432626,
0.09576133126,
0.08709501526,
0.08562108426000001,
0.09111699126,
0.09050019726,
0.09400678226,
0.09011055326,
0.09372746426,
0.09480942526000001,
0.09008414226,
0.09346482926,
0.09196978026000001,
0.09439673626,
0.09234375526000001,
0.08965795826,
0.09084904626000001,
0.09227594726,
0.09125741526,
0.09134292726,
0.08838661026,
0.09126450926,
0.08633074326000001,
0.09300139426000001,
0.09308351026,
0.09199294226,
0.08951462826,
0.08764280826000001,
0.09071271826,
0.08643897826000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.68586455624,
"stddev": 0.18356982423265453,
"median": 4.615013435340001,
"user": 2.1029484,
"system": 1.5631263599999996,
"min": 4.468798001840001,
"max": 5.017174858840001,
"times": [
5.017174858840001,
4.556558450840001,
4.81993225484,
4.581255508840001,
4.468798001840001,
4.55607633684,
4.643187436840001,
4.586839433840001,
4.95447992584,
4.67434335384
]
},
{
"command": "pacquet@main",
"mean": 4.50405250964,
"stddev": 0.06270779196439076,
"median": 4.48159056584,
"user": 1.8036659,
"system": 1.38785976,
"min": 4.42256205284,
"max": 4.60999094984,
"times": [
4.48365792584,
4.4795232058400005,
4.508092262840001,
4.47880156184,
4.42256205284,
4.60999094984,
4.60424496084,
4.46124162484,
4.45226927784,
4.540141273840001
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5282369659399997,
"stddev": 0.111157508918237,
"median": 3.4891401913399998,
"user": 1.1678792999999996,
"system": 1.21214866,
"min": 3.4250041908399997,
"max": 3.75968919184,
"times": [
3.46047308984,
3.51303099484,
3.54668589584,
3.62470689984,
3.42556738884,
3.75968919184,
3.43615707284,
3.62580554684,
3.46524938784,
3.4250041908399997
]
},
{
"command": "pnpr@main",
"mean": 3.5280252181399994,
"stddev": 0.07165873476763844,
"median": 3.52166596084,
"user": 1.2993054,
"system": 1.24164686,
"min": 3.4415020958399998,
"max": 3.63612694084,
"times": [
3.4415020958399998,
3.5012367698399998,
3.46036522384,
3.54209515184,
3.62838177784,
3.46990863584,
3.57932479884,
3.46133485184,
3.63612694084,
3.55997593484
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13285 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,562.50 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 288.34 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 311.11 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.69 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,352.55 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,425.00 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 244.05 ms |
|
The Bencher alert on
The first run was noisy across the board in both directions — sibling scenarios moved −17.53%, −7.81%, +15.32% and −4.68% on the same commit. The code supports that reading: everything this PR changes runs once per process (INI parsing, the rescope, auth-map construction), nothing per-package or per-file. All checks are green now. Written by an agent (Claude Code, claude-opus-5). |
Summary
pacquet already reads the layered
.npmrccascade (user <auth.ini< project) and rescopes each source's unscoped per-registry settings before the merge, so a project.npmrcthat only setsregistry=cannot pull a user-level credential to another host. Four gaps in that rescope remained — every one of them a behavior the TypeScript CLI already has (pnpm11/config/reader/), so this is a pacquet-only catch-up with no matching TS commits needed.cert=/key=written with\nescapes kept the escapes literally, while the URL-scoped//host/:cert=spelling expanded them. Expansion moved into the parser so both spellings of the same identity produce byte-identical PEMs (TS gets this fromgetNetworkConfigs).raw_ini_configholding the unscoped key, sopnpm config get/pnpm config listreported a credential under a key that no longer had any effect. The raw INI keys are rewritten alongside the structured ones.tokenHelperneeds its value taken from the parsed credential: npm has no unscoped spelling for it, sois_ini_config_keynever captures one, yet pacquet honors the setting.<user>/.npmrc/auth.inirather than the path actually read, never mentionedtokenHelper(rescoped, but missing from the key list), and the unparsable-registry variant didn't say why the settings were dropped. Both warnings now match pnpm's wording.build_auth_headersstill had a fallback keying leftover unscoped credentials atconfig.registry— the resolved default registry, which repository config can move. That is exactly the rebind the rescope exists to prevent, so it is gone, along with the empty-string default slot inAuthHeaders::from_creds_mapthat fed it.That last removal also affected the
@pnpm/napisurface, whereauthHeaderByUridocuments""as the host's default-registry credential and applied it at whateverconfig.registryresolved to — reachable from the project's own.npmrc. Dropping the entry outright would silently break auth for embedders that pass it, so it is pinned the same way a.npmrccredential is: to theregistry/registries.defaultof the same overlay, npmjs when the overlay declares neither, and dropped when that registry isn't a parseable URL. An explicit key for that URI still wins.Both auth maps canonicalize a key as it is stored rather than leaving it to
AuthHeaders::from_map, so//reg.comand//reg.com/can't survive as two entries that later collapse in whichever order the map iterates — which would have made "an explicit key wins over the pinned one" depend on iteration order.normalize_auth_keyis public for that reason, so the napi binding applies the same rule instead of repeating it.Closes #11950.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(pacquet-only: every behavior here already exists in the TypeScript CLI.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Summary by CodeRabbit
Bug Fixes
cert/keyvalues now interpret\nescapes as real line breaks, producing correct pinned identities.authHeaderByUriare pinned to the install’sregistry/registries.default.Documentation