@rayselfs/cf-rule-engine 1.6.2 → 1.7.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/dist/behaviors/index.cjs +2 -2
- package/dist/behaviors/index.js +1 -1
- package/dist/behaviors/set-security-headers.cjs +2 -2
- package/dist/behaviors/set-security-headers.d.cts +35 -19
- package/dist/behaviors/set-security-headers.d.ts +35 -19
- package/dist/behaviors/set-security-headers.js +1 -1
- package/dist/chunk-3UXNXJ6N.cjs +21 -0
- package/dist/chunk-O4SOSGAP.js +21 -0
- package/dist/criteria/index.cjs +12 -12
- package/dist/criteria/index.js +12 -12
- package/dist/helpers/index.cjs +6 -6
- package/dist/helpers/index.js +5 -5
- package/dist/helpers/whitelist.cjs +3 -3
- package/dist/helpers/whitelist.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-UI6LKDJI.cjs +0 -19
- package/dist/chunk-VQCRSBWL.js +0 -19
- package/dist/{chunk-RL7ZETZR.js → chunk-ER2YEZZO.js} +3 -3
- package/dist/{chunk-T5EXFHVA.cjs → chunk-MO7HW25R.cjs} +3 -3
package/dist/behaviors/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var _chunkPPUHEL4Hcjs = require('../chunk-PPUHEL4H.cjs');
|
|
|
6
6
|
var _chunkB4WEJSEZcjs = require('../chunk-B4WEJSEZ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk3UXNXJ6Ncjs = require('../chunk-3UXNXJ6N.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkMSES76XKcjs = require('../chunk-MSES76XK.cjs');
|
|
@@ -123,4 +123,4 @@ function verifyToken(options) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
exports.constructResponse = _chunkOSGZTNTScjs.constructResponse; exports.copyHeader = _chunkJU5WX5RUcjs.copyHeader; exports.directoryIndex = _chunkLTLBEBKLcjs.directoryIndex; exports.imageOptimize = _chunkKXC6ES3Bcjs.imageOptimize; exports.redirect = _chunkWWSRNCUPcjs.redirect; exports.removeResponseHeaders = _chunkSGEBNQR2cjs.removeResponseHeaders; exports.rewriteUri = _chunkMRPTC74Icjs.rewriteUri; exports.setCacheControl = _chunkCV234DQTcjs.setCacheControl; exports.setCorsHeaders = _chunkGK5JX7OMcjs.setCorsHeaders; exports.setCsp = _chunkZXS23HXAcjs.setCsp; exports.setRequestHeader = _chunkPPUHEL4Hcjs.setRequestHeader; exports.setResponseHeader = _chunkB4WEJSEZcjs.setResponseHeader; exports.setSecurityHeaders =
|
|
126
|
+
exports.constructResponse = _chunkOSGZTNTScjs.constructResponse; exports.copyHeader = _chunkJU5WX5RUcjs.copyHeader; exports.directoryIndex = _chunkLTLBEBKLcjs.directoryIndex; exports.imageOptimize = _chunkKXC6ES3Bcjs.imageOptimize; exports.redirect = _chunkWWSRNCUPcjs.redirect; exports.removeResponseHeaders = _chunkSGEBNQR2cjs.removeResponseHeaders; exports.rewriteUri = _chunkMRPTC74Icjs.rewriteUri; exports.setCacheControl = _chunkCV234DQTcjs.setCacheControl; exports.setCorsHeaders = _chunkGK5JX7OMcjs.setCorsHeaders; exports.setCsp = _chunkZXS23HXAcjs.setCsp; exports.setRequestHeader = _chunkPPUHEL4Hcjs.setRequestHeader; exports.setResponseHeader = _chunkB4WEJSEZcjs.setResponseHeader; exports.setSecurityHeaders = _chunk3UXNXJ6Ncjs.setSecurityHeaders; exports.stripQueryParams = _chunkMSES76XKcjs.stripQueryParams; exports.verifyToken = verifyToken;
|
package/dist/behaviors/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3UXNXJ6Ncjs = require('../chunk-3UXNXJ6N.cjs');
|
|
4
4
|
require('../chunk-75ZPJI57.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.setSecurityHeaders =
|
|
7
|
+
exports.setSecurityHeaders = _chunk3UXNXJ6Ncjs.setSecurityHeaders;
|
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
import { ResponseBehaviorFn } from '../core/types.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Options for
|
|
5
|
-
*
|
|
4
|
+
* Options for individual security header values.
|
|
5
|
+
*
|
|
6
|
+
* Only headers with a provided value are emitted — omitted fields are **not** added to the
|
|
7
|
+
* response. There are no built-in defaults; every emitted header value is explicit.
|
|
8
|
+
*
|
|
9
|
+
* Pass at least one field.
|
|
6
10
|
*/
|
|
7
11
|
interface SecurityHeadersOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Value for the `Strict-Transport-Security` header.
|
|
10
|
-
*
|
|
14
|
+
* Example: `'max-age=31536000; includeSubDomains'`
|
|
11
15
|
*/
|
|
12
16
|
hsts?: string;
|
|
13
17
|
/**
|
|
14
18
|
* Value for the `X-Frame-Options` header. Controls whether the page can be
|
|
15
19
|
* embedded in an iframe. Common values: `'DENY'`, `'SAMEORIGIN'`.
|
|
16
|
-
* Default: `'SAMEORIGIN'`
|
|
17
20
|
*/
|
|
18
21
|
xFrameOptions?: string;
|
|
19
22
|
/**
|
|
20
23
|
* Value for the `X-Content-Type-Options` header. Set to `'nosniff'` to
|
|
21
24
|
* prevent browsers from MIME-sniffing the response content type.
|
|
22
|
-
* Default: `'nosniff'`
|
|
23
25
|
*/
|
|
24
26
|
xContentTypeOptions?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Value for the `X-XSS-Protection` header.
|
|
29
|
+
* Example: `'1; mode=block'`
|
|
30
|
+
*
|
|
31
|
+
* Note: deprecated in modern browsers but still used for legacy compatibility.
|
|
32
|
+
*/
|
|
33
|
+
xXssProtection?: string;
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
27
|
-
* Sets
|
|
36
|
+
* Sets security headers on the outgoing response.
|
|
37
|
+
*
|
|
38
|
+
* Only headers explicitly provided in `options` are emitted — there are **no built-in
|
|
39
|
+
* defaults**. This avoids silently overriding headers set elsewhere in the pipeline and
|
|
40
|
+
* lets Akamai-migrated properties carry their original values verbatim.
|
|
28
41
|
*
|
|
29
|
-
*
|
|
30
|
-
* - `Strict-Transport-Security
|
|
31
|
-
* - `X-Frame-Options
|
|
32
|
-
* - `X-Content-Type-Options
|
|
42
|
+
* Supported headers:
|
|
43
|
+
* - `Strict-Transport-Security` (`hsts`)
|
|
44
|
+
* - `X-Frame-Options` (`xFrameOptions`)
|
|
45
|
+
* - `X-Content-Type-Options` (`xContentTypeOptions`)
|
|
46
|
+
* - `X-XSS-Protection` (`xXssProtection`)
|
|
33
47
|
*
|
|
34
|
-
* Akamai
|
|
48
|
+
* Akamai equivalents: `httpStrictTransportSecurity` (HSTS), `modifyOutgoingResponseHeader`
|
|
49
|
+
* (frame options, content-type options, XSS protection).
|
|
35
50
|
*
|
|
36
|
-
* @param options -
|
|
37
|
-
* @returns A `ResponseBehaviorFn` to use
|
|
51
|
+
* @param options - Security header values to set. Pass at least one field.
|
|
52
|
+
* @returns A `ResponseBehaviorFn` to use in `defineViewerResponse` or a `ResponseRule`.
|
|
38
53
|
*
|
|
39
54
|
* @example
|
|
40
55
|
* ```ts
|
|
41
56
|
* import { setSecurityHeaders } from '@rayselfs/cf-rule-engine/behaviors'
|
|
42
57
|
* import { defineViewerResponse } from '@rayselfs/cf-rule-engine/adapters/cf-function'
|
|
43
58
|
*
|
|
44
|
-
* // Apply defaults
|
|
45
|
-
* export default defineViewerResponse([setSecurityHeaders()])
|
|
46
|
-
*
|
|
47
|
-
* // Override HSTS and frame options
|
|
48
59
|
* export default defineViewerResponse([
|
|
49
|
-
* setSecurityHeaders({
|
|
60
|
+
* setSecurityHeaders({
|
|
61
|
+
* hsts: 'max-age=31536000; includeSubDomains',
|
|
62
|
+
* xFrameOptions: 'SAMEORIGIN',
|
|
63
|
+
* xContentTypeOptions: 'nosniff',
|
|
64
|
+
* xXssProtection: '1; mode=block',
|
|
65
|
+
* }),
|
|
50
66
|
* ])
|
|
51
67
|
* ```
|
|
52
68
|
*/
|
|
53
|
-
declare function setSecurityHeaders(options
|
|
69
|
+
declare function setSecurityHeaders(options: SecurityHeadersOptions): ResponseBehaviorFn;
|
|
54
70
|
|
|
55
71
|
export { type SecurityHeadersOptions, setSecurityHeaders };
|
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
import { ResponseBehaviorFn } from '../core/types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Options for
|
|
5
|
-
*
|
|
4
|
+
* Options for individual security header values.
|
|
5
|
+
*
|
|
6
|
+
* Only headers with a provided value are emitted — omitted fields are **not** added to the
|
|
7
|
+
* response. There are no built-in defaults; every emitted header value is explicit.
|
|
8
|
+
*
|
|
9
|
+
* Pass at least one field.
|
|
6
10
|
*/
|
|
7
11
|
interface SecurityHeadersOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Value for the `Strict-Transport-Security` header.
|
|
10
|
-
*
|
|
14
|
+
* Example: `'max-age=31536000; includeSubDomains'`
|
|
11
15
|
*/
|
|
12
16
|
hsts?: string;
|
|
13
17
|
/**
|
|
14
18
|
* Value for the `X-Frame-Options` header. Controls whether the page can be
|
|
15
19
|
* embedded in an iframe. Common values: `'DENY'`, `'SAMEORIGIN'`.
|
|
16
|
-
* Default: `'SAMEORIGIN'`
|
|
17
20
|
*/
|
|
18
21
|
xFrameOptions?: string;
|
|
19
22
|
/**
|
|
20
23
|
* Value for the `X-Content-Type-Options` header. Set to `'nosniff'` to
|
|
21
24
|
* prevent browsers from MIME-sniffing the response content type.
|
|
22
|
-
* Default: `'nosniff'`
|
|
23
25
|
*/
|
|
24
26
|
xContentTypeOptions?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Value for the `X-XSS-Protection` header.
|
|
29
|
+
* Example: `'1; mode=block'`
|
|
30
|
+
*
|
|
31
|
+
* Note: deprecated in modern browsers but still used for legacy compatibility.
|
|
32
|
+
*/
|
|
33
|
+
xXssProtection?: string;
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
27
|
-
* Sets
|
|
36
|
+
* Sets security headers on the outgoing response.
|
|
37
|
+
*
|
|
38
|
+
* Only headers explicitly provided in `options` are emitted — there are **no built-in
|
|
39
|
+
* defaults**. This avoids silently overriding headers set elsewhere in the pipeline and
|
|
40
|
+
* lets Akamai-migrated properties carry their original values verbatim.
|
|
28
41
|
*
|
|
29
|
-
*
|
|
30
|
-
* - `Strict-Transport-Security
|
|
31
|
-
* - `X-Frame-Options
|
|
32
|
-
* - `X-Content-Type-Options
|
|
42
|
+
* Supported headers:
|
|
43
|
+
* - `Strict-Transport-Security` (`hsts`)
|
|
44
|
+
* - `X-Frame-Options` (`xFrameOptions`)
|
|
45
|
+
* - `X-Content-Type-Options` (`xContentTypeOptions`)
|
|
46
|
+
* - `X-XSS-Protection` (`xXssProtection`)
|
|
33
47
|
*
|
|
34
|
-
* Akamai
|
|
48
|
+
* Akamai equivalents: `httpStrictTransportSecurity` (HSTS), `modifyOutgoingResponseHeader`
|
|
49
|
+
* (frame options, content-type options, XSS protection).
|
|
35
50
|
*
|
|
36
|
-
* @param options -
|
|
37
|
-
* @returns A `ResponseBehaviorFn` to use
|
|
51
|
+
* @param options - Security header values to set. Pass at least one field.
|
|
52
|
+
* @returns A `ResponseBehaviorFn` to use in `defineViewerResponse` or a `ResponseRule`.
|
|
38
53
|
*
|
|
39
54
|
* @example
|
|
40
55
|
* ```ts
|
|
41
56
|
* import { setSecurityHeaders } from '@rayselfs/cf-rule-engine/behaviors'
|
|
42
57
|
* import { defineViewerResponse } from '@rayselfs/cf-rule-engine/adapters/cf-function'
|
|
43
58
|
*
|
|
44
|
-
* // Apply defaults
|
|
45
|
-
* export default defineViewerResponse([setSecurityHeaders()])
|
|
46
|
-
*
|
|
47
|
-
* // Override HSTS and frame options
|
|
48
59
|
* export default defineViewerResponse([
|
|
49
|
-
* setSecurityHeaders({
|
|
60
|
+
* setSecurityHeaders({
|
|
61
|
+
* hsts: 'max-age=31536000; includeSubDomains',
|
|
62
|
+
* xFrameOptions: 'SAMEORIGIN',
|
|
63
|
+
* xContentTypeOptions: 'nosniff',
|
|
64
|
+
* xXssProtection: '1; mode=block',
|
|
65
|
+
* }),
|
|
50
66
|
* ])
|
|
51
67
|
* ```
|
|
52
68
|
*/
|
|
53
|
-
declare function setSecurityHeaders(options
|
|
69
|
+
declare function setSecurityHeaders(options: SecurityHeadersOptions): ResponseBehaviorFn;
|
|
54
70
|
|
|
55
71
|
export { type SecurityHeadersOptions, setSecurityHeaders };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/behaviors/set-security-headers.ts
|
|
2
|
+
function setSecurityHeaders(options) {
|
|
3
|
+
return (_request, response) => {
|
|
4
|
+
const extra = {};
|
|
5
|
+
if (options.hsts !== void 0)
|
|
6
|
+
extra["strict-transport-security"] = { value: options.hsts };
|
|
7
|
+
if (options.xFrameOptions !== void 0)
|
|
8
|
+
extra["x-frame-options"] = { value: options.xFrameOptions };
|
|
9
|
+
if (options.xContentTypeOptions !== void 0)
|
|
10
|
+
extra["x-content-type-options"] = { value: options.xContentTypeOptions };
|
|
11
|
+
if (options.xXssProtection !== void 0)
|
|
12
|
+
extra["x-xss-protection"] = { value: options.xXssProtection };
|
|
13
|
+
return Object.assign({}, response, {
|
|
14
|
+
headers: Object.assign({}, response.headers, extra)
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.setSecurityHeaders = setSecurityHeaders;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/behaviors/set-security-headers.ts
|
|
2
|
+
function setSecurityHeaders(options) {
|
|
3
|
+
return (_request, response) => {
|
|
4
|
+
const extra = {};
|
|
5
|
+
if (options.hsts !== void 0)
|
|
6
|
+
extra["strict-transport-security"] = { value: options.hsts };
|
|
7
|
+
if (options.xFrameOptions !== void 0)
|
|
8
|
+
extra["x-frame-options"] = { value: options.xFrameOptions };
|
|
9
|
+
if (options.xContentTypeOptions !== void 0)
|
|
10
|
+
extra["x-content-type-options"] = { value: options.xContentTypeOptions };
|
|
11
|
+
if (options.xXssProtection !== void 0)
|
|
12
|
+
extra["x-xss-protection"] = { value: options.xXssProtection };
|
|
13
|
+
return Object.assign({}, response, {
|
|
14
|
+
headers: Object.assign({}, response.headers, extra)
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
setSecurityHeaders
|
|
21
|
+
};
|
package/dist/criteria/index.cjs
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkG7JGTBTTcjs = require('../chunk-G7JGTBTT.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkMVGYPBYBcjs = require('../chunk-MVGYPBYB.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunk32SMWYAFcjs = require('../chunk-32SMWYAF.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
|
|
13
|
-
|
|
14
|
-
|
|
15
3
|
var _chunkJGJW7D2Ncjs = require('../chunk-JGJW7D2N.cjs');
|
|
16
4
|
|
|
17
5
|
|
|
@@ -26,6 +14,12 @@ var _chunkVEEOQ7TScjs = require('../chunk-VEEOQ7TS.cjs');
|
|
|
26
14
|
|
|
27
15
|
|
|
28
16
|
var _chunkCF5PWWTFcjs = require('../chunk-CF5PWWTF.cjs');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkG7JGTBTTcjs = require('../chunk-G7JGTBTT.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunkMVGYPBYBcjs = require('../chunk-MVGYPBYB.cjs');
|
|
29
23
|
require('../chunk-IBXAK2A4.cjs');
|
|
30
24
|
|
|
31
25
|
|
|
@@ -33,6 +27,12 @@ var _chunkOSZWDCTScjs = require('../chunk-OSZWDCTS.cjs');
|
|
|
33
27
|
|
|
34
28
|
|
|
35
29
|
var _chunkU54FZCOHcjs = require('../chunk-U54FZCOH.cjs');
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var _chunk32SMWYAFcjs = require('../chunk-32SMWYAF.cjs');
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
|
|
36
36
|
require('../chunk-75ZPJI57.cjs');
|
|
37
37
|
|
|
38
38
|
|
package/dist/criteria/index.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
pathPrefix
|
|
3
|
-
} from "../chunk-XLSZ5RB7.js";
|
|
4
|
-
import {
|
|
5
|
-
userAgentMatches
|
|
6
|
-
} from "../chunk-S2AAATFN.js";
|
|
7
|
-
import {
|
|
8
|
-
headerContains
|
|
9
|
-
} from "../chunk-SRQF5UEJ.js";
|
|
10
|
-
import {
|
|
11
|
-
headerEquals
|
|
12
|
-
} from "../chunk-BZQJYOU2.js";
|
|
13
1
|
import {
|
|
14
2
|
hostnameIs
|
|
15
3
|
} from "../chunk-3PVDUC5M.js";
|
|
@@ -26,6 +14,12 @@ import {
|
|
|
26
14
|
import {
|
|
27
15
|
pathMatches
|
|
28
16
|
} from "../chunk-LO2BO3RU.js";
|
|
17
|
+
import {
|
|
18
|
+
pathPrefix
|
|
19
|
+
} from "../chunk-XLSZ5RB7.js";
|
|
20
|
+
import {
|
|
21
|
+
userAgentMatches
|
|
22
|
+
} from "../chunk-S2AAATFN.js";
|
|
29
23
|
import "../chunk-2DE6WPPL.js";
|
|
30
24
|
import {
|
|
31
25
|
countryIs
|
|
@@ -33,6 +27,12 @@ import {
|
|
|
33
27
|
import {
|
|
34
28
|
fileExtension
|
|
35
29
|
} from "../chunk-LBJUCJF2.js";
|
|
30
|
+
import {
|
|
31
|
+
headerContains
|
|
32
|
+
} from "../chunk-SRQF5UEJ.js";
|
|
33
|
+
import {
|
|
34
|
+
headerEquals
|
|
35
|
+
} from "../chunk-BZQJYOU2.js";
|
|
36
36
|
import "../chunk-MLKGABMK.js";
|
|
37
37
|
export {
|
|
38
38
|
countryIs,
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -6,18 +6,18 @@ var _chunk63WIEBQBcjs = require('../chunk-63WIEBQB.cjs');
|
|
|
6
6
|
var _chunkLSCC62CZcjs = require('../chunk-LSCC62CZ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-MVGYPBYB.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
|
|
9
|
+
var _chunkMO7HW25Rcjs = require('../chunk-MO7HW25R.cjs');
|
|
14
10
|
require('../chunk-D47P7HVZ.cjs');
|
|
15
11
|
require('../chunk-YVUR35RN.cjs');
|
|
16
12
|
require('../chunk-OTFDML3K.cjs');
|
|
17
13
|
require('../chunk-CF5PWWTF.cjs');
|
|
14
|
+
require('../chunk-MVGYPBYB.cjs');
|
|
18
15
|
require('../chunk-IBXAK2A4.cjs');
|
|
19
16
|
|
|
20
17
|
|
|
18
|
+
var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
21
|
var _chunkB4WEJSEZcjs = require('../chunk-B4WEJSEZ.cjs');
|
|
22
22
|
require('../chunk-WWSRNCUP.cjs');
|
|
23
23
|
require('../chunk-WKYMSRCD.cjs');
|
|
@@ -39,4 +39,4 @@ function stagingIndicator() {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.preflightRequest = _chunk63WIEBQBcjs.preflightRequest; exports.sendCountryCode = _chunkLSCC62CZcjs.sendCountryCode; exports.stagingIndicator = stagingIndicator; exports.whitelist =
|
|
42
|
+
exports.preflightRequest = _chunk63WIEBQBcjs.preflightRequest; exports.sendCountryCode = _chunkLSCC62CZcjs.sendCountryCode; exports.stagingIndicator = stagingIndicator; exports.whitelist = _chunkMO7HW25Rcjs.whitelist;
|
package/dist/helpers/index.js
CHANGED
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
} from "../chunk-C32DL3EP.js";
|
|
7
7
|
import {
|
|
8
8
|
whitelist
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-S2AAATFN.js";
|
|
11
|
-
import {
|
|
12
|
-
headerEquals
|
|
13
|
-
} from "../chunk-BZQJYOU2.js";
|
|
9
|
+
} from "../chunk-ER2YEZZO.js";
|
|
14
10
|
import "../chunk-KW5YBTSD.js";
|
|
15
11
|
import "../chunk-LNQPYKGG.js";
|
|
16
12
|
import "../chunk-PY3JMRDG.js";
|
|
17
13
|
import "../chunk-LO2BO3RU.js";
|
|
14
|
+
import "../chunk-S2AAATFN.js";
|
|
18
15
|
import "../chunk-2DE6WPPL.js";
|
|
16
|
+
import {
|
|
17
|
+
headerEquals
|
|
18
|
+
} from "../chunk-BZQJYOU2.js";
|
|
19
19
|
import {
|
|
20
20
|
setResponseHeader
|
|
21
21
|
} from "../chunk-RBBKFG5J.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-MVGYPBYB.cjs');
|
|
3
|
+
var _chunkMO7HW25Rcjs = require('../chunk-MO7HW25R.cjs');
|
|
5
4
|
require('../chunk-D47P7HVZ.cjs');
|
|
6
5
|
require('../chunk-YVUR35RN.cjs');
|
|
7
6
|
require('../chunk-CF5PWWTF.cjs');
|
|
7
|
+
require('../chunk-MVGYPBYB.cjs');
|
|
8
8
|
require('../chunk-IBXAK2A4.cjs');
|
|
9
9
|
require('../chunk-WWSRNCUP.cjs');
|
|
10
10
|
require('../chunk-WKYMSRCD.cjs');
|
|
11
11
|
require('../chunk-75ZPJI57.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.whitelist =
|
|
14
|
+
exports.whitelist = _chunkMO7HW25Rcjs.whitelist;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
whitelist
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-S2AAATFN.js";
|
|
3
|
+
} from "../chunk-ER2YEZZO.js";
|
|
5
4
|
import "../chunk-KW5YBTSD.js";
|
|
6
5
|
import "../chunk-LNQPYKGG.js";
|
|
7
6
|
import "../chunk-LO2BO3RU.js";
|
|
7
|
+
import "../chunk-S2AAATFN.js";
|
|
8
8
|
import "../chunk-2DE6WPPL.js";
|
|
9
9
|
import "../chunk-DSSFFJWL.js";
|
|
10
10
|
import "../chunk-Q4NP4C3B.js";
|
package/package.json
CHANGED
package/dist/chunk-UI6LKDJI.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/behaviors/set-security-headers.ts
|
|
2
|
-
function setSecurityHeaders(options) {
|
|
3
|
-
const hsts = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.hsts]), () => ( "max-age=31536000; includeSubDomains"));
|
|
4
|
-
const xFrameOptions = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.xFrameOptions]), () => ( "SAMEORIGIN"));
|
|
5
|
-
const xContentTypeOptions = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _3 => _3.xContentTypeOptions]), () => ( "nosniff"));
|
|
6
|
-
return (_request, response) => {
|
|
7
|
-
return Object.assign({}, response, {
|
|
8
|
-
headers: Object.assign({}, response.headers, {
|
|
9
|
-
"strict-transport-security": { value: hsts },
|
|
10
|
-
"x-frame-options": { value: xFrameOptions },
|
|
11
|
-
"x-content-type-options": { value: xContentTypeOptions }
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
exports.setSecurityHeaders = setSecurityHeaders;
|
package/dist/chunk-VQCRSBWL.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/behaviors/set-security-headers.ts
|
|
2
|
-
function setSecurityHeaders(options) {
|
|
3
|
-
const hsts = options?.hsts ?? "max-age=31536000; includeSubDomains";
|
|
4
|
-
const xFrameOptions = options?.xFrameOptions ?? "SAMEORIGIN";
|
|
5
|
-
const xContentTypeOptions = options?.xContentTypeOptions ?? "nosniff";
|
|
6
|
-
return (_request, response) => {
|
|
7
|
-
return Object.assign({}, response, {
|
|
8
|
-
headers: Object.assign({}, response.headers, {
|
|
9
|
-
"strict-transport-security": { value: hsts },
|
|
10
|
-
"x-frame-options": { value: xFrameOptions },
|
|
11
|
-
"x-content-type-options": { value: xContentTypeOptions }
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
setSecurityHeaders
|
|
19
|
-
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
userAgentMatches
|
|
3
|
-
} from "./chunk-S2AAATFN.js";
|
|
4
1
|
import {
|
|
5
2
|
ipCidr
|
|
6
3
|
} from "./chunk-KW5YBTSD.js";
|
|
7
4
|
import {
|
|
8
5
|
pathMatches
|
|
9
6
|
} from "./chunk-LO2BO3RU.js";
|
|
7
|
+
import {
|
|
8
|
+
userAgentMatches
|
|
9
|
+
} from "./chunk-S2AAATFN.js";
|
|
10
10
|
import {
|
|
11
11
|
redirect
|
|
12
12
|
} from "./chunk-DSSFFJWL.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var _chunkMVGYPBYBcjs = require('./chunk-MVGYPBYB.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkD47P7HVZcjs = require('./chunk-D47P7HVZ.cjs');
|
|
7
4
|
|
|
8
5
|
|
|
9
6
|
var _chunkCF5PWWTFcjs = require('./chunk-CF5PWWTF.cjs');
|
|
10
7
|
|
|
11
8
|
|
|
9
|
+
var _chunkMVGYPBYBcjs = require('./chunk-MVGYPBYB.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
var _chunkWWSRNCUPcjs = require('./chunk-WWSRNCUP.cjs');
|
|
13
13
|
|
|
14
14
|
|