perimeterx-js-core 0.30.1 → 0.32.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/lib/cjs/config/ConfigurationBase.js +8 -0
- package/lib/cjs/config/defaults/DefaultConfigurationParams.js +1 -0
- package/lib/cjs/config/params/CreateHumanSecurityConfigurationParams.js +2 -0
- package/lib/cjs/config/params/index.js +1 -0
- package/lib/cjs/flow/EnforceFlow.js +2 -1
- package/lib/cjs/phase/impl/BlockByHeaderPhase.js +76 -0
- package/lib/cjs/phase/impl/index.js +1 -0
- package/lib/cjs/products/bot_defender/BotDefender.js +9 -1
- package/lib/cjs/products/utils/ProductName.js +1 -0
- package/lib/cjs/products/utils/ProductPriorityOrder.js +1 -0
- package/lib/cjs/utils/constants.js +5 -2
- package/lib/esm/config/ConfigurationBase.js +4 -0
- package/lib/esm/config/defaults/DefaultConfigurationParams.js +1 -0
- package/lib/esm/config/params/CreateHumanSecurityConfigurationParams.js +1 -0
- package/lib/esm/config/params/index.js +1 -0
- package/lib/esm/flow/EnforceFlow.js +3 -2
- package/lib/esm/phase/impl/BlockByHeaderPhase.js +72 -0
- package/lib/esm/phase/impl/index.js +1 -0
- package/lib/esm/products/bot_defender/BotDefender.js +9 -2
- package/lib/esm/products/utils/ProductName.js +1 -0
- package/lib/esm/products/utils/ProductPriorityOrder.js +1 -0
- package/lib/esm/utils/constants.js +4 -1
- package/lib/types/activities/HttpActivityClient.d.ts +3 -3
- package/lib/types/activities/HttpBatchedActivityClient.d.ts +2 -2
- package/lib/types/activities/utils.d.ts +5 -5
- package/lib/types/additional_activity_handler/AdditionalActivityHandler.d.ts +1 -1
- package/lib/types/additional_activity_handler/AdditionalActivityHandlerUtils.d.ts +1 -1
- package/lib/types/blocker/MobileBlocker.d.ts +3 -3
- package/lib/types/blocker/utils.d.ts +1 -1
- package/lib/types/config/ConfigurationBase.d.ts +23 -22
- package/lib/types/config/IConfiguration.d.ts +13 -9
- package/lib/types/config/defaults/DefaultConfigurationParams.d.ts +1 -1
- package/lib/types/config/params/ActiveConfigurationParams.d.ts +8 -2
- package/lib/types/config/params/AllConfigurationParams.d.ts +6 -3
- package/lib/types/config/params/CoreConfigurationParams.d.ts +25 -7
- package/lib/types/config/params/CreateHumanSecurityConfigurationParams.d.ts +2 -0
- package/lib/types/config/params/RemoteConfigurationParams.d.ts +3 -2
- package/lib/types/config/params/StaticConfigurationParams.d.ts +5 -3
- package/lib/types/config/params/index.d.ts +1 -0
- package/lib/types/config/remote_config/RemoteConfigUtils.d.ts +1 -1
- package/lib/types/config/remote_config/manager/DefaultRemoteConfigManager.d.ts +10 -10
- package/lib/types/config/remote_config/model/RemoteConfigData.d.ts +2 -2
- package/lib/types/config/remote_config/service_client/HttpRemoteConfigServiceClient.d.ts +5 -5
- package/lib/types/config/remote_config/service_client/IRemoteConfigServiceClient.d.ts +2 -2
- package/lib/types/config/remote_config/storage_client/IRemoteConfigStorageClient.d.ts +3 -3
- package/lib/types/config/remote_config/update_parser/DefaultNotifyRemoteConfigUpdateParser.d.ts +3 -3
- package/lib/types/context/DefaultContext.d.ts +8 -8
- package/lib/types/context/SerializedContext.d.ts +4 -4
- package/lib/types/cors/DefaultCors.d.ts +2 -2
- package/lib/types/custom_parameters/CustomParametersFunction.d.ts +2 -2
- package/lib/types/custom_parameters/CustomParametersUtils.d.ts +2 -2
- package/lib/types/enforcer/EnforcerBase.d.ts +8 -8
- package/lib/types/enforcer/EnforcerOptions.d.ts +3 -3
- package/lib/types/enforcer/utils.d.ts +6 -6
- package/lib/types/flow/EndEnforcerFlow.d.ts +2 -2
- package/lib/types/flow/EnforceFlow.d.ts +3 -3
- package/lib/types/flow/FilterFlow.d.ts +2 -2
- package/lib/types/flow/PostEnforceFlow.d.ts +2 -2
- package/lib/types/graphql/DefaultGraphQLParser.d.ts +3 -3
- package/lib/types/logger/HttpLogServiceClient.d.ts +3 -3
- package/lib/types/monitored_request/MonitoredRequestUtils.d.ts +3 -3
- package/lib/types/phase/impl/AdditionalActivityHandlerPhase.d.ts +3 -3
- package/lib/types/phase/impl/BlockByHeaderPhase.d.ts +40 -0
- package/lib/types/phase/impl/CreateBlockResponsePhase.d.ts +3 -3
- package/lib/types/phase/impl/EnrichContextFromRequestPhase.d.ts +3 -3
- package/lib/types/phase/impl/EnrichContextFromResponsePhase.d.ts +3 -3
- package/lib/types/phase/impl/FirstPartyPhase.d.ts +3 -3
- package/lib/types/phase/impl/ModifyOutgoingResponsePhase.d.ts +3 -3
- package/lib/types/phase/impl/PreflightPhase.d.ts +2 -2
- package/lib/types/phase/impl/SendAsyncActivitiesPhase.d.ts +3 -3
- package/lib/types/phase/impl/SendLogsPhase.d.ts +2 -2
- package/lib/types/phase/impl/SendTelemetryActivityPhase.d.ts +3 -3
- package/lib/types/phase/impl/UpdateRemoteConfigPhase.d.ts +3 -3
- package/lib/types/phase/impl/index.d.ts +1 -0
- package/lib/types/products/account_defender/AccountDefender.d.ts +3 -3
- package/lib/types/products/bot_defender/BotDefender.d.ts +4 -4
- package/lib/types/products/bot_defender/block/DefaultBotDefenderBlocker.d.ts +3 -3
- package/lib/types/products/bot_defender/block/captcha/CaptchaBlocker.d.ts +12 -12
- package/lib/types/products/bot_defender/block/captcha/HtmlCaptchaBlocker.d.ts +5 -5
- package/lib/types/products/bot_defender/block/captcha/JsonCaptchaBlocker.d.ts +5 -5
- package/lib/types/products/bot_defender/block/captcha/MobileCaptchaBlocker.d.ts +4 -4
- package/lib/types/products/bot_defender/filter/DefaultBotDefenderFilter.d.ts +2 -2
- package/lib/types/products/bot_defender/first_party/DefaultBotDefenderFirstParty.d.ts +3 -3
- package/lib/types/products/bot_defender/first_party/utils.d.ts +7 -7
- package/lib/types/products/credential_intelligence/CredentialIntelligence.d.ts +4 -4
- package/lib/types/products/credential_intelligence/endpoint/login_successful/LoginSuccessfulParserFactory.d.ts +1 -1
- package/lib/types/products/hype_sale_challenge/HypeSaleChallenge.d.ts +3 -3
- package/lib/types/products/hype_sale_challenge/block/JsonHypeSaleChallengeBlocker.d.ts +3 -3
- package/lib/types/products/hype_sale_challenge/block/MobileHypeSaleChallengeBlocker.d.ts +2 -2
- package/lib/types/products/utils/ProductName.d.ts +1 -0
- package/lib/types/pxde/DefaultDataEnrichment.d.ts +2 -2
- package/lib/types/pxhd/PXHDUtils.d.ts +2 -2
- package/lib/types/risk_api/client/GetRiskApiClientV2.d.ts +2 -2
- package/lib/types/risk_api/client/PostRiskApiClientV2.d.ts +3 -3
- package/lib/types/risk_api/client/PostRiskApiClientV3.d.ts +3 -3
- package/lib/types/risk_api/client/abstract/PostRiskApiClientBase.d.ts +2 -1
- package/lib/types/risk_api/client/abstract/RiskApiClientBase.d.ts +3 -3
- package/lib/types/risk_api/utils.d.ts +2 -2
- package/lib/types/risk_token/parser/DefaultTokenV2Parser.d.ts +4 -4
- package/lib/types/risk_token/parser/DefaultTokenV3Parser.d.ts +4 -4
- package/lib/types/risk_token/parser/TokenParserBase.d.ts +5 -5
- package/lib/types/risk_token/token/TokenBase.d.ts +3 -3
- package/lib/types/risk_token/token/serialize/SerializedToken.d.ts +2 -2
- package/lib/types/risk_token/token/v2/DefaultTokenV2.d.ts +2 -2
- package/lib/types/risk_token/token/v3/DefaultTokenV3.d.ts +2 -2
- package/lib/types/sensitive_request/SensitiveRequestUtils.d.ts +2 -2
- package/lib/types/snippet_injection/CustomSnippetFunction.d.ts +1 -1
- package/lib/types/snippet_injection/snippet_retriever/DefaultSnippetRetriever.d.ts +3 -3
- package/lib/types/telemetry/DefaultTelemetry.d.ts +5 -5
- package/lib/types/telemetry/model/TelemetryActivity.d.ts +9 -9
- package/lib/types/utils/constants.d.ts +4 -1
- package/lib/types/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.d.ts +3 -3
- package/package.json +5 -5
|
@@ -123,6 +123,7 @@ var ConfigurationBase = /** @class */ (function () {
|
|
|
123
123
|
// @ts-ignore
|
|
124
124
|
delete activeConfig[key];
|
|
125
125
|
}
|
|
126
|
+
// Runtime filtering ensures only supported configs remain
|
|
126
127
|
return activeConfig;
|
|
127
128
|
};
|
|
128
129
|
ConfigurationBase.prototype.getStaticConfig = function () {
|
|
@@ -775,6 +776,13 @@ var ConfigurationBase = /** @class */ (function () {
|
|
|
775
776
|
enumerable: false,
|
|
776
777
|
configurable: true
|
|
777
778
|
});
|
|
779
|
+
Object.defineProperty(ConfigurationBase.prototype, "dataEnrichmentHeaderName", {
|
|
780
|
+
get: function () {
|
|
781
|
+
return this.configParams.px_data_enrichment_header_name;
|
|
782
|
+
},
|
|
783
|
+
enumerable: false,
|
|
784
|
+
configurable: true
|
|
785
|
+
});
|
|
778
786
|
Object.defineProperty(ConfigurationBase.prototype, "enableBlockedUrlOnCaptchaBlockPage", {
|
|
779
787
|
get: function () {
|
|
780
788
|
return true;
|
|
@@ -132,6 +132,7 @@ var defaultConfigurationParams = function () { return ({
|
|
|
132
132
|
px_remote_config_retry_interval_ms: 1000,
|
|
133
133
|
px_url_decode_reserved_characters: false,
|
|
134
134
|
px_secured_pxhd_enabled: false,
|
|
135
|
+
px_data_enrichment_header_name: '',
|
|
135
136
|
px_snippet_injection_enabled: false,
|
|
136
137
|
px_create_custom_snippet: null,
|
|
137
138
|
px_custom_is_sensitive_request: null,
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./AllConfigurationParams.js"), exports);
|
|
|
19
19
|
__exportStar(require("./CoreConfigurationParams.js"), exports);
|
|
20
20
|
__exportStar(require("./RemoteConfigurationParams.js"), exports);
|
|
21
21
|
__exportStar(require("./StaticConfigurationParams.js"), exports);
|
|
22
|
+
__exportStar(require("./CreateHumanSecurityConfigurationParams.js"), exports);
|
|
@@ -21,8 +21,9 @@ var Flow_1 = require("./Flow.js");
|
|
|
21
21
|
var EnforceFlow = /** @class */ (function (_super) {
|
|
22
22
|
__extends(EnforceFlow, _super);
|
|
23
23
|
function EnforceFlow(config, _a) {
|
|
24
|
-
var dataEnrichment = _a.dataEnrichment, tokenParser = _a.tokenParser, riskApiClient = _a.riskApiClient, cors = _a.cors, products = _a.products, graphQLParser = _a.graphQLParser;
|
|
24
|
+
var dataEnrichment = _a.dataEnrichment, tokenParser = _a.tokenParser, riskApiClient = _a.riskApiClient, cors = _a.cors, products = _a.products, graphQLParser = _a.graphQLParser, base64Utils = _a.base64Utils;
|
|
25
25
|
return _super.call(this, [
|
|
26
|
+
new phase_1.BlockByHeaderPhase(config, base64Utils),
|
|
26
27
|
new phase_1.ParseTokenPhase(tokenParser),
|
|
27
28
|
new phase_1.EnrichContextFromRequestPhase(config, products, dataEnrichment, graphQLParser),
|
|
28
29
|
new phase_1.RiskApiPhase(products, riskApiClient),
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockByHeaderPhase = void 0;
|
|
4
|
+
var action_1 = require("../../action/index.js");
|
|
5
|
+
var blocker_1 = require("../../blocker/index.js");
|
|
6
|
+
var products_1 = require("../../products/index.js");
|
|
7
|
+
var captcha_1 = require("../../products/bot_defender/block/captcha/index.js");
|
|
8
|
+
var templates_1 = require("../../products/bot_defender/block/templates/index.js");
|
|
9
|
+
var utils_1 = require("../../utils/index.js");
|
|
10
|
+
/**
|
|
11
|
+
* `BlockByHeaderPhase` checks for the presence of the x-px-block-by-header header.
|
|
12
|
+
* If the header is present with a truthy value ("1", "true", "TRUE"), the request is immediately
|
|
13
|
+
* blocked with a captcha response and the flow is terminated. This feature overrides all other
|
|
14
|
+
* enforcer logic including monitor mode and whitelisting.
|
|
15
|
+
*/
|
|
16
|
+
var BlockByHeaderPhase = /** @class */ (function () {
|
|
17
|
+
function BlockByHeaderPhase(config, base64Utils) {
|
|
18
|
+
this.config = config;
|
|
19
|
+
this.base64Utils = base64Utils;
|
|
20
|
+
}
|
|
21
|
+
BlockByHeaderPhase.prototype.execute = function (context) {
|
|
22
|
+
var headerValue = this.getBlockByHeaderValue(context);
|
|
23
|
+
if (headerValue && this.isTruthyValue(headerValue)) {
|
|
24
|
+
context.logger.debug('block by header detected - creating immediate block response');
|
|
25
|
+
// Set context for proper activity reporting
|
|
26
|
+
this.setBlockingContext(context);
|
|
27
|
+
// Create and return block response immediately
|
|
28
|
+
var blockResponse = this.createBlockResponse(context);
|
|
29
|
+
return { done: true, response: blockResponse };
|
|
30
|
+
}
|
|
31
|
+
return { done: false };
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Creates a captcha block response for the block-by-header feature.
|
|
35
|
+
* @param context - The request context.
|
|
36
|
+
* @returns The block response.
|
|
37
|
+
*/
|
|
38
|
+
BlockByHeaderPhase.prototype.createBlockResponse = function (context) {
|
|
39
|
+
// Use the existing CaptchaBlocker to generate a proper captcha page
|
|
40
|
+
var captchaBlocker = new captcha_1.CaptchaBlocker({
|
|
41
|
+
config: this.config,
|
|
42
|
+
base64Utils: this.base64Utils,
|
|
43
|
+
captchaTemplate: templates_1.CAPTCHA_TEMPLATE,
|
|
44
|
+
});
|
|
45
|
+
return captchaBlocker.createBlockResponse(context);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Gets the value of the x-px-block-by-header header from the request.
|
|
49
|
+
* @param context - The request context.
|
|
50
|
+
* @returns The header value or null if not present.
|
|
51
|
+
*/
|
|
52
|
+
BlockByHeaderPhase.prototype.getBlockByHeaderValue = function (context) {
|
|
53
|
+
return context.requestData.request.headers.get(utils_1.BLOCK_BY_HEADER_NAME) || null;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Checks if the header value is considered truthy for blocking.
|
|
57
|
+
* @param value - The header value to check.
|
|
58
|
+
* @returns True if the value should trigger blocking.
|
|
59
|
+
*/
|
|
60
|
+
BlockByHeaderPhase.prototype.isTruthyValue = function (value) {
|
|
61
|
+
return utils_1.BLOCK_BY_HEADER_TRUTHY_VALUES.includes(value);
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Sets the context properties needed for proper activity reporting.
|
|
65
|
+
* @param context - The request context to modify.
|
|
66
|
+
*/
|
|
67
|
+
BlockByHeaderPhase.prototype.setBlockingContext = function (context) {
|
|
68
|
+
var _a;
|
|
69
|
+
context.action = action_1.Action.BLOCK;
|
|
70
|
+
context.reasons = (_a = {}, _a[products_1.ProductName.BLOCK_BY_HEADER] = utils_1.BLOCK_BY_HEADER_REASON, _a);
|
|
71
|
+
context.score = 100; // Maximum risk score
|
|
72
|
+
context.blockAction = blocker_1.BlockAction.CAPTCHA;
|
|
73
|
+
};
|
|
74
|
+
return BlockByHeaderPhase;
|
|
75
|
+
}());
|
|
76
|
+
exports.BlockByHeaderPhase = BlockByHeaderPhase;
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BlockByHeaderPhase.js"), exports);
|
|
17
18
|
__exportStar(require("./FirstPartyPhase.js"), exports);
|
|
18
19
|
__exportStar(require("./FilterPhase.js"), exports);
|
|
19
20
|
__exportStar(require("./PreflightPhase.js"), exports);
|
|
@@ -189,9 +189,17 @@ var BotDefender = /** @class */ (function () {
|
|
|
189
189
|
BotDefender.prototype.createBlockResponse = function (context) {
|
|
190
190
|
return this.blocker.createBlockResponse(context);
|
|
191
191
|
};
|
|
192
|
-
BotDefender.prototype.modifyIncomingRequest = function (
|
|
192
|
+
BotDefender.prototype.modifyIncomingRequest = function (context) {
|
|
193
193
|
return __awaiter(this, void 0, void 0, function () {
|
|
194
194
|
return __generator(this, function (_a) {
|
|
195
|
+
if (this.config.dataEnrichmentHeaderName && context.pxde && context.pxdeVerified) {
|
|
196
|
+
try {
|
|
197
|
+
context.requestData.request.headers.set(this.config.dataEnrichmentHeaderName, JSON.stringify(context.pxde));
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
context.logger.debug("unable to set data enrichment header: ".concat(err));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
195
203
|
return [2 /*return*/];
|
|
196
204
|
});
|
|
197
205
|
});
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProductName = void 0;
|
|
4
4
|
var ProductName;
|
|
5
5
|
(function (ProductName) {
|
|
6
|
+
ProductName["BLOCK_BY_HEADER"] = "block_by_header";
|
|
6
7
|
ProductName["BOT_DEFENDER"] = "bd";
|
|
7
8
|
ProductName["ACCOUNT_DEFENDER"] = "ad";
|
|
8
9
|
ProductName["CODE_DEFENDER"] = "cd";
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PRODUCT_PRIORITY_ORDER = void 0;
|
|
4
4
|
var ProductName_1 = require("./ProductName.js");
|
|
5
5
|
exports.PRODUCT_PRIORITY_ORDER = [
|
|
6
|
+
ProductName_1.ProductName.BLOCK_BY_HEADER,
|
|
6
7
|
ProductName_1.ProductName.HYPE_SALE_CHALLENGE,
|
|
7
8
|
ProductName_1.ProductName.BOT_DEFENDER,
|
|
8
9
|
ProductName_1.ProductName.ACCOUNT_DEFENDER,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CORE_MODULE_VERSION = exports.REGEX_STRUCTURE = exports.URL_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.PUSH_DATA_FEATURE_HEADER_NAME = exports.PUSH_DATA_HMAC_HEADER_NAME = exports.X_PX_BYPASS_REASON_HEADER_NAME = exports.X_PX_ORIGINAL_TOKEN_HEADER_NAME = exports.X_PX_AUTHORIZATION_HEADER_NAME = exports.UNLIMITED_TIMEOUT = exports.BYPASS_MONITOR_HEADER_VALUE = exports.CD_PXVID_COOKIE_NAME = exports.PXDE_COOKIE_NAME = exports.PXHD_COOKIE_NAME = exports.PXVID_COOKIE_NAME = void 0;
|
|
3
|
+
exports.BLOCK_BY_HEADER_TRUTHY_VALUES = exports.BLOCK_BY_HEADER_REASON = exports.BLOCK_BY_HEADER_NAME = exports.CORE_MODULE_VERSION = exports.REGEX_STRUCTURE = exports.URL_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.PUSH_DATA_FEATURE_HEADER_NAME = exports.PUSH_DATA_HMAC_HEADER_NAME = exports.X_PX_BYPASS_REASON_HEADER_NAME = exports.X_PX_ORIGINAL_TOKEN_HEADER_NAME = exports.X_PX_AUTHORIZATION_HEADER_NAME = exports.UNLIMITED_TIMEOUT = exports.BYPASS_MONITOR_HEADER_VALUE = exports.CD_PXVID_COOKIE_NAME = exports.PXDE_COOKIE_NAME = exports.PXHD_COOKIE_NAME = exports.PXVID_COOKIE_NAME = void 0;
|
|
4
4
|
exports.PXVID_COOKIE_NAME = '_pxvid';
|
|
5
5
|
exports.PXHD_COOKIE_NAME = '_pxhd';
|
|
6
6
|
exports.PXDE_COOKIE_NAME = '_pxde';
|
|
@@ -15,4 +15,7 @@ exports.PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
|
|
|
15
15
|
exports.EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
|
|
16
16
|
exports.URL_REGEX = /^(https?:)\/\/(([^@\s:\/]+):?([^@\s\/]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)(\/?[^?#]*)(\?[^#]*|)(#.*|)$/;
|
|
17
17
|
exports.REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
|
|
18
|
-
exports.CORE_MODULE_VERSION = 'JS Core 0.
|
|
18
|
+
exports.CORE_MODULE_VERSION = 'JS Core 0.32.0';
|
|
19
|
+
exports.BLOCK_BY_HEADER_NAME = 'x-px-block-by-header';
|
|
20
|
+
exports.BLOCK_BY_HEADER_REASON = 'block_by_header';
|
|
21
|
+
exports.BLOCK_BY_HEADER_TRUTHY_VALUES = ['1'];
|
|
@@ -117,6 +117,7 @@ export class ConfigurationBase {
|
|
|
117
117
|
// @ts-ignore
|
|
118
118
|
delete activeConfig[key];
|
|
119
119
|
}
|
|
120
|
+
// Runtime filtering ensures only supported configs remain
|
|
120
121
|
return activeConfig;
|
|
121
122
|
}
|
|
122
123
|
getStaticConfig() {
|
|
@@ -405,6 +406,9 @@ export class ConfigurationBase {
|
|
|
405
406
|
get createCustomSnippet() {
|
|
406
407
|
return this.configParams.px_create_custom_snippet;
|
|
407
408
|
}
|
|
409
|
+
get dataEnrichmentHeaderName() {
|
|
410
|
+
return this.configParams.px_data_enrichment_header_name;
|
|
411
|
+
}
|
|
408
412
|
get enableBlockedUrlOnCaptchaBlockPage() {
|
|
409
413
|
return true;
|
|
410
414
|
}
|
|
@@ -129,6 +129,7 @@ export const defaultConfigurationParams = () => ({
|
|
|
129
129
|
px_remote_config_retry_interval_ms: 1000,
|
|
130
130
|
px_url_decode_reserved_characters: false,
|
|
131
131
|
px_secured_pxhd_enabled: false,
|
|
132
|
+
px_data_enrichment_header_name: '',
|
|
132
133
|
px_snippet_injection_enabled: false,
|
|
133
134
|
px_create_custom_snippet: null,
|
|
134
135
|
px_custom_is_sensitive_request: null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AdditionalActivityHandlerPhase, CreateBlockResponsePhase, EnrichContextFromRequestPhase, ModifyIncomingRequestPhase, ParseTokenPhase, RiskApiPhase, } from '../phase/index.js';
|
|
1
|
+
import { AdditionalActivityHandlerPhase, BlockByHeaderPhase, CreateBlockResponsePhase, EnrichContextFromRequestPhase, ModifyIncomingRequestPhase, ParseTokenPhase, RiskApiPhase, } from '../phase/index.js';
|
|
2
2
|
import { Flow } from './Flow.js';
|
|
3
3
|
export class EnforceFlow extends Flow {
|
|
4
|
-
constructor(config, { dataEnrichment, tokenParser, riskApiClient, cors, products, graphQLParser, }) {
|
|
4
|
+
constructor(config, { dataEnrichment, tokenParser, riskApiClient, cors, products, graphQLParser, base64Utils, }) {
|
|
5
5
|
super([
|
|
6
|
+
new BlockByHeaderPhase(config, base64Utils),
|
|
6
7
|
new ParseTokenPhase(tokenParser),
|
|
7
8
|
new EnrichContextFromRequestPhase(config, products, dataEnrichment, graphQLParser),
|
|
8
9
|
new RiskApiPhase(products, riskApiClient),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Action } from '../../action/index.js';
|
|
2
|
+
import { BlockAction } from '../../blocker/index.js';
|
|
3
|
+
import { ProductName } from '../../products/index.js';
|
|
4
|
+
import { CaptchaBlocker } from '../../products/bot_defender/block/captcha/index.js';
|
|
5
|
+
import { CAPTCHA_TEMPLATE } from '../../products/bot_defender/block/templates/index.js';
|
|
6
|
+
import { BLOCK_BY_HEADER_NAME, BLOCK_BY_HEADER_REASON, BLOCK_BY_HEADER_TRUTHY_VALUES } from '../../utils/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* `BlockByHeaderPhase` checks for the presence of the x-px-block-by-header header.
|
|
9
|
+
* If the header is present with a truthy value ("1", "true", "TRUE"), the request is immediately
|
|
10
|
+
* blocked with a captcha response and the flow is terminated. This feature overrides all other
|
|
11
|
+
* enforcer logic including monitor mode and whitelisting.
|
|
12
|
+
*/
|
|
13
|
+
export class BlockByHeaderPhase {
|
|
14
|
+
config;
|
|
15
|
+
base64Utils;
|
|
16
|
+
constructor(config, base64Utils) {
|
|
17
|
+
this.config = config;
|
|
18
|
+
this.base64Utils = base64Utils;
|
|
19
|
+
}
|
|
20
|
+
execute(context) {
|
|
21
|
+
const headerValue = this.getBlockByHeaderValue(context);
|
|
22
|
+
if (headerValue && this.isTruthyValue(headerValue)) {
|
|
23
|
+
context.logger.debug('block by header detected - creating immediate block response');
|
|
24
|
+
// Set context for proper activity reporting
|
|
25
|
+
this.setBlockingContext(context);
|
|
26
|
+
// Create and return block response immediately
|
|
27
|
+
const blockResponse = this.createBlockResponse(context);
|
|
28
|
+
return { done: true, response: blockResponse };
|
|
29
|
+
}
|
|
30
|
+
return { done: false };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a captcha block response for the block-by-header feature.
|
|
34
|
+
* @param context - The request context.
|
|
35
|
+
* @returns The block response.
|
|
36
|
+
*/
|
|
37
|
+
createBlockResponse(context) {
|
|
38
|
+
// Use the existing CaptchaBlocker to generate a proper captcha page
|
|
39
|
+
const captchaBlocker = new CaptchaBlocker({
|
|
40
|
+
config: this.config,
|
|
41
|
+
base64Utils: this.base64Utils,
|
|
42
|
+
captchaTemplate: CAPTCHA_TEMPLATE,
|
|
43
|
+
});
|
|
44
|
+
return captchaBlocker.createBlockResponse(context);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Gets the value of the x-px-block-by-header header from the request.
|
|
48
|
+
* @param context - The request context.
|
|
49
|
+
* @returns The header value or null if not present.
|
|
50
|
+
*/
|
|
51
|
+
getBlockByHeaderValue(context) {
|
|
52
|
+
return context.requestData.request.headers.get(BLOCK_BY_HEADER_NAME) || null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the header value is considered truthy for blocking.
|
|
56
|
+
* @param value - The header value to check.
|
|
57
|
+
* @returns True if the value should trigger blocking.
|
|
58
|
+
*/
|
|
59
|
+
isTruthyValue(value) {
|
|
60
|
+
return BLOCK_BY_HEADER_TRUTHY_VALUES.includes(value);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Sets the context properties needed for proper activity reporting.
|
|
64
|
+
* @param context - The request context to modify.
|
|
65
|
+
*/
|
|
66
|
+
setBlockingContext(context) {
|
|
67
|
+
context.action = Action.BLOCK;
|
|
68
|
+
context.reasons = { [ProductName.BLOCK_BY_HEADER]: BLOCK_BY_HEADER_REASON };
|
|
69
|
+
context.score = 100; // Maximum risk score
|
|
70
|
+
context.blockAction = BlockAction.CAPTCHA;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -101,8 +101,15 @@ export class BotDefender {
|
|
|
101
101
|
createBlockResponse(context) {
|
|
102
102
|
return this.blocker.createBlockResponse(context);
|
|
103
103
|
}
|
|
104
|
-
async modifyIncomingRequest(
|
|
105
|
-
|
|
104
|
+
async modifyIncomingRequest(context) {
|
|
105
|
+
if (this.config.dataEnrichmentHeaderName && context.pxde && context.pxdeVerified) {
|
|
106
|
+
try {
|
|
107
|
+
context.requestData.request.headers.set(this.config.dataEnrichmentHeaderName, JSON.stringify(context.pxde));
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
context.logger.debug(`unable to set data enrichment header: ${err}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
106
113
|
}
|
|
107
114
|
async modifyOutgoingResponse(_context) {
|
|
108
115
|
// intentionally left blank
|
|
@@ -12,4 +12,7 @@ export const PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
|
|
|
12
12
|
export const EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
|
|
13
13
|
export const URL_REGEX = /^(https?:)\/\/(([^@\s:\/]+):?([^@\s\/]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)(\/?[^?#]*)(\?[^#]*|)(#.*|)$/;
|
|
14
14
|
export const REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
|
|
15
|
-
export const CORE_MODULE_VERSION = 'JS Core 0.
|
|
15
|
+
export const CORE_MODULE_VERSION = 'JS Core 0.32.0';
|
|
16
|
+
export const BLOCK_BY_HEADER_NAME = 'x-px-block-by-header';
|
|
17
|
+
export const BLOCK_BY_HEADER_REASON = 'block_by_header';
|
|
18
|
+
export const BLOCK_BY_HEADER_TRUTHY_VALUES = ['1'];
|
|
@@ -7,15 +7,15 @@ import { ILogger } from '../logger';
|
|
|
7
7
|
/**
|
|
8
8
|
* The HttpActivityClient is responsible for sending async activities to the backend via HTTP.
|
|
9
9
|
*/
|
|
10
|
-
export declare class HttpActivityClient<Req, Res,
|
|
11
|
-
protected readonly config: IConfiguration<Req, Res,
|
|
10
|
+
export declare class HttpActivityClient<Req, Res, Supported extends string, Added> implements IActivityClient<Req, Res> {
|
|
11
|
+
protected readonly config: IConfiguration<Req, Res, Supported, Added>;
|
|
12
12
|
protected readonly httpClient: IHttpClient;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of HttpActivityClient.
|
|
15
15
|
* @param config
|
|
16
16
|
* @param httpClient
|
|
17
17
|
*/
|
|
18
|
-
constructor(config: IConfiguration<Req, Res,
|
|
18
|
+
constructor(config: IConfiguration<Req, Res, Supported, Added>, httpClient: IHttpClient);
|
|
19
19
|
/**
|
|
20
20
|
* Creates and sends all necessary async activities to the backend.
|
|
21
21
|
* @param context - The context containing the request (and possibly response).
|
|
@@ -10,14 +10,14 @@ import { ILogger } from '../logger';
|
|
|
10
10
|
* This class uses setTimeout and clearTimeout for managing the timeout for sending activities. It also exposes the stop()
|
|
11
11
|
* method to stop the timer and prevent further activity sending, which should be called on shutdown.
|
|
12
12
|
*/
|
|
13
|
-
export declare class HttpBatchedActivityClient<Req, Res,
|
|
13
|
+
export declare class HttpBatchedActivityClient<Req, Res, Supported extends string, Added> extends HttpActivityClient<Req, Res, Supported, Added> {
|
|
14
14
|
private readonly batchSize;
|
|
15
15
|
private readonly timeoutMs;
|
|
16
16
|
private readonly maxBufferSize;
|
|
17
17
|
private buffer;
|
|
18
18
|
private timeoutId;
|
|
19
19
|
private shouldKill;
|
|
20
|
-
constructor(config: IConfiguration<Req, Res,
|
|
20
|
+
constructor(config: IConfiguration<Req, Res, Supported, Added>, httpClient: IHttpClient);
|
|
21
21
|
stop(): void;
|
|
22
22
|
protected postActivities(activities: AsyncActivity[], logger: ILogger): Promise<boolean>;
|
|
23
23
|
protected addToBuffer(activities: AsyncActivity[]): void;
|
|
@@ -12,7 +12,7 @@ import { CustomParameters, ResponseCustomParameters } from '../custom_parameters
|
|
|
12
12
|
* @param context - The request context.
|
|
13
13
|
* @returns {AsyncActivity} - The complete async activity payload.
|
|
14
14
|
*/
|
|
15
|
-
export declare const createAsyncActivity: <Req, Res,
|
|
15
|
+
export declare const createAsyncActivity: <Req, Res, Supported extends string, Added>(activityType: ActivityType, config: IConfiguration<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>) => AsyncActivity;
|
|
16
16
|
/**
|
|
17
17
|
* Creates activity details based on the provided parameters.
|
|
18
18
|
* @param activityType - The activity type to create.
|
|
@@ -20,12 +20,12 @@ export declare const createAsyncActivity: <Req, Res, Added, Removed>(activityTyp
|
|
|
20
20
|
* @param context - The request context.
|
|
21
21
|
* @returns {AsyncActivityDetails} - The activity details.
|
|
22
22
|
*/
|
|
23
|
-
export declare const createActivityDetails: <Req, Res,
|
|
23
|
+
export declare const createActivityDetails: <Req, Res, Supported extends string, Added>(activityType: ActivityType, config: IConfiguration<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>) => AsyncActivityDetails;
|
|
24
24
|
export declare const createAsyncActivityCommonDetails: <Req, Res>(context: ReadonlyContext<Req, Res>) => AsyncActivityCommonDetails;
|
|
25
|
-
export declare const createCommonActivityDetails: <Req, Res,
|
|
25
|
+
export declare const createCommonActivityDetails: <Req, Res, Supported extends string, Added>(config: IConfiguration<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>) => CommonActivityDetails;
|
|
26
26
|
export declare const addRootContextDataToDetails: <Req, Res>(details: CommonActivityDetails, context: ReadonlyContext<Req, Res>) => void;
|
|
27
27
|
export declare function redactCookieSecret(secret: string): string;
|
|
28
|
-
export declare const addConfigDataToDetails: <Req, Res,
|
|
28
|
+
export declare const addConfigDataToDetails: <Req, Res, Supported extends string, Added>(details: CommonActivityDetails, config: IConfiguration<Req, Res, Supported, Added>) => void;
|
|
29
29
|
export declare const addCustomParametersToDetails: (details: CommonActivityDetails, customParameters: CustomParameters | null, responseCustomParameters: ResponseCustomParameters | null) => void;
|
|
30
30
|
export declare const addProductDataToDetails: (details: CommonActivityDetails, productData: DeepReadonly<ProductData>) => void;
|
|
31
31
|
export declare const addTlsDataToDetails: (details: CommonActivityDetails, tlsData: DeepReadonly<TlsData>) => void;
|
|
@@ -36,5 +36,5 @@ export declare const addRiskApiDataToAsyncActivityCommonDetails: <Req, Res>(deta
|
|
|
36
36
|
export declare const addResponseDataToAsyncActivityCommonDetails: <Req, Res>(details: AsyncActivityCommonDetails, context: ReadonlyContext<Req, Res>) => void;
|
|
37
37
|
export declare const createPageRequestedActivityDetails: <Req, Res>(context: ReadonlyContext<Req, Res>) => PageRequestedActivityDetails;
|
|
38
38
|
export declare const createBlockActivityDetails: <Req, Res>(context: ReadonlyContext<Req, Res>) => BlockActivityDetails;
|
|
39
|
-
export declare const createAdditionalS2SActivityDetails: <Req, Res,
|
|
39
|
+
export declare const createAdditionalS2SActivityDetails: <Req, Res, Supported extends string, Added>({ ciSendRawUsernameOnAdditionalS2SActivity }: IConfiguration<Req, Res, Supported, Added>, { productData }: ReadonlyContext<Req, Res>) => AdditionalS2SActivityDetails;
|
|
40
40
|
export declare const toHeaderEntryArray: (headers: Record<string, string[]>) => HeaderEntry[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReadonlyContext } from '../context';
|
|
2
2
|
import { ActiveConfigurationParams } from '../config';
|
|
3
|
-
export type AdditionalActivityHandler<Req, Res,
|
|
3
|
+
export type AdditionalActivityHandler<Req, Res, Supported extends string, Added> = (config: ActiveConfigurationParams<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>, request: Req) => void | Promise<void>;
|
|
@@ -7,5 +7,5 @@ export declare namespace AdditionalActivityHandlerUtils {
|
|
|
7
7
|
* @param context - The request context.
|
|
8
8
|
* @returns {Promise<void>} - A promise that resolves when the additional activity handler is complete.
|
|
9
9
|
*/
|
|
10
|
-
const invokeAdditionalActivityHandler: <Req, Res,
|
|
10
|
+
const invokeAdditionalActivityHandler: <Req, Res, Supported extends string, Added>(config: IConfiguration<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>) => Promise<void>;
|
|
11
11
|
}
|
|
@@ -3,11 +3,11 @@ import { ReadonlyContext } from '../context';
|
|
|
3
3
|
import { IBase64Utils } from '../utils';
|
|
4
4
|
import { IConditionalBlocker } from '../blocker';
|
|
5
5
|
import { BlockerBase } from './BlockerBase';
|
|
6
|
-
export declare class MobileBlocker<Req, Res,
|
|
7
|
-
protected readonly config: IConfiguration<Req, Res,
|
|
6
|
+
export declare class MobileBlocker<Req, Res, Supported extends string, Added> extends BlockerBase<Req, Res> implements IConditionalBlocker<Req, Res> {
|
|
7
|
+
protected readonly config: IConfiguration<Req, Res, Supported, Added>;
|
|
8
8
|
protected readonly base64Utils: IBase64Utils;
|
|
9
9
|
protected readonly template: string;
|
|
10
|
-
constructor(config: IConfiguration<Req, Res,
|
|
10
|
+
constructor(config: IConfiguration<Req, Res, Supported, Added>, base64Utils: IBase64Utils, template: string);
|
|
11
11
|
shouldBlock(context: ReadonlyContext<Req, Res>): boolean;
|
|
12
12
|
protected createBlockBody(context: ReadonlyContext<Req, Res>): string;
|
|
13
13
|
}
|
|
@@ -16,4 +16,4 @@ export declare const renderHtml: (htmlTemplate: string, blockData?: BlockData) =
|
|
|
16
16
|
* @param base64Utils - The base64 utility functions.
|
|
17
17
|
* @returns {BlockData} - The block data object.
|
|
18
18
|
*/
|
|
19
|
-
export declare const createBlockData: <Req, Res,
|
|
19
|
+
export declare const createBlockData: <Req, Res, Supported extends string, Added>(config: IConfiguration<Req, Res, Supported, Added>, context: ReadonlyContext<Req, Res>, base64Utils: IBase64Utils) => BlockData;
|
|
@@ -14,12 +14,12 @@ import { CustomSnippetFunction } from '../snippet_injection';
|
|
|
14
14
|
/**
|
|
15
15
|
* Base class for the enforcer configuration.
|
|
16
16
|
*/
|
|
17
|
-
export declare abstract class ConfigurationBase<Req, Res,
|
|
18
|
-
protected configParams: RequiredAllConfigurationParams<Req, Res,
|
|
19
|
-
protected readonly staticConfigParams: StaticConfigurationParams<Req, Res,
|
|
20
|
-
protected remoteConfigData?: RemoteConfigData<Req, Res,
|
|
21
|
-
protected readonly defaultConfigParams: RequiredAllConfigurationParams<Req, Res,
|
|
22
|
-
protected readonly removedParams: Record<
|
|
17
|
+
export declare abstract class ConfigurationBase<Req, Res, Supported extends string, Added> implements IConfiguration<Req, Res, Supported, Added> {
|
|
18
|
+
protected configParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>;
|
|
19
|
+
protected readonly staticConfigParams: StaticConfigurationParams<Req, Res, Supported, Added>;
|
|
20
|
+
protected remoteConfigData?: RemoteConfigData<Req, Res, Supported, Added>;
|
|
21
|
+
protected readonly defaultConfigParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>;
|
|
22
|
+
protected readonly removedParams: Record<Exclude<keyof CoreConfigurationParams<Req, Res, Supported, Added>, Supported>, undefined>;
|
|
23
23
|
private internalLogger;
|
|
24
24
|
/**
|
|
25
25
|
* Returns the module version of the enforcer.
|
|
@@ -40,18 +40,18 @@ export declare abstract class ConfigurationBase<Req, Res, Added, Removed extends
|
|
|
40
40
|
* @param removedParams - A map of all removed (unsupported) configuration parameters set to undefined. This parameter can be generated automatically by your IDE.
|
|
41
41
|
* @protected
|
|
42
42
|
*/
|
|
43
|
-
protected constructor(params: StaticConfigurationParams<Req, Res,
|
|
44
|
-
protected createActiveConfiguration(params: AllConfigurationParams<Req, Res,
|
|
45
|
-
protected throwIfMissingRequiredField(params: AllConfigurationParams<Req, Res,
|
|
46
|
-
protected getValidConfigValue<K extends keyof RequiredAllConfigurationParams<Req, Res,
|
|
47
|
-
protected isValidConfigValue(params: AllConfigurationParams<Req, Res,
|
|
48
|
-
protected getDefaultConfigurationValue<K extends keyof RequiredAllConfigurationParams<Req, Res,
|
|
49
|
-
protected normalizeConfigurationValue<K extends keyof RequiredAllConfigurationParams<Req, Res,
|
|
50
|
-
protected createInternalLogger(params: RequiredAllConfigurationParams<Req, Res,
|
|
51
|
-
setRemoteConfigData(remoteConfigData: RemoteConfigData<Req, Res,
|
|
52
|
-
getActiveConfig(): ActiveConfigurationParams<Req, Res,
|
|
53
|
-
getStaticConfig(): StaticConfigurationParams<Req, Res,
|
|
54
|
-
getRemoteConfig(): RemoteConfigurationParams<Req, Res,
|
|
43
|
+
protected constructor(params: StaticConfigurationParams<Req, Res, Supported, Added>, defaultParams: Required<Added> & Partial<CoreConfigurationParams<Req, Res, Supported, Added>>, removedParams: Record<Exclude<keyof CoreConfigurationParams<Req, Res, Supported, Added>, Supported>, undefined>);
|
|
44
|
+
protected createActiveConfiguration(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>): RequiredAllConfigurationParams<Req, Res, Supported, Added>;
|
|
45
|
+
protected throwIfMissingRequiredField(params: AllConfigurationParams<Req, Res, Supported, Added>): void;
|
|
46
|
+
protected getValidConfigValue<K extends keyof RequiredAllConfigurationParams<Req, Res, Supported, Added>, V extends RequiredAllConfigurationParams<Req, Res, Supported, Added>[K]>(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>, key: K): V;
|
|
47
|
+
protected isValidConfigValue(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>, key: keyof RequiredAllConfigurationParams<Req, Res, Supported, Added>): boolean;
|
|
48
|
+
protected getDefaultConfigurationValue<K extends keyof RequiredAllConfigurationParams<Req, Res, Supported, Added>, V extends RequiredAllConfigurationParams<Req, Res, Supported, Added>[K]>(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>, key: K): V;
|
|
49
|
+
protected normalizeConfigurationValue<K extends keyof RequiredAllConfigurationParams<Req, Res, Supported, Added>, V extends RequiredAllConfigurationParams<Req, Res, Supported, Added>[K]>(params: AllConfigurationParams<Req, Res, Supported, Added>, key: K): V;
|
|
50
|
+
protected createInternalLogger(params: RequiredAllConfigurationParams<Req, Res, Supported, Added>): ILogger;
|
|
51
|
+
setRemoteConfigData(remoteConfigData: RemoteConfigData<Req, Res, Supported, Added>): void;
|
|
52
|
+
getActiveConfig(): ActiveConfigurationParams<Req, Res, Supported, Added>;
|
|
53
|
+
getStaticConfig(): StaticConfigurationParams<Req, Res, Supported, Added>;
|
|
54
|
+
getRemoteConfig(): RemoteConfigurationParams<Req, Res, Supported, Added>;
|
|
55
55
|
get moduleVersion(): string;
|
|
56
56
|
get logger(): ILogger;
|
|
57
57
|
get appId(): string;
|
|
@@ -105,9 +105,9 @@ export declare abstract class ConfigurationBase<Req, Res, Added, Removed extends
|
|
|
105
105
|
get extractGraphQLKeywords(): ExtractGraphQLKeywordsFunction | null;
|
|
106
106
|
get sensitiveGraphqlOperationNames(): Array<string | RegExp>;
|
|
107
107
|
get sensitiveGraphqlOperationTypes(): string[];
|
|
108
|
-
get enrichCustomParameters(): CustomParametersFunction<Req, Res,
|
|
109
|
-
get enrichResponseCustomParameters(): ResponseCustomParametersFunction<Req, Res,
|
|
110
|
-
get additionalActivityHandler(): AdditionalActivityHandler<Req, Res,
|
|
108
|
+
get enrichCustomParameters(): CustomParametersFunction<Req, Res, Supported, Added> | null;
|
|
109
|
+
get enrichResponseCustomParameters(): ResponseCustomParametersFunction<Req, Res, Supported, Added> | null;
|
|
110
|
+
get additionalActivityHandler(): AdditionalActivityHandler<Req, Res, Supported, Added> | null;
|
|
111
111
|
get altBackendCaptchaUrl(): string;
|
|
112
112
|
get corsSupportEnabled(): boolean;
|
|
113
113
|
get corsCustomPreflightHandler(): CustomPreflightHandler<Req> | null;
|
|
@@ -142,7 +142,8 @@ export declare abstract class ConfigurationBase<Req, Res, Added, Removed extends
|
|
|
142
142
|
get securedPxhdEnabled(): boolean;
|
|
143
143
|
get tokenVersion(): `${TokenVersion}`;
|
|
144
144
|
get snippetInjectionEnabled(): boolean;
|
|
145
|
-
get createCustomSnippet(): CustomSnippetFunction<Req, Res,
|
|
145
|
+
get createCustomSnippet(): CustomSnippetFunction<Req, Res, Supported, Added> | null;
|
|
146
|
+
get dataEnrichmentHeaderName(): string;
|
|
146
147
|
get enableBlockedUrlOnCaptchaBlockPage(): boolean;
|
|
147
148
|
get awaitAsyncHttpRequests(): boolean;
|
|
148
149
|
get isPostEnforceEnabled(): boolean;
|