Skip to content

fix: recognize allowScripts for local link targets#9497

Merged
owlstronaut merged 1 commit into
release/v11from
backport/v11/9490
Jun 5, 2026
Merged

fix: recognize allowScripts for local link targets#9497
owlstronaut merged 1 commit into
release/v11from
backport/v11/9490

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 5, 2026

Backport of #9490 to release/v11.

## Summary
- Recognize local directory link targets by their incoming link source
when matching `allowScripts` policy entries.
- Reuse that source identity when `approve-scripts`/`deny-scripts`
derive file dependency policy keys.
- Add coverage for reviewed local `file:` dependency link targets.

Fixes #9488

## Testing
- `node node_modules/tap/bin/run.js --no-coverage
workspaces/arborist/test/script-allowed.js
workspaces/arborist/test/unreviewed-scripts.js
test/lib/utils/allow-scripts-writer.js
test/lib/utils/check-allow-scripts.js
test/lib/utils/resolve-allow-scripts.js`
- `node node_modules/eslint/bin/eslint.js
lib/utils/allow-scripts-writer.js test/lib/utils/allow-scripts-writer.js
workspaces/arborist/lib/script-allowed.js
workspaces/arborist/test/script-allowed.js
workspaces/arborist/test/unreviewed-scripts.js`
- `git diff --check`
- Manual repro: local `file:` dependency with `allowScripts: {
"file:../testdep": false }` no longer emits an `allow-scripts` warning;
`npm approve-scripts --all` writes `file:../testdep`.

---------

Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
(cherry picked from commit 2cbb13b)
@owlstronaut owlstronaut merged commit 4fa81df into release/v11 Jun 5, 2026
52 checks passed
@owlstronaut owlstronaut deleted the backport/v11/9490 branch June 5, 2026 17:07
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.

2 participants