Skip to content

Commit 9a7ae9b

Browse files
RafaelGSStargos
authored andcommitted
lib,src: remove --experimental-policy
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: #52583 Refs: #52575 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent aea6ca2 commit 9a7ae9b

File tree

90 files changed

+116
-5720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+116
-5720
lines changed

benchmark/policy/policy-startup.js

-51
This file was deleted.

doc/api/cli.md

-25
Original file line numberDiff line numberDiff line change
@@ -879,16 +879,6 @@ following permissions are restricted:
879879
* Child Process - manageable through [`--allow-child-process`][] flag
880880
* Worker Threads - manageable through [`--allow-worker`][] flag
881881

882-
### `--experimental-policy`
883-
884-
<!-- YAML
885-
added: v11.8.0
886-
-->
887-
888-
> Stability: 0 - Deprecated: Will be removed shortly.
889-
890-
Use the specified file as a security policy.
891-
892882
### `--experimental-require-module`
893883

894884
<!-- YAML
@@ -1528,18 +1518,6 @@ unless either the `--pending-deprecation` command-line flag, or the
15281518
are used to provide a kind of selective "early warning" mechanism that
15291519
developers may leverage to detect deprecated API usage.
15301520

1531-
### `--policy-integrity=sri`
1532-
1533-
<!-- YAML
1534-
added: v12.7.0
1535-
-->
1536-
1537-
> Stability: 0 - Deprecated: Will be removed shortly.
1538-
1539-
Instructs Node.js to error prior to running any code if the policy does not have
1540-
the specified integrity. It expects a [Subresource Integrity][] string as a
1541-
parameter.
1542-
15431521
### `--preserve-symlinks`
15441522

15451523
<!-- YAML
@@ -2669,7 +2647,6 @@ one is included in the list below.
26692647
* `--experimental-modules`
26702648
* `--experimental-network-imports`
26712649
* `--experimental-permission`
2672-
* `--experimental-policy`
26732650
* `--experimental-print-required-tla`
26742651
* `--experimental-require-module`
26752652
* `--experimental-shadow-realm`
@@ -2714,7 +2691,6 @@ one is included in the list below.
27142691
* `--openssl-legacy-provider`
27152692
* `--openssl-shared-config`
27162693
* `--pending-deprecation`
2717-
* `--policy-integrity`
27182694
* `--preserve-symlinks-main`
27192695
* `--preserve-symlinks`
27202696
* `--prof-process`
@@ -3189,7 +3165,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
31893165
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
31903166
[ShadowRealm]: https://github.com/tc39/proposal-shadowrealm
31913167
[Source Map]: https://sourcemaps.info/spec.html
3192-
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
31933168
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
31943169
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs
31953170
[Web Crypto API]: webcrypto.md

doc/api/deprecations.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ Type: Documentation-only (supports [`--pending-deprecation`][])
23062306
`process.binding()` is for use by Node.js internal code only.
23072307

23082308
While `process.binding()` has not reached End-of-Life status in general, it is
2309-
unavailable when [policies][] or the [permission model][] are enabled.
2309+
unavailable when the [permission model][] is enabled.
23102310

23112311
### DEP0112: `dgram` private APIs
23122312

@@ -3796,7 +3796,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][].
37963796
[legacy URL API]: url.md#legacy-url-api
37973797
[legacy `urlObject`]: url.md#legacy-urlobject
37983798
[permission model]: permissions.md#permission-model
3799-
[policies]: permissions.md#policies
38003799
[static methods of `crypto.Certificate()`]: crypto.md#class-certificate
38013800
[subpath exports]: packages.md#subpath-exports
38023801
[subpath imports]: packages.md#subpath-imports

doc/api/errors.md

+94-63
Original file line numberDiff line numberDiff line change
@@ -2166,68 +2166,6 @@ added:
21662166
An ESM loader hook returned without calling `next()` and without explicitly
21672167
signaling a short circuit.
21682168

