@netlify/plugin-csp-nonce 1.3.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/manifest.yml +9 -0
- package/package.json +1 -1
- package/src/__csp-nonce.ts +3 -3
package/manifest.yml
CHANGED
|
@@ -5,6 +5,9 @@ inputs:
|
|
|
5
5
|
default: true
|
|
6
6
|
- name: reportUri
|
|
7
7
|
description: The relative or absolute URL to report any violations. If not defined, violations are reported to the __csp-violations function, which this plugin deploys.
|
|
8
|
+
- name: strictDynamic
|
|
9
|
+
description: When true, dynamically trust scripts via nonce or hash instead of static allowlists, enhancing security.
|
|
10
|
+
default: true
|
|
8
11
|
- name: unsafeEval
|
|
9
12
|
description: When true, adds 'unsafe-eval' to CSP for easier adoption. Set to false to have a safer policy if your code and code dependencies does not use eval().
|
|
10
13
|
default: true
|
|
@@ -14,3 +17,9 @@ inputs:
|
|
|
14
17
|
- name: excludedPath
|
|
15
18
|
description: The glob expressions of path(s) that *should not* invoke the CSP nonce edge function. Must be an array of strings. This value gets spread with common non-html filetype extensions (*.css, *.js, *.svg, etc)
|
|
16
19
|
default: []
|
|
20
|
+
- name: unsafeInline
|
|
21
|
+
description: When true, allows the execution of inline scripts, such as those defined within <script> tags or through onclick attributes.
|
|
22
|
+
default: true
|
|
23
|
+
- name: self
|
|
24
|
+
description: When true, restricts the execution of scripts to those that originate from the same origin (protocol, domain, and port) as the document.
|
|
25
|
+
default: true
|
package/package.json
CHANGED
package/src/__csp-nonce.ts
CHANGED
|
@@ -24,9 +24,9 @@ params.reportUri = params.reportUri || "/.netlify/functions/__csp-violations";
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
params.distribution = Netlify.env.get("CSP_NONCE_DISTRIBUTION");
|
|
26
26
|
|
|
27
|
-
params.strictDynamic = true;
|
|
28
|
-
params.unsafeInline = true;
|
|
29
|
-
params.self = true;
|
|
27
|
+
params.strictDynamic = params.strictDynamic ?? true;
|
|
28
|
+
params.unsafeInline = params.unsafeInline ?? true;
|
|
29
|
+
params.self = params.self ?? true;
|
|
30
30
|
params.https = true;
|
|
31
31
|
params.http = true;
|
|
32
32
|
|