@trackunit/iris-app-api 1.15.4 → 1.15.7
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 1.15.7 (2026-03-19)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 1.15.6 (2026-03-19)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
9
|
+
## 1.15.5 (2026-03-18)
|
|
10
|
+
|
|
11
|
+
This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
|
|
12
|
+
|
|
1
13
|
## 1.15.4 (2026-03-18)
|
|
2
14
|
|
|
3
15
|
This was a version bump only for iris-app-api to align it with other projects, there were no code changes.
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = "allow-downloads-without-user-activation";
|
|
2
|
+
export declare const ALLOW_DOWNLOADS = "allow-downloads";
|
|
2
3
|
export declare const ALLOW_FORMS = "allow-forms";
|
|
3
4
|
export declare const ALLOW_MODALS = "allow-modals";
|
|
4
5
|
export declare const ALLOW_ORIENTATION_LOCK = "allow-orientation-lock";
|
|
@@ -22,9 +23,12 @@ export declare const SELF = "'self'";
|
|
|
22
23
|
export declare const STRICT_DYNAMIC = "'strict-dynamic'";
|
|
23
24
|
export declare const REPORT_SAMPLE = "'report-sample'";
|
|
24
25
|
export declare const UNSAFE_EVAL = "'unsafe-eval'";
|
|
25
|
-
declare const UNSAFE_HASHES = "'unsafe-hashes'";
|
|
26
|
+
export declare const UNSAFE_HASHES = "'unsafe-hashes'";
|
|
26
27
|
export declare const UNSAFE_INLINE = "'unsafe-inline'";
|
|
27
28
|
export declare const WASM_UNSAFE_EVAL = "'wasm-unsafe-eval'";
|
|
29
|
+
export declare const ALLOW = "'allow'";
|
|
30
|
+
export declare const BLOCK = "'block'";
|
|
31
|
+
export type TWebRTCDirective = typeof ALLOW | typeof BLOCK;
|
|
28
32
|
export type CSPDirectives = {
|
|
29
33
|
"child-src": Array<TFetchDirective>;
|
|
30
34
|
"connect-src": Array<TFetchDirective>;
|
|
@@ -33,7 +37,7 @@ export type CSPDirectives = {
|
|
|
33
37
|
"frame-src": Array<TFetchDirective>;
|
|
34
38
|
"img-src": Array<TFetchDirective | typeof STRICT_DYNAMIC>;
|
|
35
39
|
"media-src": Array<TFetchDirective>;
|
|
36
|
-
sandbox: Array<typeof ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION | typeof ALLOW_FORMS | typeof ALLOW_MODALS | typeof ALLOW_ORIENTATION_LOCK | typeof ALLOW_POINTER_LOCK | typeof ALLOW_POPUPS | typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX | typeof ALLOW_PRESENTATION | typeof ALLOW_SAME_ORIGIN | typeof ALLOW_SCRIPTS | typeof ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION | typeof ALLOW_TOP_NAVIGATION | typeof ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION>;
|
|
40
|
+
sandbox: Array<typeof ALLOW_DOWNLOADS | typeof ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION | typeof ALLOW_FORMS | typeof ALLOW_MODALS | typeof ALLOW_ORIENTATION_LOCK | typeof ALLOW_POINTER_LOCK | typeof ALLOW_POPUPS | typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX | typeof ALLOW_PRESENTATION | typeof ALLOW_SAME_ORIGIN | typeof ALLOW_SCRIPTS | typeof ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION | typeof ALLOW_TOP_NAVIGATION | typeof ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION>;
|
|
37
41
|
"script-src": Array<TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE | typeof WASM_UNSAFE_EVAL>;
|
|
38
42
|
"script-src-attr": Array<TAttrDirective | typeof REPORT_SAMPLE>;
|
|
39
43
|
"script-src-elem": Array<TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE>;
|
|
@@ -42,5 +46,6 @@ export type CSPDirectives = {
|
|
|
42
46
|
"style-src-elem": Array<TFetchDirective | typeof REPORT_SAMPLE>;
|
|
43
47
|
"upgrade-insecure-requests": boolean;
|
|
44
48
|
"worker-src": Array<TFetchDirective>;
|
|
49
|
+
webrtc: TWebRTCDirective;
|
|
45
50
|
};
|
|
46
51
|
export {};
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Based on types from https://www.npmjs.com/package/csp-header but adjusted to our needs
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WASM_UNSAFE_EVAL = exports.UNSAFE_INLINE = exports.UNSAFE_EVAL = exports.REPORT_SAMPLE = exports.STRICT_DYNAMIC = exports.SELF = exports.NONE = exports.ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION = exports.ALLOW_TOP_NAVIGATION = exports.ALLOW_SCRIPTS = exports.ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION = exports.ALLOW_SAME_ORIGIN = exports.ALLOW_PRESENTATION = exports.ALLOW_POPUPS_TO_ESCAPE_SANDBOX = exports.ALLOW_POPUPS = exports.ALLOW_POINTER_LOCK = exports.ALLOW_ORIENTATION_LOCK = exports.ALLOW_MODALS = exports.ALLOW_FORMS = exports.ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = void 0;
|
|
6
|
+
exports.BLOCK = exports.ALLOW = exports.WASM_UNSAFE_EVAL = exports.UNSAFE_INLINE = exports.UNSAFE_HASHES = exports.UNSAFE_EVAL = exports.REPORT_SAMPLE = exports.STRICT_DYNAMIC = exports.SELF = exports.NONE = exports.ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION = exports.ALLOW_TOP_NAVIGATION = exports.ALLOW_SCRIPTS = exports.ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION = exports.ALLOW_SAME_ORIGIN = exports.ALLOW_PRESENTATION = exports.ALLOW_POPUPS_TO_ESCAPE_SANDBOX = exports.ALLOW_POPUPS = exports.ALLOW_POINTER_LOCK = exports.ALLOW_ORIENTATION_LOCK = exports.ALLOW_MODALS = exports.ALLOW_FORMS = exports.ALLOW_DOWNLOADS = exports.ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = void 0;
|
|
7
7
|
exports.ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = "allow-downloads-without-user-activation";
|
|
8
|
-
|
|
8
|
+
exports.ALLOW_DOWNLOADS = "allow-downloads";
|
|
9
9
|
exports.ALLOW_FORMS = "allow-forms";
|
|
10
10
|
exports.ALLOW_MODALS = "allow-modals";
|
|
11
11
|
exports.ALLOW_ORIENTATION_LOCK = "allow-orientation-lock";
|
|
@@ -23,7 +23,9 @@ exports.SELF = "'self'";
|
|
|
23
23
|
exports.STRICT_DYNAMIC = "'strict-dynamic'";
|
|
24
24
|
exports.REPORT_SAMPLE = "'report-sample'";
|
|
25
25
|
exports.UNSAFE_EVAL = "'unsafe-eval'";
|
|
26
|
-
|
|
26
|
+
exports.UNSAFE_HASHES = "'unsafe-hashes'";
|
|
27
27
|
exports.UNSAFE_INLINE = "'unsafe-inline'";
|
|
28
28
|
exports.WASM_UNSAFE_EVAL = "'wasm-unsafe-eval'";
|
|
29
|
+
exports.ALLOW = "'allow'";
|
|
30
|
+
exports.BLOCK = "'block'";
|
|
29
31
|
//# sourceMappingURL=cspDirectives.js.map
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { CSPDirectives } from "./cspDirectives";
|
|
2
2
|
export type { CSPDirectives } from "./cspDirectives";
|
|
3
|
+
/**
|
|
4
|
+
* Default sandbox directives for the Iris Apps, these are the default directives that are allowed for all Iris Apps.
|
|
5
|
+
*/
|
|
6
|
+
export declare const irisAppDefaultSandbox: readonly ["allow-scripts", "allow-downloads", "allow-same-origin", "allow-forms", "allow-popups"];
|
|
7
|
+
/**
|
|
8
|
+
* Adds the default sandbox directives to the CSP header
|
|
9
|
+
*
|
|
10
|
+
* @param cspHeader - The CSP header to add the default sandbox directives to
|
|
11
|
+
* @returns {Partial<CSPDirectives>} - The CSP header with the default sandbox directives added
|
|
12
|
+
*/
|
|
13
|
+
export declare const addDefaultSandboxToCspHeader: (cspHeader: Partial<CSPDirectives>) => Partial<CSPDirectives>;
|
|
3
14
|
/**
|
|
4
15
|
* This function is used to generate the CSP input for the Iris Apps Csp Header
|
|
16
|
+
* automatically adds the default sandbox directives to the CSP input
|
|
5
17
|
*
|
|
6
18
|
* @param validDomains input legacy validDomains from manifest
|
|
7
19
|
* @param cspHeader input cspHeader from manifest
|
|
@@ -19,4 +31,5 @@ export declare const irisAppDefaultCsp: {
|
|
|
19
31
|
"object-src": string[];
|
|
20
32
|
"font-src": string[];
|
|
21
33
|
"upgrade-insecure-requests": boolean;
|
|
34
|
+
sandbox: ("allow-downloads" | "allow-forms" | "allow-popups" | "allow-same-origin" | "allow-scripts")[];
|
|
22
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.irisAppDefaultCsp = exports.irisAppCspInput = void 0;
|
|
3
|
+
exports.irisAppDefaultCsp = exports.irisAppCspInput = exports.addDefaultSandboxToCspHeader = exports.irisAppDefaultSandbox = void 0;
|
|
4
4
|
const cspDirectives_1 = require("./cspDirectives");
|
|
5
5
|
const BrandedUrls = [
|
|
6
6
|
"https://*.trackunit.com",
|
|
@@ -14,8 +14,34 @@ const BrandedUrls = [
|
|
|
14
14
|
"https://*.mymecalac.com",
|
|
15
15
|
"https://*.delille.be",
|
|
16
16
|
];
|
|
17
|
+
/**
|
|
18
|
+
* Default sandbox directives for the Iris Apps, these are the default directives that are allowed for all Iris Apps.
|
|
19
|
+
*/
|
|
20
|
+
exports.irisAppDefaultSandbox = [
|
|
21
|
+
cspDirectives_1.ALLOW_SCRIPTS,
|
|
22
|
+
cspDirectives_1.ALLOW_DOWNLOADS,
|
|
23
|
+
cspDirectives_1.ALLOW_SAME_ORIGIN,
|
|
24
|
+
cspDirectives_1.ALLOW_FORMS,
|
|
25
|
+
cspDirectives_1.ALLOW_POPUPS,
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Adds the default sandbox directives to the CSP header
|
|
29
|
+
*
|
|
30
|
+
* @param cspHeader - The CSP header to add the default sandbox directives to
|
|
31
|
+
* @returns {Partial<CSPDirectives>} - The CSP header with the default sandbox directives added
|
|
32
|
+
*/
|
|
33
|
+
const addDefaultSandboxToCspHeader = (cspHeader) => {
|
|
34
|
+
const sandboxResult = exports.irisAppDefaultSandbox;
|
|
35
|
+
const cspHeaderSandbox = cspHeader.sandbox ?? [];
|
|
36
|
+
return {
|
|
37
|
+
...cspHeader,
|
|
38
|
+
sandbox: [...cspHeaderSandbox, ...sandboxResult.filter(v => !cspHeaderSandbox.includes(v))],
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.addDefaultSandboxToCspHeader = addDefaultSandboxToCspHeader;
|
|
17
42
|
/**
|
|
18
43
|
* This function is used to generate the CSP input for the Iris Apps Csp Header
|
|
44
|
+
* automatically adds the default sandbox directives to the CSP input
|
|
19
45
|
*
|
|
20
46
|
* @param validDomains input legacy validDomains from manifest
|
|
21
47
|
* @param cspHeader input cspHeader from manifest
|
|
@@ -23,7 +49,7 @@ const BrandedUrls = [
|
|
|
23
49
|
*/
|
|
24
50
|
const irisAppCspInput = (validDomains, cspHeader) => {
|
|
25
51
|
if (cspHeader) {
|
|
26
|
-
return cspHeader;
|
|
52
|
+
return (0, exports.addDefaultSandboxToCspHeader)(cspHeader);
|
|
27
53
|
}
|
|
28
54
|
else if (validDomains) {
|
|
29
55
|
return {
|
|
@@ -34,7 +60,7 @@ const irisAppCspInput = (validDomains, cspHeader) => {
|
|
|
34
60
|
};
|
|
35
61
|
}
|
|
36
62
|
else {
|
|
37
|
-
return {};
|
|
63
|
+
return (0, exports.addDefaultSandboxToCspHeader)({});
|
|
38
64
|
}
|
|
39
65
|
};
|
|
40
66
|
exports.irisAppCspInput = irisAppCspInput;
|
|
@@ -49,5 +75,6 @@ exports.irisAppDefaultCsp = {
|
|
|
49
75
|
"object-src": [cspDirectives_1.NONE],
|
|
50
76
|
"font-src": [cspDirectives_1.SELF, "https://fonts.gstatic.com"],
|
|
51
77
|
"upgrade-insecure-requests": true,
|
|
78
|
+
sandbox: [...exports.irisAppDefaultSandbox],
|
|
52
79
|
};
|
|
53
80
|
//# sourceMappingURL=irisAppCspInput.js.map
|