Skip to content

fix: Enforce allow-git/allow-file/allow-directory/allow-remote configs at the arborist resolution layer#9348

Merged
owlstronaut merged 3 commits into
latestfrom
owl/add-checkallow
May 13, 2026
Merged

fix: Enforce allow-git/allow-file/allow-directory/allow-remote configs at the arborist resolution layer#9348
owlstronaut merged 3 commits into
latestfrom
owl/add-checkallow

Conversation

@owlstronaut
Copy link
Copy Markdown
Contributor

@owlstronaut owlstronaut commented May 12, 2026

Pacote already enforces these settings inside FetcherBase.get, but it only sees what its callers tell it — specifically the _isRoot flag, and it never gets called at all for directory specs, which arborist resolves by creating a Link node directly.

That left two gaps: pacote couldn't gate directory deps because it never saw them, and the _isRoot hint it received was wrong for any transitive that flowed through a synthesized virtualRoot or a hoisted location. Moving the check into arborist closes both: arborist is the only layer that has the real tree context (the actual edge being resolved, with its true from node) and the only layer that sees every spec type before any branching. Pacote's gate stays in place as defense-in-depth for direct pacote consumers, but the authoritative enforcement now lives where the truth lives.

fixes #9347

@owlstronaut owlstronaut requested review from a team as code owners May 12, 2026 16:06
@owlstronaut owlstronaut force-pushed the owl/add-checkallow branch 3 times, most recently from 9e9d7dd to 3f6545d Compare May 12, 2026 17:28
@owlstronaut owlstronaut force-pushed the owl/add-checkallow branch from 3f6545d to 8605d10 Compare May 12, 2026 17:44
@owlstronaut owlstronaut force-pushed the owl/add-checkallow branch from a42d830 to d4b454e Compare May 12, 2026 18:24
Copy link
Copy Markdown

@nishantms nishantms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read-through of the arborist allow-* enforcement. Approach (lift the gate above the symlink branch and the manifest cache) is right, and the soft-fail-via-#loadFailures handling for optional transitives is the correct behavior. A few non-blocking nits below.

Comment thread workspaces/arborist/lib/arborist/build-ideal-tree.js Outdated
Comment thread workspaces/arborist/lib/arborist/build-ideal-tree.js
Comment thread workspaces/arborist/lib/arborist/reify.js Outdated
Comment thread test/lib/commands/install.js
@owlstronaut owlstronaut requested a review from nishantms May 13, 2026 16:27
@owlstronaut owlstronaut merged commit f550eb4 into latest May 13, 2026
33 checks passed
@owlstronaut owlstronaut deleted the owl/add-checkallow branch May 13, 2026 17:54
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Backport to release/v11 failed.

This usually means the cherry-pick had conflicts. Please create a manual backport:

git fetch origin release/v11
git checkout -b backport/v11/9348 origin/release/v11
git cherry-pick -x f550eb415de0aff83a5fa297850104f5390a6e30~3..f550eb415de0aff83a5fa297850104f5390a6e30
# resolve any conflicts, then:
git push origin backport/v11/9348
Error details
Command failed: git cherry-pick -x f550eb415de0aff83a5fa297850104f5390a6e30~3..f550eb415de0aff83a5fa297850104f5390a6e30
error: could not apply e0f12f7e5... feat: add allow-git/allow-file/allow-directory/allow-remote configs
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] allow-remote=none breaks pure-registry installs

2 participants