Skip to content

fix(arborist): preserve alias registry credentials (v10 backport) - #10218

Open
martinrrm wants to merge 1 commit into
release/v10from
backport/v10/9921-alias-identity
Open

martinrrm wants to merge 1 commit into
release/v10from
backport/v10/9921-alias-identity

Conversation

@martinrrm

Copy link
Copy Markdown
Contributor

Summary

Narrow v10 adaptation of the alias identity/authentication correction in #9921.

  • Derive the extraction package name from valid dependency specifications rather than the installed alias slot or package-controlled metadata.
  • Preserve scoped registry authentication for aliases shared with ordinary dependencies, regular peers, and optional peers.
  • Carry that identity through both linked-install transformations.
  • Match v10's existing override semantics: bundled and shrinkwrapped dependencies use the raw specification.
  • Preserve the existing extraction fallback when the dependency identity is absent, non-registry, or ambiguous.

Backport scope

This targets release/v10. It is not a full cherry-pick of #9921, which targets latest and is still open.

npm 10 does not have the newer allow-remote policy feature. This PR therefore does not introduce remote-policy enforcement or exemptions, sibling-path metadata verification, additional metadata requests, configuration changes, dependency upgrades, or generated/bundled dependency changes.

Regression coverage

Nine mocked-registry integration scenarios cover hoisted and linked installs, ordinary consumers, regular and optional peers, and global alias installation. A token scoped to the registry's /npm/ path must accompany the sibling-path tarball request. Deliberately misleading lockfile/package metadata cannot select the credential scope.

Identity tests cover aliases, peer and project/workspace precedence, conflicting selections, non-registry specifications, linked transformations, and v10 override/bundle/shrinkwrap behavior.

Validation

  • Before the fix, the eight original local/linked integration scenarios fail because the tarball request lacks the expected scoped authorization header.
  • Final focused checks pass on Windows with Node 22.23.4: all nine integration scenarios, all 26 identity assertions, and owning-package ESLint.
  • git diff --check passes.
  • Full Arborist tests were attempted with coverage retained, but the locally reused development tooling encounters Windows fixture/socket errors and native Node crashes. The same No socket was returned in the connect() function failure and native exit reproduce on the clean v10 base commit a8804198f147914cab2fc25f6d48535f13621b9a.
  • Full-suite success/coverage and the supported Node/OS CI matrix are not established locally.
  • Template-oss postlint is blocked by the local tooling mismatch: v10 pins 4.29.0, while the reused checkout has 5.1.1. No generated files, coverage settings, or dependencies were changed to bypass these checks.

Draft pending review and validation with the maintenance branch's matching tooling/CI.

Narrow alias identity/authentication adaptation of #9921 for release/v10.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ede510fc-429c-4202-aac7-66584aaee157
@martinrrm
martinrrm marked this pull request as ready for review November 3, 2026 22:20
@martinrrm
martinrrm requested a review from a team as a code owner November 3, 2026 22:20
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