GeezerVison is showing github.com — doc: describe how the permission model grants the entrypoint · nodejs/node@97dfaed
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/cli.md +4-2Lines changed: 4 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -252,8 +252,10 @@ The valid arguments for the `--allow-fs-read` flag are: |
252 | 252 |
|
253 | 253 | Examples can be found in the [File System Permissions][] documentation. |
254 | 254 |
|
255 | | -The initializer module and custom `--require` modules has a implicit |
256 | | -read permission. |
| 255 | +The initializer module and custom `--require` modules have an implicit |
| 256 | +read permission. The entrypoint is granted as passed on the command line, |
| 257 | +without the module loader's resolution; see the [File System Permissions][] |
| 258 | +documentation for details. |
257 | 259 |
|
258 | 260 | ```console |
259 | 261 | $ node --permission -r custom-require.js -r custom-require-2.js index.js |
|
Collapse file
Copy file name to clipboardExpand all lines: doc/api/permissions.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -226,6 +226,13 @@ $ node -r /path/to/custom-require.js --permission index.js |
226 | 226 | list. |
227 | 227 | * `index.js` will be included in the allowed file system read list. |
228 | 228 |
|
| 229 | +The entrypoint is granted as passed on the command line, without the module |
| 230 | +loader's resolution. If it is a directory, such as in `node --permission .`, |
| 231 | +read access is granted to everything inside that directory, recursively. If it |
| 232 | +omits the file extension, such as in `node --permission index`, the resolved |
| 233 | +`index.js` is not granted. Pass the full path of the file, or use |
| 234 | +[`--allow-fs-read`][], to grant exactly what the application needs. |
| 235 | + |
229 | 236 | The valid arguments for both flags are: |
230 | 237 |
|
231 | 238 | * `*` - To allow all `FileSystemRead` or `FileSystemWrite` operations, |
|
Collapse file
Copy file name to clipboardExpand all lines: doc/node.1 +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -150,8 +150,10 @@ Multiple paths can be allowed using multiple \fB--allow-fs-read\fR flags. |
150 | 150 | Example \fB--allow-fs-read=/folder1/ --allow-fs-read=/folder2/\fR |
151 | 151 | .El |
152 | 152 | Examples can be found in the File System Permissions documentation. |
153 | | -The initializer module and custom \fB--require\fR modules has a implicit |
154 | | -read permission. |
| 153 | +The initializer module and custom \fB--require\fR modules have an implicit |
| 154 | +read permission. The entrypoint is granted as passed on the command line, |
| 155 | +without the module loader's resolution; see the File System Permissions |
| 156 | +documentation for details. |
155 | 157 | .Bd -literal |
156 | 158 | $ node --permission -r custom-require.js -r custom-require-2.js index.js |
157 | 159 | .Ed |
|