-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src,permission: add --allow-addon flag
PR-URL: #51183 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
- Loading branch information
1 parent
f4987eb
commit fd5efac
Showing
10 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Flags: --experimental-permission --allow-addons --allow-fs-read=* | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
common.skipIfWorker(); | ||
|
||
const { createRequire } = require('node:module'); | ||
const assert = require('node:assert'); | ||
const fixtures = require('../common/fixtures'); | ||
const loadFixture = createRequire(fixtures.path('node_modules')); | ||
// When a permission is set by cli, the process shouldn't be able | ||
// to require native addons unless --allow-addons is sent | ||
{ | ||
// doesNotThrow | ||
const msg = loadFixture('pkgexports/no-addons'); | ||
assert.strictEqual(msg, 'using native addons'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Flags: --experimental-permission --allow-fs-read=* | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
common.skipIfWorker(); | ||
|
||
const { createRequire } = require('node:module'); | ||
const assert = require('node:assert'); | ||
const fixtures = require('../common/fixtures'); | ||
const loadFixture = createRequire(fixtures.path('node_modules')); | ||
// When a permission is set by cli, the process shouldn't be able | ||
// to require native addons unless --allow-addons is sent | ||
{ | ||
// doesNotThrow | ||
const msg = loadFixture('pkgexports/no-addons'); | ||
assert.strictEqual(msg, 'not using native addons'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters