Skip to content

Commit b958ef3

Browse files
committed
doc: rename policy references
1 parent 311a003 commit b958ef3

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

doc/api/errors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3577,7 +3577,7 @@ The native call from `process.cpuUsage` could not be processed.
35773577
[domains]: domain.md
35783578
[event emitter-based]: events.md#class-eventemitter
35793579
[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor
3580-
[policy]: policy.md
3580+
[policy]: permissions.md#policies
35813581
[self-reference a package using its name]: packages.md#self-referencing-a-package-using-its-name
35823582
[stream-based]: stream.md
35833583
[syscall]: https://man7.org/linux/man-pages/man2/syscalls.2.html

doc/api/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
* [OS](os.md)
4646
* [Path](path.md)
4747
* [Performance hooks](perf_hooks.md)
48-
* [Policies](policy.md)
48+
* [Permissions](permissions.md)
49+
* [Policy](policy.md) - Deprecated
4950
* [Process](process.md)
5051
* [Punycode](punycode.md)
5152
* [Query strings](querystring.md)

doc/api/permissions.md

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
# Permissions
22

3-
This section exposes security features available to be adopted in a
4-
Node.js application. The available scopes are:
3+
Permissions can be used to control what system resources the
4+
Node.js process has access to or what actions the process can take
5+
with those resources. Permissions can also control what modules can
6+
be accessed by other modules.
7+
8+
* [Process-based permissions](#process-based-permissions) control the Node.js
9+
process's access to resources such as the file system or the network.
10+
The resource can be entirely allowed or denied, or actions related to it can
11+
be controlled; for example, you can allow file system reads while denying
12+
writes.
13+
14+
* [Module-based permissions](#module-based-permissions) control which files
15+
or URLs are available to other modules during application execution.
16+
This can be used to control what modules can be accessed by third-party
17+
dependencies, for example.
18+
19+
Both types of permissions can be used together to provide a
20+
safer environment. If you find a potential security vulnerability,
21+
please refer to our [Security Policy][].
522

6-
* [Resource-based permissions](#resource-based-permissions)
7-
* [Process-based permissions](#process-based-permissions)
8-
9-
Resource-based permissions stands for the managment of modules using
10-
policies. A policy can guarantee which module/resource is available
11-
during the application execution.
12-
13-
Process-based permissions stands for the management of resources such
14-
as _File System_ or _Network_. A permission can be configured to restrict
15-
access to specific resources, for instance, one can restrict access to
16-
all the _File System_ write.
17-
18-
Both permissions can be used together to provide a safer environment.
23+
## Process-based permissions
1924

20-
**Note**: if you find a potential security vulnerability on Node.js,
21-
refer to our [Security Policy][].
25+
// STUB
2226

23-
## Resource-based permissions
27+
## Module-based permissions
2428

2529
## Policies
2630

@@ -447,9 +451,7 @@ not adopt the origin of the `blob:` URL.
447451
Additionally, import maps only work on `import` so it may be desirable to add a
448452
`"import"` condition to all dependency mappings.
449453

450-
## Process-based permissions
451-
454+
[Security Policy]: https://github.com/nodejs/node/blob/main/SECURITY.md
452455
[import maps]: https://url.spec.whatwg.org/#relative-url-with-fragment-string
453456
[relative-url string]: https://url.spec.whatwg.org/#relative-url-with-fragment-string
454457
[special schemes]: https://url.spec.whatwg.org/#special-scheme
455-
[Security Policy]: https://github.com/nodejs/node/blob/main/SECURITY.md

doc/api/policy.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Policies
2+
3+
<!--introduced_in=v11.8.0-->
4+
5+
<!-- type=misc -->
6+
7+
> Stability: 1 - Experimental
8+
9+
**This document locallity has changed**. Please, use the [Permissions][]
10+
document as reference.
11+
12+
[Permissions]: permissions.md

0 commit comments

Comments
 (0)