2169-
<a id="ERR_MANIFEST_ASSERT_INTEGRITY"></a>
2170-
2171-
### `ERR_MANIFEST_ASSERT_INTEGRITY`
2172-
2173-
An attempt was made to load a resource, but the resource did not match the
2174-
integrity defined by the policy manifest. See the documentation for [policy][]
2175-
manifests for more information.
2176-
2177-
<a id="ERR_MANIFEST_DEPENDENCY_MISSING"></a>
2178-
2179-
### `ERR_MANIFEST_DEPENDENCY_MISSING`
2180-
2181-
An attempt was made to load a resource, but the resource was not listed as a
2182-
dependency from the location that attempted to load it. See the documentation
2183-
for [policy][] manifests for more information.
2184-
2185-
<a id="ERR_MANIFEST_INTEGRITY_MISMATCH"></a>
2186-
2187-
### `ERR_MANIFEST_INTEGRITY_MISMATCH`
2188-
2189-
An attempt was made to load a policy manifest, but the manifest had multiple
2190-
entries for a resource which did not match each other. Update the manifest
2191-
entries to match in order to resolve this error. See the documentation for
2192-
[policy][] manifests for more information.
2193-
2194-
<a id="ERR_MANIFEST_INVALID_RESOURCE_FIELD"></a>
2195-
2196-
### `ERR_MANIFEST_INVALID_RESOURCE_FIELD`
2197-
2198-
A policy manifest resource had an invalid value for one of its fields. Update
2199-
the manifest entry to match in order to resolve this error. See the
2200-
documentation for [policy][] manifests for more information.
2201-
2202-
<a id="ERR_MANIFEST_INVALID_SPECIFIER"></a>
2203-
2204-
### `ERR_MANIFEST_INVALID_SPECIFIER`
2205-
2206-
A policy manifest resource had an invalid value for one of its dependency
2207-
mappings. Update the manifest entry to match to resolve this error. See the
2208-
documentation for [policy][] manifests for more information.
2209-
2210-
<a id="ERR_MANIFEST_PARSE_POLICY"></a>
2211-
2212-
### `ERR_MANIFEST_PARSE_POLICY`
2213-
2214-
An attempt was made to load a policy manifest, but the manifest was unable to
2215-
be parsed. See the documentation for [policy][] manifests for more information.
2216-
2217-
<a id="ERR_MANIFEST_TDZ"></a>
2218-
2219-
### `ERR_MANIFEST_TDZ`
2220-
2221-
An attempt was made to read from a policy manifest, but the manifest
2222-
initialization has not yet taken place. This is likely a bug in Node.js.
2223-
2224-
<a id="ERR_MANIFEST_UNKNOWN_ONERROR"></a>
2225-
2226-
### `ERR_MANIFEST_UNKNOWN_ONERROR`
2227-
2228-
A policy manifest was loaded, but had an unknown value for its "onerror"
2229-
behavior. See the documentation for [policy][] manifests for more information.
2230-
22312169
<a id="ERR_MEMORY_ALLOCATION_FAILED"></a>
22322170

22332171
### `ERR_MEMORY_ALLOCATION_FAILED`
@@ -3432,6 +3370,100 @@ removed: v21.1.0
34323370

34333371
An import attribute is not supported by this version of Node.js.
34343372

3373+
<a id="ERR_MANIFEST_ASSERT_INTEGRITY"></a>
3374+
3375+
### `ERR_MANIFEST_ASSERT_INTEGRITY`
3376+
3377+
<!-- YAML
3378+
removed: REPLACEME
3379+
-->
3380+
3381+
An attempt was made to load a resource, but the resource did not match the
3382+
integrity defined by the policy manifest. See the documentation for policy
3383+
manifests for more information.
3384+
3385+
<a id="ERR_MANIFEST_DEPENDENCY_MISSING"></a>
3386+
3387+
### `ERR_MANIFEST_DEPENDENCY_MISSING`
3388+
3389+
<!-- YAML
3390+
removed: REPLACEME
3391+
-->
3392+
3393+
An attempt was made to load a resource, but the resource was not listed as a
3394+
dependency from the location that attempted to load it. See the documentation
3395+
for policy manifests for more information.
3396+
3397+
<a id="ERR_MANIFEST_INTEGRITY_MISMATCH"></a>
3398+
3399+
### `ERR_MANIFEST_INTEGRITY_MISMATCH`
3400+
3401+
<!-- YAML
3402+
removed: REPLACEME
3403+
-->
3404+
3405+
An attempt was made to load a policy manifest, but the manifest had multiple
3406+
entries for a resource which did not match each other. Update the manifest
3407+
entries to match in order to resolve this error. See the documentation for
3408+
policy manifests for more information.
3409+
3410+
<a id="ERR_MANIFEST_INVALID_RESOURCE_FIELD"></a>
3411+
3412+
### `ERR_MANIFEST_INVALID_RESOURCE_FIELD`
3413+
3414+
<!-- YAML
3415+
removed: REPLACEME
3416+
-->
3417+
3418+
A policy manifest resource had an invalid value for one of its fields. Update
3419+
the manifest entry to match in order to resolve this error. See the
3420+
documentation for policy manifests for more information.
3421+
3422+
<a id="ERR_MANIFEST_INVALID_SPECIFIER"></a>
3423+
3424+
### `ERR_MANIFEST_INVALID_SPECIFIER`
3425+
3426+
<!-- YAML
3427+
removed: REPLACEME
3428+
-->
3429+
3430+
A policy manifest resource had an invalid value for one of its dependency
3431+
mappings. Update the manifest entry to match to resolve this error. See the
3432+
documentation for policy manifests for more information.
3433+
3434+
<a id="ERR_MANIFEST_PARSE_POLICY"></a>
3435+
3436+
### `ERR_MANIFEST_PARSE_POLICY`
3437+
3438+
<!-- YAML
3439+
removed: REPLACEME
3440+
-->
3441+
3442+
An attempt was made to load a policy manifest, but the manifest was unable to
3443+
be parsed. See the documentation for policy manifests for more information.
3444+
3445+
<a id="ERR_MANIFEST_TDZ"></a>
3446+
3447+
### `ERR_MANIFEST_TDZ`
3448+
3449+
<!-- YAML
3450+
removed: REPLACEME
3451+
-->
3452+
3453+
An attempt was made to read from a policy manifest, but the manifest
3454+
initialization has not yet taken place. This is likely a bug in Node.js.
3455+
3456+
<a id="ERR_MANIFEST_UNKNOWN_ONERROR"></a>
3457+
3458+
### `ERR_MANIFEST_UNKNOWN_ONERROR`
3459+
3460+
<!-- YAML
3461+
removed: REPLACEME
3462+
-->
3463+
3464+
A policy manifest was loaded, but had an unknown value for its "onerror"
3465+
behavior. See the documentation for policy manifests for more information.
3466+
34353467
<a id="ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST"></a>
34363468

