Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.16.137.217
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
nodejs-docs-14.18.3 /
html /
api /
Delete
Unzip
Name
Size
Permission
Date
Action
assets
[ DIR ]
drwxr-xr-x
2022-01-26 16:43
addons.html
97.08
KB
-rw-r--r--
2022-01-10 13:06
addons.json
48.6
KB
-rw-r--r--
2022-01-10 13:06
addons.md
39.44
KB
-rw-r--r--
2022-01-10 13:06
all.html
5.06
MB
-rw-r--r--
2022-01-10 13:06
all.json
4.78
MB
-rw-r--r--
2022-01-10 13:06
assert.html
118.84
KB
-rw-r--r--
2022-01-10 13:06
assert.json
83.37
KB
-rw-r--r--
2022-01-10 13:06
assert.md
47.93
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.html
94.53
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.json
64.9
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.md
38.62
KB
-rw-r--r--
2022-01-10 13:06
buffer.html
289.36
KB
-rw-r--r--
2022-01-10 13:06
buffer.json
227.52
KB
-rw-r--r--
2022-01-10 13:06
buffer.md
109.83
KB
-rw-r--r--
2022-01-10 13:06
child_process.html
156.96
KB
-rw-r--r--
2022-01-10 13:06
child_process.json
140.03
KB
-rw-r--r--
2022-01-10 13:06
child_process.md
69.69
KB
-rw-r--r--
2022-01-10 13:06
cli.html
99.52
KB
-rw-r--r--
2022-01-10 13:06
cli.json
97.49
KB
-rw-r--r--
2022-01-10 13:06
cli.md
47.37
KB
-rw-r--r--
2022-01-10 13:06
cluster.html
65.92
KB
-rw-r--r--
2022-01-10 13:06
cluster.json
45.84
KB
-rw-r--r--
2022-01-10 13:06
cluster.md
24.83
KB
-rw-r--r--
2022-01-10 13:06
console.html
50.57
KB
-rw-r--r--
2022-01-10 13:06
console.json
40.04
KB
-rw-r--r--
2022-01-10 13:06
console.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
crypto.html
297.2
KB
-rw-r--r--
2022-01-10 13:06
crypto.json
261.36
KB
-rw-r--r--
2022-01-10 13:06
crypto.md
124.37
KB
-rw-r--r--
2022-01-10 13:06
debugger.html
21.62
KB
-rw-r--r--
2022-01-10 13:06
debugger.json
9.75
KB
-rw-r--r--
2022-01-10 13:06
debugger.md
6.43
KB
-rw-r--r--
2022-01-10 13:06
deprecations.html
142.64
KB
-rw-r--r--
2022-01-10 13:06
deprecations.json
164.68
KB
-rw-r--r--
2022-01-10 13:06
deprecations.md
81.32
KB
-rw-r--r--
2022-01-10 13:06
dgram.html
67.09
KB
-rw-r--r--
2022-01-10 13:06
dgram.json
57.33
KB
-rw-r--r--
2022-01-10 13:06
dgram.md
27.81
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.html
21.13
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.json
10.8
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.md
5.24
KB
-rw-r--r--
2022-01-10 13:06
dns.html
109.72
KB
-rw-r--r--
2022-01-10 13:06
dns.json
98.84
KB
-rw-r--r--
2022-01-10 13:06
dns.md
44.29
KB
-rw-r--r--
2022-01-10 13:06
documentation.html
18.4
KB
-rw-r--r--
2022-01-10 13:06
documentation.json
8.83
KB
-rw-r--r--
2022-01-10 13:06
documentation.md
4.05
KB
-rw-r--r--
2022-01-10 13:06
domain.html
41.38
KB
-rw-r--r--
2022-01-10 13:06
domain.json
22.06
KB
-rw-r--r--
2022-01-10 13:06
domain.md
15.2
KB
-rw-r--r--
2022-01-10 13:06
embedding.html
24.65
KB
-rw-r--r--
2022-01-10 13:06
embedding.json
10.05
KB
-rw-r--r--
2022-01-10 13:06
embedding.md
8.67
KB
-rw-r--r--
2022-01-10 13:06
errors.html
189.1
KB
-rw-r--r--
2022-01-10 13:06
errors.json
194.73
KB
-rw-r--r--
2022-01-10 13:06
errors.md
82.71
KB
-rw-r--r--
2022-01-10 13:06
esm.html
97.97
KB
-rw-r--r--
2022-01-10 13:06
esm.json
78.48
KB
-rw-r--r--
2022-01-10 13:06
esm.md
48.2
KB
-rw-r--r--
2022-01-10 13:06
events.html
129.56
KB
-rw-r--r--
2022-01-10 13:06
events.json
94.12
KB
-rw-r--r--
2022-01-10 13:06
events.md
43.71
KB
-rw-r--r--
2022-01-10 13:06
fs.html
503.09
KB
-rw-r--r--
2022-01-10 13:06
fs.json
500.22
KB
-rw-r--r--
2022-01-10 13:06
fs.md
210.32
KB
-rw-r--r--
2022-01-10 13:06
globals.html
29.55
KB
-rw-r--r--
2022-01-10 13:06
globals.json
31.16
KB
-rw-r--r--
2022-01-10 13:06
globals.md
8.21
KB
-rw-r--r--
2022-01-10 13:06
http.html
213.14
KB
-rw-r--r--
2022-01-10 13:06
http.json
214.96
KB
-rw-r--r--
2022-01-10 13:06
http.md
91.28
KB
-rw-r--r--
2022-01-10 13:06
http2.html
274.7
KB
-rw-r--r--
2022-01-10 13:06
http2.json
274.23
KB
-rw-r--r--
2022-01-10 13:06
http2.md
123.62
KB
-rw-r--r--
2022-01-10 13:06
https.html
44.54
KB
-rw-r--r--
2022-01-10 13:06
https.json
36.55
KB
-rw-r--r--
2022-01-10 13:06
https.md
14.58
KB
-rw-r--r--
2022-01-10 13:06
index.html
12.21
KB
-rw-r--r--
2022-01-10 13:06
index.json
54
B
-rw-r--r--
2022-01-10 13:06
index.md
1.73
KB
-rw-r--r--
2022-01-10 13:06
inspector.html
25.57
KB
-rw-r--r--
2022-01-10 13:06
inspector.json
13.43
KB
-rw-r--r--
2022-01-10 13:06
inspector.md
6.66
KB
-rw-r--r--
2022-01-10 13:06
intl.html
25.1
KB
-rw-r--r--
2022-01-10 13:06
intl.json
14.5
KB
-rw-r--r--
2022-01-10 13:06
intl.md
10.46
KB
-rw-r--r--
2022-01-10 13:06
module.html
23.9
KB
-rw-r--r--
2022-01-10 13:06
module.json
13.29
KB
-rw-r--r--
2022-01-10 13:06
module.md
5.2
KB
-rw-r--r--
2022-01-10 13:06
modules.html
67.19
KB
-rw-r--r--
2022-01-10 13:06
modules.json
48.92
KB
-rw-r--r--
2022-01-10 13:06
modules.md
30.83
KB
-rw-r--r--
2022-01-10 13:06
n-api.html
336.63
KB
-rw-r--r--
2022-01-10 13:06
n-api.json
330.37
KB
-rw-r--r--
2022-01-10 13:06
n-api.md
206.51
KB
-rw-r--r--
2022-01-10 13:06
net.html
111.64
KB
-rw-r--r--
2022-01-10 13:06
net.json
108.87
KB
-rw-r--r--
2022-01-10 13:06
net.md
44.19
KB
-rw-r--r--
2022-01-10 13:06
os.html
60.56
KB
-rw-r--r--
2022-01-10 13:06
os.json
50.72
KB
-rw-r--r--
2022-01-10 13:06
os.md
33.98
KB
-rw-r--r--
2022-01-10 13:06
packages.html
80.39
KB
-rw-r--r--
2022-01-10 13:06
packages.json
59.35
KB
-rw-r--r--
2022-01-10 13:06
packages.md
39.1
KB
-rw-r--r--
2022-01-10 13:06
path.html
43.66
KB
-rw-r--r--
2022-01-10 13:06
path.json
27.96
KB
-rw-r--r--
2022-01-10 13:06
path.md
14.46
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.html
71.71
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.json
49.24
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.md
23.17
KB
-rw-r--r--
2022-01-10 13:06
policy.html
35.98
KB
-rw-r--r--
2022-01-10 13:06
policy.json
18.38
KB
-rw-r--r--
2022-01-10 13:06
policy.md
13.9
KB
-rw-r--r--
2022-01-10 13:06
process.html
192.69
KB
-rw-r--r--
2022-01-10 13:06
process.json
150.9
KB
-rw-r--r--
2022-01-10 13:06
process.md
86.44
KB
-rw-r--r--
2022-01-10 13:06
punycode.html
19.88
KB
-rw-r--r--
2022-01-10 13:06
punycode.json
8.79
KB
-rw-r--r--
2022-01-10 13:06
punycode.md
4.17
KB
-rw-r--r--
2022-01-10 13:06
querystring.html
22.01
KB
-rw-r--r--
2022-01-10 13:06
querystring.json
12.74
KB
-rw-r--r--
2022-01-10 13:06
querystring.md
5.48
KB
-rw-r--r--
2022-01-10 13:06
readline.html
69.79
KB
-rw-r--r--
2022-01-10 13:06
readline.json
55.74
KB
-rw-r--r--
2022-01-10 13:06
readline.md
28.04
KB
-rw-r--r--
2022-01-10 13:06
repl.html
58.19
KB
-rw-r--r--
2022-01-10 13:06
repl.json
44.5
KB
-rw-r--r--
2022-01-10 13:06
repl.md
23.61
KB
-rw-r--r--
2022-01-10 13:06
report.html
71.4
KB
-rw-r--r--
2022-01-10 13:06
report.json
21.23
KB
-rw-r--r--
2022-01-10 13:06
report.md
17.92
KB
-rw-r--r--
2022-01-10 13:06
stream.html
226.43
KB
-rw-r--r--
2022-01-10 13:06
stream.json
223.31
KB
-rw-r--r--
2022-01-10 13:06
stream.md
100.94
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.html
17.5
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.json
5.8
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.md
2.94
KB
-rw-r--r--
2022-01-10 13:06
synopsis.html
13.93
KB
-rw-r--r--
2022-01-10 13:06
synopsis.json
2.97
KB
-rw-r--r--
2022-01-10 13:06
synopsis.md
2.13
KB
-rw-r--r--
2022-01-10 13:06
timers.html
32.99
KB
-rw-r--r--
2022-01-10 13:06
timers.json
23.92
KB
-rw-r--r--
2022-01-10 13:06
timers.md
10.55
KB
-rw-r--r--
2022-01-10 13:06
tls.html
152.2
KB
-rw-r--r--
2022-01-10 13:06
tls.json
161.77
KB
-rw-r--r--
2022-01-10 13:06
tls.md
81.06
KB
-rw-r--r--
2022-01-10 13:06
tracing.html
22.43
KB
-rw-r--r--
2022-01-10 13:06
tracing.json
12.14
KB
-rw-r--r--
2022-01-10 13:06
tracing.md
6.59
KB
-rw-r--r--
2022-01-10 13:06
tty.html
29.16
KB
-rw-r--r--
2022-01-10 13:06
tty.json
22.31
KB
-rw-r--r--
2022-01-10 13:06
tty.md
8.78
KB
-rw-r--r--
2022-01-10 13:06
url.html
122.38
KB
-rw-r--r--
2022-01-10 13:06
url.json
88.21
KB
-rw-r--r--
2022-01-10 13:06
url.md
49.32
KB
-rw-r--r--
2022-01-10 13:06
util.html
199.52
KB
-rw-r--r--
2022-01-10 13:06
util.json
171.18
KB
-rw-r--r--
2022-01-10 13:06
util.md
71.47
KB
-rw-r--r--
2022-01-10 13:06
v8.html
51.61
KB
-rw-r--r--
2022-01-10 13:06
v8.json
39.5
KB
-rw-r--r--
2022-01-10 13:06
v8.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
vm.html
123.51
KB
-rw-r--r--
2022-01-10 13:06
vm.json
113.19
KB
-rw-r--r--
2022-01-10 13:06
vm.md
55.37
KB
-rw-r--r--
2022-01-10 13:06
wasi.html
21.16
KB
-rw-r--r--
2022-01-10 13:06
wasi.json
11.72
KB
-rw-r--r--
2022-01-10 13:06
wasi.md
6.27
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.html
90.29
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.json
69.84
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.md
39
KB
-rw-r--r--
2022-01-10 13:06
zlib.html
95.09
KB
-rw-r--r--
2022-01-10 13:06
zlib.json
100.2
KB
-rw-r--r--
2022-01-10 13:06
zlib.md
35.03
KB
-rw-r--r--
2022-01-10 13:06
Save
Rename
{ "type": "module", "source": "doc/api/policy.md", "introduced_in": "v11.8.0", "stability": 1, "stabilityText": "Experimental", "miscs": [ { "textRaw": "Policies", "name": "policy", "introduced_in": "v11.8.0", "type": "misc", "stability": 1, "stabilityText": "Experimental", "desc": "<p>Node.js contains experimental support for creating policies on loading code.</p>\n<p>Policies are a security feature intended to allow guarantees\nabout what code Node.js is able to load. The use of policies assumes\nsafe practices for the policy files such as ensuring that policy\nfiles cannot be overwritten by the Node.js application by using\nfile permissions.</p>\n<p>A best practice would be to ensure that the policy manifest is read-only for\nthe running Node.js application and that the file cannot be changed\nby the running Node.js application in any way. A typical setup would be to\ncreate the policy file as a different user id than the one running Node.js\nand granting read permissions to the user id running Node.js.</p>", "miscs": [ { "textRaw": "Enabling", "name": "Enabling", "type": "misc", "desc": "<p>The <code>--experimental-policy</code> flag can be used to enable features for policies\nwhen loading modules.</p>\n<p>Once this has been set, all modules must conform to a policy manifest file\npassed to the flag:</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json app.js\n</code></pre>\n<p>The policy manifest will be used to enforce constraints on code loaded by\nNode.js.</p>\n<p>To mitigate tampering with policy files on disk, an integrity for\nthe policy file itself may be provided via <code>--policy-integrity</code>.\nThis allows running <code>node</code> and asserting the policy file contents\neven if the file is changed on disk.</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json --policy-integrity=\"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\" app.js\n</code></pre>" }, { "textRaw": "Features", "name": "features", "modules": [ { "textRaw": "Error behavior", "name": "error_behavior", "desc": "<p>When a policy check fails, Node.js by default will throw an error.\nIt is possible to change the error behavior to one of a few possibilities\nby defining an \"onerror\" field in a policy manifest. The following values are\navailable to change the behavior:</p>\n<ul>\n<li><code>\"exit\"</code>: will exit the process immediately.\nNo cleanup code will be allowed to run.</li>\n<li><code>\"log\"</code>: will log the error at the site of the failure.</li>\n<li><code>\"throw\"</code>: will throw a JS error at the site of the failure. This is the\ndefault.</li>\n</ul>\n<pre><code class=\"language-json\">{\n \"onerror\": \"log\",\n \"resources\": {\n \"./app/checked.js\": {\n \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n }\n }\n}\n</code></pre>", "type": "module", "displayName": "Error behavior" }, { "textRaw": "Integrity checks", "name": "integrity_checks", "desc": "<p>Policy files must use integrity checks with Subresource Integrity strings\ncompatible with the browser\n<a href=\"https://www.w3.org/TR/SRI/#the-integrity-attribute\">integrity attribute</a>\nassociated with absolute URLs.</p>\n<p>When using <code>require()</code> or <code>import</code> all resources involved in loading are checked\nfor integrity if a policy manifest has been specified. If a resource does not\nmatch the integrity listed in the manifest, an error will be thrown.</p>\n<p>An example policy file that would allow loading a file <code>checked.js</code>:</p>\n<pre><code class=\"language-json\">{\n \"resources\": {\n \"./app/checked.js\": {\n \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n }\n }\n}\n</code></pre>\n<p>Each resource listed in the policy manifest can be of one the following\nformats to determine its location:</p>\n<ol>\n<li>A <a href=\"https://url.spec.whatwg.org/#relative-url-with-fragment-string\">relative-URL string</a> to a resource from the manifest such as <code>./resource.js</code>, <code>../resource.js</code>, or <code>/resource.js</code>.</li>\n<li>A complete URL string to a resource such as <code>file:///resource.js</code>.</li>\n</ol>\n<p>When loading resources the entire URL must match including search parameters\nand hash fragment. <code>./a.js?b</code> will not be used when attempting to load\n<code>./a.js</code> and vice versa.</p>\n<p>To generate integrity strings, a script such as\n<code>node -e 'process.stdout.write(\"sha256-\");process.stdin.pipe(crypto.createHash(\"sha256\").setEncoding(\"base64\")).pipe(process.stdout)' < FILE</code>\ncan be used.</p>\n<p>Integrity can be specified as the boolean value <code>true</code> to accept any\nbody for the resource which can be useful for local development. It is not\nrecommended in production since it would allow unexpected alteration of\nresources to be considered valid.</p>", "type": "module", "displayName": "Integrity checks" }, { "textRaw": "Dependency redirection", "name": "dependency_redirection", "desc": "<p>An application may need to ship patched versions of modules or to prevent\nmodules from allowing all modules access to all other modules. Redirection\ncan be used by intercepting attempts to load the modules wishing to be\nreplaced.</p>\n<pre><code class=\"language-json\">{\n \"resources\": {\n \"./app/checked.js\": {\n \"dependencies\": {\n \"fs\": true,\n \"os\": \"./app/node_modules/alt-os\",\n \"http\": { \"import\": true }\n }\n }\n }\n}\n</code></pre>\n<p>The dependencies are keyed by the requested specifier string and have values\nof either <code>true</code>, <code>null</code>, a string pointing to a module to be resolved,\nor a conditions object.</p>\n<p>The specifier string does not perform any searching and must match exactly what\nis provided to the <code>require()</code> or <code>import</code> except for a canonicalization step.\nTherefore, multiple specifiers may be needed in the policy if it uses multiple\ndifferent strings to point to the same module (such as excluding the extension).</p>\n<p>Specifier strings are canonicalized but not resolved prior to be used for\nmatching in order to have some compatibility with import maps, for example if a\nresource <code>file:///C:/app/server.js</code> was given the following redirection from a\npolicy located at <code>file:///C:/app/policy.json</code>:</p>\n<pre><code class=\"language-json\">{\n \"resources\": {\n \"file:///C:/app/utils.js\": {\n \"dependencies\": {\n \"./utils.js\": \"./utils-v2.js\"\n }\n }\n }\n}\n</code></pre>\n<p>Any specifier used to load <code>file:///C:/app/utils.js</code> would then be intercepted\nand redirected to <code>file:///C:/app/utils-v2.js</code> instead regardless of using an\nabsolute or relative specifier. However, if a specifier that is not an absolute\nor relative URL string is used, it would not be intercepted. So, if an import\nsuch as <code>import('#utils')</code> was used, it would not be intercepted.</p>\n<p>If the value of the redirection is <code>true</code>, a \"dependencies\" field at the top of\nthe policy file will be used. If that field at the top of the policy file is\n<code>true</code> the default node searching algorithms are used to find the module.</p>\n<p>If the value of the redirection is a string, it is resolved relative to\nthe manifest and then immediately used without searching.</p>\n<p>Any specifier string for which resolution is attempted and that is not listed in\nthe dependencies results in an error according to the policy.</p>\n<p>Redirection does not prevent access to APIs through means such as direct access\nto <code>require.cache</code> or through <code>module.constructor</code> which allow access to\nloading modules. Policy redirection only affects specifiers to <code>require()</code> and\n<code>import</code>. Other means, such as to prevent undesired access to APIs through\nvariables, are necessary to lock down that path of loading modules.</p>\n<p>A boolean value of <code>true</code> for the dependencies map can be specified to allow a\nmodule to load any specifier without redirection. This can be useful for local\ndevelopment and may have some valid usage in production, but should be used\nonly with care after auditing a module to ensure its behavior is valid.</p>\n<p>Similar to <code>\"exports\"</code> in <code>package.json</code>, dependencies can also be specified to\nbe objects containing conditions which branch how dependencies are loaded. In\nthe preceding example, <code>\"http\"</code> is allowed when the <code>\"import\"</code> condition is\npart of loading it.</p>\n<p>A value of <code>null</code> for the resolved value causes the resolution to fail. This\ncan be used to ensure some kinds of dynamic access are explicitly prevented.</p>\n<p>Unknown values for the resolved module location cause failures but are\nnot guaranteed to be forward compatible.</p>\n<h4>Example: Patched dependency</h4>\n<p>Redirected dependencies can provide attenuated or modified functionality as fits\nthe application. For example, log data about timing of function durations by\nwrapping the original:</p>\n<pre><code class=\"language-js\">const original = require('fn');\nmodule.exports = function fn(...args) {\n console.time();\n try {\n return new.target ?\n Reflect.construct(original, args) :\n Reflect.apply(original, this, args);\n } finally {\n console.timeEnd();\n }\n};\n</code></pre>", "type": "module", "displayName": "Dependency redirection" }, { "textRaw": "Scopes", "name": "scopes", "desc": "<p>Use the <code>\"scopes\"</code> field of a manifest to set configuration for many resources\nat once. The <code>\"scopes\"</code> field works by matching resources by their segments.\nIf a scope or resource includes <code>\"cascade\": true</code>, unknown specifiers will\nbe searched for in their containing scope. The containing scope for cascading\nis found by recursively reducing the resource URL by removing segments for\n<a href=\"https://url.spec.whatwg.org/#special-scheme\">special schemes</a>, keeping trailing <code>\"/\"</code> suffixes, and removing the query and\nhash fragment. This leads to the eventual reduction of the URL to its origin.\nIf the URL is non-special the scope will be located by the URL's origin. If no\nscope is found for the origin or in the case of opaque origins, a protocol\nstring can be used as a scope. If no scope is found for the URL's protocol, a\nfinal empty string <code>\"\"</code> scope will be used.</p>\n<p>Note, <code>blob:</code> URLs adopt their origin from the path they contain, and so a scope\nof <code>\"blob:https://nodejs.org\"</code> will have no effect since no URL can have an\norigin of <code>blob:https://nodejs.org</code>; URLs starting with\n<code>blob:https://nodejs.org/</code> will use <code>https://nodejs.org</code> for its origin and\nthus <code>https:</code> for its protocol scope. For opaque origin <code>blob:</code> URLs they will\nhave <code>blob:</code> for their protocol scope since they do not adopt origins.</p>\n<h4>Example</h4>\n<pre><code class=\"language-json\">{\n \"scopes\": {\n \"file:///C:/app/\": {},\n \"file:\": {},\n \"\": {}\n }\n}\n</code></pre>\n<p>Given a file located at <code>file:///C:/app/bin/main.js</code>, the following scopes would\nbe checked in order:</p>\n<ol>\n<li><code>\"file:///C:/app/bin/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within\n<code>\"file:///C:/app/bin/\"</code>. This is not in the <code>\"scopes\"</code> field of the policy and\nwould be skipped. Adding this scope to the policy would cause it to be used\nprior to the <code>\"file:///C:/app/\"</code> scope.</p>\n<ol start=\"2\">\n<li><code>\"file:///C:/app/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within\n<code>\"file:///C:/app/\"</code>. This is in the <code>\"scopes\"</code> field of the policy and it would\ndetermine the policy for the resource at <code>file:///C:/app/bin/main.js</code>. If the\nscope has <code>\"cascade\": true</code>, any unsatisfied queries about the resource would\ndelegate to the next relevant scope for <code>file:///C:/app/bin/main.js</code>, <code>\"file:\"</code>.</p>\n<ol start=\"3\">\n<li><code>\"file:///C:/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within <code>\"file:///C:/\"</code>.\nThis is not in the <code>\"scopes\"</code> field of the policy and would be skipped. It would\nnot be used for <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///\"</code> is set to\ncascade or is not in the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"4\">\n<li><code>\"file:///\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources on the <code>localhost</code>. This\nis not in the <code>\"scopes\"</code> field of the policy and would be skipped. It would not\nbe used for <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///\"</code> is set to cascade\nor is not in the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"5\">\n<li><code>\"file:\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources. It would not be used\nfor <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///\"</code> is set to cascade or is not\nin the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"6\">\n<li><code>\"\"</code></li>\n</ol>\n<p>This determines the policy for all resources. It would not be used for\n<code>file:///C:/app/bin/main.js</code> unless <code>\"file:\"</code> is set to cascade.</p>", "modules": [ { "textRaw": "Integrity using scopes", "name": "integrity_using_scopes", "desc": "<p>Setting an integrity to <code>true</code> on a scope will set the integrity for any\nresource not found in the manifest to <code>true</code>.</p>\n<p>Setting an integrity to <code>null</code> on a scope will set the integrity for any\nresource not found in the manifest to fail matching.</p>\n<p>Not including an integrity is the same as setting the integrity to <code>null</code>.</p>\n<p><code>\"cascade\"</code> for integrity checks will be ignored if <code>\"integrity\"</code> is explicitly\nset.</p>\n<p>The following example allows loading any file:</p>\n<pre><code class=\"language-json\">{\n \"scopes\": {\n \"file:\": {\n \"integrity\": true\n }\n }\n}\n</code></pre>", "type": "module", "displayName": "Integrity using scopes" }, { "textRaw": "Dependency redirection using scopes", "name": "dependency_redirection_using_scopes", "desc": "<p>The following example, would allow access to <code>fs</code> for all resources within\n<code>./app/</code>:</p>\n<pre><code class=\"language-json\">{\n \"resources\": {\n \"./app/checked.js\": {\n \"cascade\": true,\n \"integrity\": true\n }\n },\n \"scopes\": {\n \"./app/\": {\n \"dependencies\": {\n \"fs\": true\n }\n }\n }\n}\n</code></pre>\n<p>The following example, would allow access to <code>fs</code> for all <code>data:</code> resources:</p>\n<pre><code class=\"language-json\">{\n \"resources\": {\n \"data:text/javascript,import('fs');\": {\n \"cascade\": true,\n \"integrity\": true\n }\n },\n \"scopes\": {\n \"data:\": {\n \"dependencies\": {\n \"fs\": true\n }\n }\n }\n}\n</code></pre>\n<h4>Example: <a href=\"https://url.spec.whatwg.org/#relative-url-with-fragment-string\">import maps</a> emulation</h4>\n<p>Given an import map:</p>\n<pre><code class=\"language-json\">{\n \"imports\": {\n \"react\": \"./app/node_modules/react/index.js\"\n },\n \"scopes\": {\n \"./ssr/\": {\n \"react\": \"./app/node_modules/server-side-react/index.js\"\n }\n }\n}\n</code></pre>\n<pre><code class=\"language-json\">{\n \"dependencies\": true,\n \"scopes\": {\n \"\": {\n \"cascade\": true,\n \"dependencies\": {\n \"react\": \"./app/node_modules/react/index.js\"\n }\n },\n \"./ssr/\": {\n \"cascade\": true,\n \"dependencies\": {\n \"react\": \"./app/node_modules/server-side-react/index.js\"\n }\n }\n }\n}\n</code></pre>\n<p>Import maps assume you can get any resource by default. This means\n<code>\"dependencies\"</code> at the top level of the policy should be set to <code>true</code>.\nPolicies require this to be opt-in since it enables all resources of the\napplication cross linkage which doesn't make sense for many scenarios. They also\nassume any given scope has access to any scope above its allowed dependencies;\nall scopes emulating import maps must set <code>\"cascade\": true</code>.</p>\n<p>Import maps only have a single top level scope for their \"imports\". So for\nemulating <code>\"imports\"</code> use the <code>\"\"</code> scope. For emulating <code>\"scopes\"</code> use the\n<code>\"scopes\"</code> in a similar manner to how <code>\"scopes\"</code> works in import maps.</p>\n<p>Caveats: Policies do not use string matching for various finding of scope. They\ndo URL traversals. This means things like <code>blob:</code> and <code>data:</code> URLs might not be\nentirely interoperable between the two systems. For example import maps can\npartially match a <code>data:</code> or <code>blob:</code> URL by partitioning the URL on a <code>/</code>\ncharacter, policies intentionally cannot. For <code>blob:</code> URLs import map scopes do\nnot adopt the origin of the <code>blob:</code> URL.</p>\n<p>Additionally, import maps only work on <code>import</code> so it may be desirable to add a\n<code>\"import\"</code> condition to all dependency mappings.</p>", "type": "module", "displayName": "Dependency redirection using scopes" } ], "type": "module", "displayName": "Scopes" } ], "type": "misc", "displayName": "Features" } ] } ] }