34373469
### `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`
@@ -4012,7 +4044,6 @@ An error occurred trying to allocate memory. This should never happen.
40124044
[domains]: domain.md
40134045
[event emitter-based]: events.md#class-eventemitter
40144046
[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor
4015-
[policy]: permissions.md#policies
40164047
[relative URL]: https://url.spec.whatwg.org/#relative-url-string
40174048
[self-reference a package using its name]: packages.md#self-referencing-a-package-using-its-name
40184049
[special scheme]: https://url.spec.whatwg.org/#special-scheme

doc/api/policy.md

-11
This file was deleted.

doc/node.1

-6
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ Enable experimental support for loading modules using `import` over `https:`.
174174
.It Fl -experimental-permission
175175
Enable the experimental permission model.
176176
.
177-
.It Fl -experimental-policy
178-
Use the specified file as a security policy.
179-
.
180177
.It Fl -experimental-shadow-realm
181178
Use this flag to enable ShadowRealm support.
182179
.
@@ -343,9 +340,6 @@ Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is
343340
.It Fl -pending-deprecation
344341
Emit pending deprecation warnings.
345342
.
346-
.It Fl -policy-integrity Ns = Ns Ar sri
347-
Instructs Node.js to error prior to running any code if the policy does not have the specified integrity. It expects a Subresource Integrity string as a parameter.
348-
.
349343
.It Fl -preserve-symlinks
350344
Instructs the module loader to preserve symbolic links when resolving and caching modules other than the main module.
351345
.

lib/internal/errors.js

-35
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
const {
1414
AggregateError,
15-
ArrayFrom,
1615
ArrayIsArray,
1716
ArrayPrototypeFilter,
1817
ArrayPrototypeIncludes,
@@ -1558,40 +1557,6 @@ E(
15581557
' `shortCircuit: true` in the hook\'s return.',
15591558
Error,
15601559
);
1561-
E('ERR_MANIFEST_ASSERT_INTEGRITY',
1562-
(moduleURL, realIntegrities) => {
1563-
let msg = `The content of "${
1564-
moduleURL
1565-
}" does not match the expected integrity.`;
1566-
if (realIntegrities.size) {
1567-
const sri = ArrayPrototypeJoin(
1568-
ArrayFrom(realIntegrities.entries(),
1569-
({ 0: alg, 1: dgs }) => `${alg}-${dgs}`),
1570-
' ',
1571-
);
1572-
msg += ` Integrities found are: ${sri}`;
1573-
} else {
1574-
msg += ' The resource was not found in the policy.';
1575-
}
1576-
return msg;
1577-
}, Error);
1578-
E('ERR_MANIFEST_DEPENDENCY_MISSING',
1579-
'Manifest resource %s does not list %s as a dependency specifier for ' +
1580-
'conditions: %s',
1581-
Error);
1582-
E('ERR_MANIFEST_INTEGRITY_MISMATCH',
1583-
'Manifest resource %s has multiple entries but integrity lists do not match',
1584-
SyntaxError);
1585-
E('ERR_MANIFEST_INVALID_RESOURCE_FIELD',
1586-
'Manifest resource %s has invalid property value for %s',
1587-
TypeError);
1588-
E('ERR_MANIFEST_INVALID_SPECIFIER',
1589-
'Manifest resource %s has invalid dependency mapping %s',
1590-
TypeError);
1591-
E('ERR_MANIFEST_TDZ', 'Manifest initialization has not yet run', Error);
1592-
E('ERR_MANIFEST_UNKNOWN_ONERROR',
1593-
'Manifest specified unknown error behavior "%s".',
1594-
SyntaxError);
15951560
E('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error);
15961561
E('ERR_MISSING_ARGS',
15971562
(...args) => {

0 commit comments

Comments
 (0)