perimeterx-js-core 0.15.2 → 0.16.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/activities/HttpActivityClient.js +4 -4
- package/lib/cjs/activities/HttpBatchedActivityClient.js +7 -7
- package/lib/cjs/additional_activity_handler/AdditionalActivityHandlerUtils.js +2 -2
- package/lib/cjs/config/ConfigurationBase.js +4 -1
- package/lib/cjs/config/remote_config/DefaultRemoteConfigUpdater.js +25 -30
- package/lib/cjs/config/remote_config/RemoteConfigUtils.js +14 -0
- package/lib/cjs/config/remote_config/index.js +1 -0
- package/lib/cjs/context/DefaultContext.js +18 -7
- package/lib/cjs/custom_parameters/CustomParametersUtils.js +1 -1
- package/lib/cjs/enforcer/EnforcerBase.js +40 -31
- package/lib/cjs/graphql/DefaultGraphQLParser.js +20 -22
- package/lib/cjs/impl/url/DefaultUrlUtils.js +7 -1
- package/lib/cjs/logger/DefaultLogger.js +2 -2
- package/lib/cjs/logger/HttpLogServiceClient.js +32 -27
- package/lib/cjs/logger/LoggerBase.js +5 -1
- package/lib/cjs/monitored_request/MonitoredRequestUtils.js +8 -8
- package/lib/cjs/phase/impl/CreateBlockResponsePhase.js +2 -2
- package/lib/cjs/phase/impl/DecideActionPhase.js +3 -4
- package/lib/cjs/phase/impl/EnrichContextFromRequestPhase.js +3 -2
- package/lib/cjs/phase/impl/EnrichContextFromResponsePhase.js +1 -1
- package/lib/cjs/phase/impl/FirstPartyPhase.js +4 -4
- package/lib/cjs/phase/impl/RiskApiPhase.js +1 -1
- package/lib/cjs/phase/impl/SendLogsPhase.js +2 -2
- package/lib/cjs/phase/impl/UpdateRemoteConfigPhase.js +0 -1
- package/lib/cjs/products/account_defender/AccountDefender.js +9 -8
- package/lib/cjs/products/bot_defender/filter/DefaultBotDefenderFilter.js +10 -10
- package/lib/cjs/products/bot_defender/first_party/DefaultBotDefenderFirstParty.js +17 -17
- package/lib/cjs/products/credential_intelligence/endpoint/CredentialEndpoint.js +8 -9
- package/lib/cjs/products/credential_intelligence/endpoint/CredentialEndpointManager.js +13 -15
- package/lib/cjs/pxde/DefaultDataEnrichment.js +11 -11
- package/lib/cjs/risk_api/client/PostRiskApiClientBase.js +5 -5
- package/lib/cjs/risk_token/parser/TokenParserBase.js +12 -13
- package/lib/cjs/risk_token/token/v2/DefaultTokenV2.js +5 -5
- package/lib/cjs/risk_token/token/v3/DefaultTokenV3.js +11 -11
- package/lib/cjs/sensitive_request/SensitiveRequestUtils.js +4 -4
- package/lib/cjs/telemetry/DefaultTelemetry.js +7 -7
- package/lib/cjs/utils/constants.js +1 -1
- package/lib/cjs/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.js +7 -7
- package/lib/esm/activities/HttpActivityClient.js +4 -4
- package/lib/esm/activities/HttpBatchedActivityClient.js +7 -7
- package/lib/esm/additional_activity_handler/AdditionalActivityHandlerUtils.js +2 -2
- package/lib/esm/config/ConfigurationBase.js +4 -1
- package/lib/esm/config/remote_config/DefaultRemoteConfigUpdater.js +21 -23
- package/lib/esm/config/remote_config/RemoteConfigUtils.js +9 -0
- package/lib/esm/config/remote_config/index.js +1 -0
- package/lib/esm/context/DefaultContext.js +18 -8
- package/lib/esm/custom_parameters/CustomParametersUtils.js +1 -1
- package/lib/esm/enforcer/EnforcerBase.js +18 -7
- package/lib/esm/graphql/DefaultGraphQLParser.js +9 -10
- package/lib/esm/impl/url/DefaultUrlUtils.js +7 -1
- package/lib/esm/logger/DefaultLogger.js +2 -2
- package/lib/esm/logger/HttpLogServiceClient.js +25 -27
- package/lib/esm/logger/LoggerBase.js +6 -1
- package/lib/esm/monitored_request/MonitoredRequestUtils.js +8 -8
- package/lib/esm/phase/impl/CreateBlockResponsePhase.js +2 -2
- package/lib/esm/phase/impl/DecideActionPhase.js +2 -6
- package/lib/esm/phase/impl/EnrichContextFromRequestPhase.js +4 -2
- package/lib/esm/phase/impl/EnrichContextFromResponsePhase.js +1 -1
- package/lib/esm/phase/impl/FirstPartyPhase.js +4 -4
- package/lib/esm/phase/impl/RiskApiPhase.js +1 -1
- package/lib/esm/phase/impl/SendLogsPhase.js +2 -2
- package/lib/esm/phase/impl/UpdateRemoteConfigPhase.js +0 -1
- package/lib/esm/products/account_defender/AccountDefender.js +9 -8
- package/lib/esm/products/bot_defender/filter/DefaultBotDefenderFilter.js +8 -8
- package/lib/esm/products/bot_defender/first_party/DefaultBotDefenderFirstParty.js +16 -15
- package/lib/esm/products/credential_intelligence/endpoint/CredentialEndpoint.js +8 -10
- package/lib/esm/products/credential_intelligence/endpoint/CredentialEndpointManager.js +5 -5
- package/lib/esm/pxde/DefaultDataEnrichment.js +11 -11
- package/lib/esm/risk_api/client/PostRiskApiClientBase.js +5 -5
- package/lib/esm/risk_token/parser/TokenParserBase.js +12 -11
- package/lib/esm/risk_token/token/v2/DefaultTokenV2.js +5 -5
- package/lib/esm/risk_token/token/v3/DefaultTokenV3.js +11 -11
- package/lib/esm/sensitive_request/SensitiveRequestUtils.js +4 -4
- package/lib/esm/telemetry/DefaultTelemetry.js +7 -7
- package/lib/esm/utils/constants.js +1 -1
- package/lib/esm/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.js +7 -7
- package/lib/types/activities/HttpActivityClient.d.ts +4 -3
- package/lib/types/activities/HttpBatchedActivityClient.d.ts +8 -7
- package/lib/types/activities/utils.d.ts +270 -0
- package/lib/types/blocker/utils.d.ts +27 -0
- package/lib/types/config/ConfigurationBase.d.ts +6 -5
- package/lib/types/config/remote_config/DefaultRemoteConfigUpdater.d.ts +5 -5
- package/lib/types/config/remote_config/RemoteConfigUtils.d.ts +4 -0
- package/lib/types/config/remote_config/index.d.ts +1 -0
- package/lib/types/context/DefaultContext.d.ts +7 -2
- package/lib/types/context/interfaces/IContext.d.ts +11 -2
- package/lib/types/enforcer/EnforcerBase.d.ts +2 -1
- package/lib/types/graphql/DefaultGraphQLParser.d.ts +1 -2
- package/lib/types/logger/DefaultLogger.d.ts +1 -1
- package/lib/types/logger/HttpLogServiceClient.d.ts +5 -10
- package/lib/types/logger/ILogServiceClient.d.ts +1 -2
- package/lib/types/logger/LoggerBase.d.ts +2 -1
- package/lib/types/logger/model/LogMetadata.d.ts +1 -0
- package/lib/types/monitored_request/MonitoredRequestUtils.d.ts +1353 -2
- package/lib/types/phase/impl/DecideActionPhase.d.ts +0 -3
- package/lib/types/phase/impl/EnrichContextFromRequestPhase.d.ts +1 -0
- package/lib/types/phase/impl/FirstPartyPhase.d.ts +1 -1
- package/lib/types/products/account_defender/AccountDefender.d.ts +4 -5
- package/lib/types/products/bot_defender/filter/DefaultBotDefenderFilter.d.ts +2 -3
- package/lib/types/products/bot_defender/first_party/DefaultBotDefenderFirstParty.d.ts +3 -4
- package/lib/types/products/credential_intelligence/endpoint/CredentialEndpoint.d.ts +3 -5
- package/lib/types/products/credential_intelligence/endpoint/CredentialEndpointManager.d.ts +2 -2
- package/lib/types/products/credential_intelligence/endpoint/ICredentialEndpoint.d.ts +3 -4
- package/lib/types/pxhd/PXHDUtils.d.ts +54 -0
- package/lib/types/risk_api/client/PostRiskApiClientBase.d.ts +1 -1
- package/lib/types/risk_token/parser/TokenParserBase.d.ts +4 -5
- package/lib/types/risk_token/token/v3/DefaultTokenV3.d.ts +1 -1
- package/lib/types/sensitive_request/SensitiveRequestUtils.d.ts +705 -17
- package/lib/types/telemetry/DefaultTelemetry.d.ts +1 -1
- package/lib/types/utils/constants.d.ts +1 -1
- package/lib/types/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.d.ts +3 -2
- package/lib/types/utils/timestamp_hmac_header_validator/ITimestampHmacHeaderValidator.d.ts +2 -1
- package/package.json +1 -1
|
@@ -53,52 +53,57 @@ var http_1 = require("../http");
|
|
|
53
53
|
var utils_1 = require("../utils");
|
|
54
54
|
var HttpLogServiceClient = /** @class */ (function () {
|
|
55
55
|
function HttpLogServiceClient(config, httpClient) {
|
|
56
|
-
this.
|
|
57
|
-
this.backendUrl = config.backendScoreApiUrl;
|
|
58
|
-
this.loggerAuthToken = config.loggerAuthToken;
|
|
59
|
-
this.remoteConfigId = config.remoteConfigId;
|
|
60
|
-
this.remoteConfigVersion = config.remoteConfigVersion;
|
|
61
|
-
this.logger = config.logger;
|
|
56
|
+
this.config = config;
|
|
62
57
|
this.httpClient = httpClient;
|
|
63
58
|
}
|
|
64
|
-
HttpLogServiceClient.prototype.sendLogs = function (context
|
|
59
|
+
HttpLogServiceClient.prototype.sendLogs = function (context) {
|
|
65
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
-
var enrichedLogs, e_1;
|
|
61
|
+
var logs, logMetadata_1, enrichedLogs, e_1;
|
|
67
62
|
var _this = this;
|
|
68
63
|
return __generator(this, function (_a) {
|
|
69
64
|
switch (_a.label) {
|
|
70
65
|
case 0:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return [4 /*yield*/, this.postLogs(enrichedLogs)];
|
|
66
|
+
logs = context.logger.getLogs();
|
|
67
|
+
_a.label = 1;
|
|
74
68
|
case 1:
|
|
75
|
-
_a.
|
|
76
|
-
|
|
69
|
+
_a.trys.push([1, 3, , 4]);
|
|
70
|
+
logMetadata_1 = this.getLogMetadata(context);
|
|
71
|
+
enrichedLogs = logs.map(function (log) { return _this.enrichLogRecord(log, logMetadata_1); });
|
|
72
|
+
return [4 /*yield*/, this.postLogs(enrichedLogs)];
|
|
77
73
|
case 2:
|
|
74
|
+
_a.sent();
|
|
75
|
+
return [3 /*break*/, 4];
|
|
76
|
+
case 3:
|
|
78
77
|
e_1 = _a.sent();
|
|
79
|
-
this.logger.error("
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
this.config.logger.error("logs for ".concat(context.requestId, ": ").concat(JSON.stringify(logs)));
|
|
79
|
+
this.config.logger.error("unable to send logs: ".concat(e_1));
|
|
80
|
+
return [3 /*break*/, 4];
|
|
81
|
+
case 4: return [2 /*return*/];
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
HttpLogServiceClient.prototype.
|
|
87
|
-
var _a = context.requestData, method = _a.method, url = _a.url, rawUrl = _a.rawUrl;
|
|
88
|
-
var
|
|
86
|
+
HttpLogServiceClient.prototype.getLogMetadata = function (context) {
|
|
87
|
+
var requestId = context.requestId, _a = context.requestData, method = _a.method, url = _a.url, rawUrl = _a.rawUrl;
|
|
88
|
+
var _b = this.config, appId = _b.appId, moduleVersion = _b.moduleVersion, remoteConfigId = _b.remoteConfigId, remoteConfigVersion = _b.remoteConfigVersion;
|
|
89
|
+
var logMetadata = {
|
|
89
90
|
container: 'enforcer',
|
|
90
|
-
appID:
|
|
91
|
+
appID: appId,
|
|
91
92
|
method: method,
|
|
92
93
|
host: url.host,
|
|
93
94
|
url: rawUrl,
|
|
94
95
|
path: url.pathname + url.search,
|
|
95
|
-
requestId:
|
|
96
|
+
requestId: requestId,
|
|
97
|
+
moduleVersion: moduleVersion,
|
|
96
98
|
};
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
if (remoteConfigId && remoteConfigVersion) {
|
|
100
|
+
logMetadata.remoteConfigID = remoteConfigId;
|
|
101
|
+
logMetadata.remoteConfigVersion = remoteConfigVersion;
|
|
100
102
|
}
|
|
101
|
-
return
|
|
103
|
+
return logMetadata;
|
|
104
|
+
};
|
|
105
|
+
HttpLogServiceClient.prototype.enrichLogRecord = function (log, logMetadata) {
|
|
106
|
+
return __assign(__assign({}, logMetadata), log);
|
|
102
107
|
};
|
|
103
108
|
HttpLogServiceClient.prototype.postLogs = function (logRecords) {
|
|
104
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -107,11 +112,11 @@ var HttpLogServiceClient = /** @class */ (function () {
|
|
|
107
112
|
return __generator(this, function (_b) {
|
|
108
113
|
switch (_b.label) {
|
|
109
114
|
case 0:
|
|
110
|
-
url = "".concat(this.
|
|
115
|
+
url = "".concat(this.config.backendScoreApiUrl).concat(constants_1.EXTERNAL_LOGGER_SERVICE_PATH);
|
|
111
116
|
method = http_1.HttpMethod.POST;
|
|
112
117
|
headers = (_a = {},
|
|
113
118
|
_a[http_1.CONTENT_TYPE_HEADER_NAME] = [http_1.ContentType.APPLICATION_JSON],
|
|
114
|
-
_a[http_1.AUTHORIZATION_HEADER_NAME] = [(0, utils_1.getAuthorizationHeader)(this.loggerAuthToken)],
|
|
119
|
+
_a[http_1.AUTHORIZATION_HEADER_NAME] = [(0, utils_1.getAuthorizationHeader)(this.config.loggerAuthToken)],
|
|
115
120
|
_a);
|
|
116
121
|
body = JSON.stringify(logRecords);
|
|
117
122
|
req = new http_1.OutgoingRequestImpl({ url: url, method: method, headers: headers, body: body });
|
|
@@ -14,10 +14,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.LoggerBase = void 0;
|
|
15
15
|
var LoggerSeverity_1 = require("./LoggerSeverity");
|
|
16
16
|
var LoggerBase = /** @class */ (function () {
|
|
17
|
-
function LoggerBase(loggerSeverity, logs) {
|
|
17
|
+
function LoggerBase(loggerSeverity, shouldSaveLogs, logs) {
|
|
18
18
|
if (loggerSeverity === void 0) { loggerSeverity = LoggerSeverity_1.LoggerSeverity.ERROR; }
|
|
19
19
|
if (logs === void 0) { logs = []; }
|
|
20
20
|
this.loggerSeverity = loggerSeverity;
|
|
21
|
+
this.shouldSaveLogs = shouldSaveLogs;
|
|
21
22
|
this.logs = logs;
|
|
22
23
|
}
|
|
23
24
|
LoggerBase.prototype.debug = function (message, metadata) {
|
|
@@ -51,6 +52,9 @@ var LoggerBase = /** @class */ (function () {
|
|
|
51
52
|
return this.logs;
|
|
52
53
|
};
|
|
53
54
|
LoggerBase.prototype.recordLog = function (message, loggerSeverity, metadata) {
|
|
55
|
+
if (!this.shouldSaveLogs) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
54
58
|
var logRecord = __assign(__assign({}, metadata), { message: message, severity: loggerSeverity, messageTimestamp: Date.now() });
|
|
55
59
|
this.logs.push(logRecord);
|
|
56
60
|
};
|
|
@@ -49,7 +49,7 @@ var MonitoredRequestUtils;
|
|
|
49
49
|
_a = context.requestData, url = _a.url, request = _a.request;
|
|
50
50
|
_b = MonitoredRequestUtils.isEnforcedRoute(url, config.enforcedRoutes);
|
|
51
51
|
if (_b) return [3 /*break*/, 2];
|
|
52
|
-
return [4 /*yield*/, MonitoredRequestUtils.invokeCustomIsEnforcedRequest(config,
|
|
52
|
+
return [4 /*yield*/, MonitoredRequestUtils.invokeCustomIsEnforcedRequest(config, context)];
|
|
53
53
|
case 1:
|
|
54
54
|
_b = (_e.sent());
|
|
55
55
|
_e.label = 2;
|
|
@@ -59,7 +59,7 @@ var MonitoredRequestUtils;
|
|
|
59
59
|
if (!_c) return [3 /*break*/, 5];
|
|
60
60
|
_d = MonitoredRequestUtils.isMonitoredRoute(url, config.monitoredRoutes);
|
|
61
61
|
if (_d) return [3 /*break*/, 4];
|
|
62
|
-
return [4 /*yield*/, MonitoredRequestUtils.invokeCustomIsMonitoredRequest(config,
|
|
62
|
+
return [4 /*yield*/, MonitoredRequestUtils.invokeCustomIsMonitoredRequest(config, context)];
|
|
63
63
|
case 3:
|
|
64
64
|
_d = (_e.sent());
|
|
65
65
|
_e.label = 4;
|
|
@@ -79,7 +79,7 @@ var MonitoredRequestUtils;
|
|
|
79
79
|
MonitoredRequestUtils.isEnforcedRoute = function (url, enforcedRoutes) {
|
|
80
80
|
return (0, utils_1.isRouteInPatterns)(url.pathname, enforcedRoutes);
|
|
81
81
|
};
|
|
82
|
-
MonitoredRequestUtils.invokeCustomIsEnforcedRequest = function (config,
|
|
82
|
+
MonitoredRequestUtils.invokeCustomIsEnforcedRequest = function (config, context) { return __awaiter(_this, void 0, void 0, function () {
|
|
83
83
|
var err_1;
|
|
84
84
|
return __generator(this, function (_a) {
|
|
85
85
|
switch (_a.label) {
|
|
@@ -88,17 +88,17 @@ var MonitoredRequestUtils;
|
|
|
88
88
|
_a.label = 1;
|
|
89
89
|
case 1:
|
|
90
90
|
_a.trys.push([1, 3, , 4]);
|
|
91
|
-
return [4 /*yield*/, config.customIsEnforcedRequest(request.getUnderlyingRequest())];
|
|
91
|
+
return [4 /*yield*/, config.customIsEnforcedRequest(context.requestData.request.getUnderlyingRequest())];
|
|
92
92
|
case 2: return [2 /*return*/, _a.sent()];
|
|
93
93
|
case 3:
|
|
94
94
|
err_1 = _a.sent();
|
|
95
|
-
|
|
95
|
+
context.logger.debug("caught custom enforced request error - ".concat(err_1));
|
|
96
96
|
return [3 /*break*/, 4];
|
|
97
97
|
case 4: return [2 /*return*/, false];
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
}); };
|
|
101
|
-
MonitoredRequestUtils.invokeCustomIsMonitoredRequest = function (config,
|
|
101
|
+
MonitoredRequestUtils.invokeCustomIsMonitoredRequest = function (config, context) { return __awaiter(_this, void 0, void 0, function () {
|
|
102
102
|
var err_2;
|
|
103
103
|
return __generator(this, function (_a) {
|
|
104
104
|
switch (_a.label) {
|
|
@@ -107,11 +107,11 @@ var MonitoredRequestUtils;
|
|
|
107
107
|
_a.label = 1;
|
|
108
108
|
case 1:
|
|
109
109
|
_a.trys.push([1, 3, , 4]);
|
|
110
|
-
return [4 /*yield*/, config.customIsMonitoredRequest(request.getUnderlyingRequest())];
|
|
110
|
+
return [4 /*yield*/, config.customIsMonitoredRequest(context.requestData.request.getUnderlyingRequest())];
|
|
111
111
|
case 2: return [2 /*return*/, _a.sent()];
|
|
112
112
|
case 3:
|
|
113
113
|
err_2 = _a.sent();
|
|
114
|
-
|
|
114
|
+
context.logger.debug("caught custom monitored request error - ".concat(err_2));
|
|
115
115
|
return [3 /*break*/, 4];
|
|
116
116
|
case 4: return [2 /*return*/, false];
|
|
117
117
|
}
|
|
@@ -56,7 +56,7 @@ var CreateBlockResponsePhase = /** @class */ (function () {
|
|
|
56
56
|
if (context.action !== action_1.Action.BLOCK) {
|
|
57
57
|
return [2 /*return*/, { done: false }];
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
context.logger.debug('create block response phase');
|
|
60
60
|
response = this.createBlockResponse(context);
|
|
61
61
|
if (!response) {
|
|
62
62
|
return [2 /*return*/, { done: false }];
|
|
@@ -76,7 +76,7 @@ var CreateBlockResponsePhase = /** @class */ (function () {
|
|
|
76
76
|
if (context.reasons[name_1]) {
|
|
77
77
|
var blocker = this.blockers[name_1];
|
|
78
78
|
if (blocker === null || blocker === void 0 ? void 0 : blocker.shouldBlock(context)) {
|
|
79
|
-
|
|
79
|
+
context.logger.debug("returning ".concat(name_1, " block response"));
|
|
80
80
|
response = blocker.createBlockResponse(context);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
@@ -41,22 +41,21 @@ var logger_1 = require("../../logger");
|
|
|
41
41
|
var action_1 = require("../../action");
|
|
42
42
|
var blocker_1 = require("../../blocker");
|
|
43
43
|
var DecideActionPhase = /** @class */ (function () {
|
|
44
|
-
function DecideActionPhase(
|
|
45
|
-
this.config = config;
|
|
44
|
+
function DecideActionPhase() {
|
|
46
45
|
}
|
|
47
46
|
DecideActionPhase.prototype.updateContextDecision = function (context) {
|
|
48
47
|
return __awaiter(this, void 0, void 0, function () {
|
|
49
48
|
var _a, action, reasons, productReasons;
|
|
50
49
|
return __generator(this, function (_b) {
|
|
51
50
|
_a = (0, action_1.getDecisionFromContext)(context), action = _a.action, reasons = _a.reasons;
|
|
52
|
-
if (
|
|
51
|
+
if (context.logger.getLoggerSeverity() === logger_1.LoggerSeverity.DEBUG) {
|
|
53
52
|
productReasons = Object.entries(reasons)
|
|
54
53
|
.map(function (_a) {
|
|
55
54
|
var prod = _a[0], reason = _a[1];
|
|
56
55
|
return "".concat(prod, " -> ").concat(reason);
|
|
57
56
|
})
|
|
58
57
|
.join(', ');
|
|
59
|
-
|
|
58
|
+
context.logger.debug("decision: ".concat(action, ", reasons: ").concat(productReasons));
|
|
60
59
|
}
|
|
61
60
|
context.action = action;
|
|
62
61
|
context.reasons = reasons;
|
|
@@ -57,7 +57,8 @@ var DecideActionPhase_1 = require("./DecideActionPhase");
|
|
|
57
57
|
var EnrichContextFromRequestPhase = /** @class */ (function (_super) {
|
|
58
58
|
__extends(EnrichContextFromRequestPhase, _super);
|
|
59
59
|
function EnrichContextFromRequestPhase(config, products, dataEnrichment, graphQLParser) {
|
|
60
|
-
var _this = _super.call(this
|
|
60
|
+
var _this = _super.call(this) || this;
|
|
61
|
+
_this.config = config;
|
|
61
62
|
_this.products = products;
|
|
62
63
|
_this.dataEnrichment = dataEnrichment;
|
|
63
64
|
_this.graphQLParser = graphQLParser;
|
|
@@ -68,7 +69,7 @@ var EnrichContextFromRequestPhase = /** @class */ (function (_super) {
|
|
|
68
69
|
return __generator(this, function (_a) {
|
|
69
70
|
switch (_a.label) {
|
|
70
71
|
case 0:
|
|
71
|
-
|
|
72
|
+
context.logger.debug('enrich context from request phase');
|
|
72
73
|
return [4 /*yield*/, this.addPxdeToContext(context)];
|
|
73
74
|
case 1:
|
|
74
75
|
_a.sent();
|
|
@@ -47,7 +47,7 @@ var EnrichContextFromResponsePhase = /** @class */ (function () {
|
|
|
47
47
|
return __generator(this, function (_a) {
|
|
48
48
|
switch (_a.label) {
|
|
49
49
|
case 0:
|
|
50
|
-
|
|
50
|
+
context.logger.debug('enrich context from response phase');
|
|
51
51
|
return [4 /*yield*/, this.addProductDataToContext(context)];
|
|
52
52
|
case 1:
|
|
53
53
|
_a.sent();
|
|
@@ -59,7 +59,7 @@ var FirstPartyPhase = /** @class */ (function () {
|
|
|
59
59
|
case 2:
|
|
60
60
|
firstPartyData = _b.sent();
|
|
61
61
|
if (!firstPartyData) return [3 /*break*/, 4];
|
|
62
|
-
return [4 /*yield*/, this.sendFirstPartyRequest(firstPartyData)];
|
|
62
|
+
return [4 /*yield*/, this.sendFirstPartyRequest(firstPartyData, context)];
|
|
63
63
|
case 3:
|
|
64
64
|
response = _b.sent();
|
|
65
65
|
return [2 /*return*/, { done: true, response: response }];
|
|
@@ -71,7 +71,7 @@ var FirstPartyPhase = /** @class */ (function () {
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
FirstPartyPhase.prototype.sendFirstPartyRequest = function (_a) {
|
|
74
|
+
FirstPartyPhase.prototype.sendFirstPartyRequest = function (_a, context) {
|
|
75
75
|
var request = _a.request, defaultResponse = _a.defaultResponse;
|
|
76
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
77
|
var response, e_1;
|
|
@@ -79,7 +79,7 @@ var FirstPartyPhase = /** @class */ (function () {
|
|
|
79
79
|
switch (_b.label) {
|
|
80
80
|
case 0:
|
|
81
81
|
if (!request) {
|
|
82
|
-
|
|
82
|
+
context.logger.debug('no first party request provided, returning default response');
|
|
83
83
|
return [2 /*return*/, defaultResponse];
|
|
84
84
|
}
|
|
85
85
|
_b.label = 1;
|
|
@@ -91,7 +91,7 @@ var FirstPartyPhase = /** @class */ (function () {
|
|
|
91
91
|
return [2 /*return*/, http_1.MinimalResponseUtils.from(response)];
|
|
92
92
|
case 3:
|
|
93
93
|
e_1 = _b.sent();
|
|
94
|
-
|
|
94
|
+
context.logger.debug("caught error, returning default first party response: ".concat(e_1));
|
|
95
95
|
return [2 /*return*/, defaultResponse];
|
|
96
96
|
case 4: return [2 /*return*/];
|
|
97
97
|
}
|
|
@@ -59,7 +59,7 @@ var DecideActionPhase_1 = require("./DecideActionPhase");
|
|
|
59
59
|
var RiskApiPhase = /** @class */ (function (_super) {
|
|
60
60
|
__extends(RiskApiPhase, _super);
|
|
61
61
|
function RiskApiPhase(config, products, riskApiClient) {
|
|
62
|
-
var _this = _super.call(this
|
|
62
|
+
var _this = _super.call(this) || this;
|
|
63
63
|
_this.products = products;
|
|
64
64
|
_this.riskApiClient = riskApiClient;
|
|
65
65
|
return _this;
|
|
@@ -49,12 +49,12 @@ var SendLogsPhase = /** @class */ (function () {
|
|
|
49
49
|
switch (_b.label) {
|
|
50
50
|
case 0:
|
|
51
51
|
if (!context.shouldSendLogs) return [3 /*break*/, 2];
|
|
52
|
-
return [4 /*yield*/, ((_a = this.logServiceClient) === null || _a === void 0 ? void 0 : _a.sendLogs(context
|
|
52
|
+
return [4 /*yield*/, ((_a = this.logServiceClient) === null || _a === void 0 ? void 0 : _a.sendLogs(context))];
|
|
53
53
|
case 1:
|
|
54
54
|
_b.sent();
|
|
55
55
|
_b.label = 2;
|
|
56
56
|
case 2:
|
|
57
|
-
|
|
57
|
+
context.logger.clearLogs();
|
|
58
58
|
return [2 /*return*/, { done: false }];
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -49,7 +49,6 @@ var UpdateRemoteConfigPhase = /** @class */ (function () {
|
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
51
51
|
if (!this.remoteConfigUpdater.isUpdateRemoteConfigRequest(context)) return [3 /*break*/, 2];
|
|
52
|
-
context.shouldSendLogs = true;
|
|
53
52
|
return [4 /*yield*/, this.remoteConfigUpdater.updateRemoteConfig(context)];
|
|
54
53
|
case 1:
|
|
55
54
|
isSuccessful = _a.sent();
|
|
@@ -69,7 +69,7 @@ var AccountDefender = /** @class */ (function () {
|
|
|
69
69
|
var crossTabSession, jwtData;
|
|
70
70
|
return __generator(this, function (_a) {
|
|
71
71
|
crossTabSession = context.requestData.cookies[constants_1.CROSS_TAB_SESSION_COOKIE_NAME];
|
|
72
|
-
jwtData = this.getJwtData(context
|
|
72
|
+
jwtData = this.getJwtData(context);
|
|
73
73
|
return [2 /*return*/, __assign({ crossTabSession: crossTabSession }, jwtData)];
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -102,11 +102,12 @@ var AccountDefender = /** @class */ (function () {
|
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
|
-
AccountDefender.prototype.getJwtData = function (
|
|
105
|
+
AccountDefender.prototype.getJwtData = function (context) {
|
|
106
106
|
var _a;
|
|
107
107
|
var jwtToken;
|
|
108
108
|
var userIdFieldName;
|
|
109
109
|
var additionalFieldNames;
|
|
110
|
+
var requestData = context.requestData;
|
|
110
111
|
if (this.config.jwtCookieName) {
|
|
111
112
|
jwtToken = requestData.cookies[this.config.jwtCookieName];
|
|
112
113
|
if (jwtToken) {
|
|
@@ -121,11 +122,11 @@ var AccountDefender = /** @class */ (function () {
|
|
|
121
122
|
additionalFieldNames = this.config.jwtHeaderAdditionalFieldNames;
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
|
-
return jwtToken ? this.extractJwtData(jwtToken, userIdFieldName, additionalFieldNames) : null;
|
|
125
|
+
return jwtToken ? this.extractJwtData(jwtToken, userIdFieldName, additionalFieldNames, context) : null;
|
|
125
126
|
};
|
|
126
|
-
AccountDefender.prototype.extractJwtData = function (jwt, userIdFieldName, additionalFieldNames) {
|
|
127
|
+
AccountDefender.prototype.extractJwtData = function (jwt, userIdFieldName, additionalFieldNames, context) {
|
|
127
128
|
try {
|
|
128
|
-
var decodedJwt_1 = this.getDecodedJwt(jwt);
|
|
129
|
+
var decodedJwt_1 = this.getDecodedJwt(jwt, context);
|
|
129
130
|
if (decodedJwt_1) {
|
|
130
131
|
var appUserId = utils_1.getPropertyFromObject.apply(void 0, __spreadArray([decodedJwt_1], userIdFieldName.split('.'), false));
|
|
131
132
|
var additionalFields = additionalFieldNames.reduce(function (matchedFields, fieldName) {
|
|
@@ -140,11 +141,11 @@ var AccountDefender = /** @class */ (function () {
|
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
catch (e) {
|
|
143
|
-
|
|
144
|
+
context.logger.debug("unable to get account defender JWT data: ".concat(e));
|
|
144
145
|
}
|
|
145
146
|
return null;
|
|
146
147
|
};
|
|
147
|
-
AccountDefender.prototype.getDecodedJwt = function (jwt) {
|
|
148
|
+
AccountDefender.prototype.getDecodedJwt = function (jwt, context) {
|
|
148
149
|
var _a;
|
|
149
150
|
try {
|
|
150
151
|
var encodedPayload = (_a = jwt.split('.')) === null || _a === void 0 ? void 0 : _a[1];
|
|
@@ -152,7 +153,7 @@ var AccountDefender = /** @class */ (function () {
|
|
|
152
153
|
return JSON.parse(this.base64Utils.base64Decode(base64));
|
|
153
154
|
}
|
|
154
155
|
catch (e) {
|
|
155
|
-
|
|
156
|
+
context.logger.debug("unable to decode account defender jwt token: ".concat(e));
|
|
156
157
|
return null;
|
|
157
158
|
}
|
|
158
159
|
};
|
|
@@ -47,16 +47,14 @@ var DefaultBotDefenderFilter = /** @class */ (function () {
|
|
|
47
47
|
}
|
|
48
48
|
DefaultBotDefenderFilter.prototype.shouldFilter = function (context) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
-
var
|
|
50
|
+
var filterReason;
|
|
51
51
|
return __generator(this, function (_a) {
|
|
52
52
|
switch (_a.label) {
|
|
53
|
-
case 0:
|
|
54
|
-
requestData = context.requestData;
|
|
55
|
-
return [4 /*yield*/, this.getFilterReason(requestData)];
|
|
53
|
+
case 0: return [4 /*yield*/, this.getFilterReason(context)];
|
|
56
54
|
case 1:
|
|
57
55
|
filterReason = _a.sent();
|
|
58
56
|
if (filterReason !== filter_1.FilterReason.NONE) {
|
|
59
|
-
|
|
57
|
+
context.logger.debug("filter request due to ".concat(filterReason));
|
|
60
58
|
return [2 /*return*/, true];
|
|
61
59
|
}
|
|
62
60
|
return [2 /*return*/, false];
|
|
@@ -64,11 +62,13 @@ var DefaultBotDefenderFilter = /** @class */ (function () {
|
|
|
64
62
|
});
|
|
65
63
|
});
|
|
66
64
|
};
|
|
67
|
-
DefaultBotDefenderFilter.prototype.getFilterReason = function (
|
|
65
|
+
DefaultBotDefenderFilter.prototype.getFilterReason = function (context) {
|
|
68
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
var requestData;
|
|
69
68
|
return __generator(this, function (_a) {
|
|
70
69
|
switch (_a.label) {
|
|
71
70
|
case 0:
|
|
71
|
+
requestData = context.requestData;
|
|
72
72
|
if (this.shouldFilterByExtension(requestData)) {
|
|
73
73
|
return [2 /*return*/, filter_1.FilterReason.EXTENSION];
|
|
74
74
|
}
|
|
@@ -84,7 +84,7 @@ var DefaultBotDefenderFilter = /** @class */ (function () {
|
|
|
84
84
|
if (this.shouldFilterByIp(requestData.ip)) {
|
|
85
85
|
return [2 /*return*/, filter_1.FilterReason.IP];
|
|
86
86
|
}
|
|
87
|
-
return [4 /*yield*/, this.shouldFilterByCustomFunction(
|
|
87
|
+
return [4 /*yield*/, this.shouldFilterByCustomFunction(context)];
|
|
88
88
|
case 1:
|
|
89
89
|
if (_a.sent()) {
|
|
90
90
|
return [2 /*return*/, filter_1.FilterReason.CUSTOM];
|
|
@@ -114,7 +114,7 @@ var DefaultBotDefenderFilter = /** @class */ (function () {
|
|
|
114
114
|
DefaultBotDefenderFilter.prototype.shouldFilterByUserAgent = function (userAgent) {
|
|
115
115
|
return this.config.filteredUserAgents.includes(userAgent);
|
|
116
116
|
};
|
|
117
|
-
DefaultBotDefenderFilter.prototype.shouldFilterByCustomFunction = function (
|
|
117
|
+
DefaultBotDefenderFilter.prototype.shouldFilterByCustomFunction = function (context) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
119
|
var err_1;
|
|
120
120
|
return __generator(this, function (_a) {
|
|
@@ -124,11 +124,11 @@ var DefaultBotDefenderFilter = /** @class */ (function () {
|
|
|
124
124
|
_a.label = 1;
|
|
125
125
|
case 1:
|
|
126
126
|
_a.trys.push([1, 3, , 4]);
|
|
127
|
-
return [4 /*yield*/, this.config.customIsFilteredRequest(request.getUnderlyingRequest())];
|
|
127
|
+
return [4 /*yield*/, this.config.customIsFilteredRequest(context.requestData.request.getUnderlyingRequest())];
|
|
128
128
|
case 2: return [2 /*return*/, _a.sent()];
|
|
129
129
|
case 3:
|
|
130
130
|
err_1 = _a.sent();
|
|
131
|
-
|
|
131
|
+
context.logger.debug("caught custom filtered request error - ".concat(err_1));
|
|
132
132
|
return [3 /*break*/, 4];
|
|
133
133
|
case 4: return [2 /*return*/, false];
|
|
134
134
|
}
|
|
@@ -84,14 +84,14 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
84
84
|
if (!this.config.firstPartyEnabled) {
|
|
85
85
|
return [2 /*return*/, { defaultResponse: defaultResponse }];
|
|
86
86
|
}
|
|
87
|
-
url = this.getThirdPartySensorScriptUrl();
|
|
87
|
+
url = this.getThirdPartySensorScriptUrl(context);
|
|
88
88
|
if (!url) {
|
|
89
89
|
return [2 /*return*/, { defaultResponse: defaultResponse }];
|
|
90
90
|
}
|
|
91
91
|
return [4 /*yield*/, this.getOutgoingRequest(url, context)];
|
|
92
92
|
case 1:
|
|
93
93
|
request = _a.sent();
|
|
94
|
-
|
|
94
|
+
context.logger.debug("proxying first party sensor script ".concat(context.requestData.url.pathname, " to ").concat(url));
|
|
95
95
|
return [2 /*return*/, { request: request, defaultResponse: defaultResponse }];
|
|
96
96
|
}
|
|
97
97
|
});
|
|
@@ -114,7 +114,7 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
114
114
|
return [4 /*yield*/, this.getOutgoingRequest(url, context)];
|
|
115
115
|
case 1:
|
|
116
116
|
request = _a.sent();
|
|
117
|
-
|
|
117
|
+
context.logger.debug("proxying first party XHR request ".concat(context.requestData.url.pathname, " to ").concat(url));
|
|
118
118
|
return [2 /*return*/, { request: request, defaultResponse: defaultResponse }];
|
|
119
119
|
}
|
|
120
120
|
});
|
|
@@ -145,26 +145,26 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
145
145
|
return [4 /*yield*/, this.getOutgoingRequest(url, context)];
|
|
146
146
|
case 1:
|
|
147
147
|
request = _a.sent();
|
|
148
|
-
|
|
148
|
+
context.logger.debug("proxying first party captcha script ".concat(context.requestData.url.pathname, " to ").concat(url));
|
|
149
149
|
return [2 /*return*/, { request: request, defaultResponse: defaultResponse }];
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
|
-
DefaultBotDefenderFirstParty.prototype.getOutgoingRequest = function (url,
|
|
155
|
-
var requestData = _a.requestData, vid = _a.vid;
|
|
154
|
+
DefaultBotDefenderFirstParty.prototype.getOutgoingRequest = function (url, context) {
|
|
156
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
-
return __generator(this, function (
|
|
156
|
+
return __generator(this, function (_a) {
|
|
158
157
|
return [2 /*return*/, new http_1.OutgoingRequestImpl({
|
|
159
158
|
url: url.href,
|
|
160
|
-
method: requestData.method,
|
|
161
|
-
headers: this.prepareFirstPartyHeaders(url,
|
|
162
|
-
body: requestData.request.body,
|
|
159
|
+
method: context.requestData.method,
|
|
160
|
+
headers: this.prepareFirstPartyHeaders(url, context),
|
|
161
|
+
body: context.requestData.request.body,
|
|
163
162
|
})];
|
|
164
163
|
});
|
|
165
164
|
});
|
|
166
165
|
};
|
|
167
|
-
DefaultBotDefenderFirstParty.prototype.prepareFirstPartyHeaders = function (url,
|
|
166
|
+
DefaultBotDefenderFirstParty.prototype.prepareFirstPartyHeaders = function (url, context) {
|
|
167
|
+
var requestData = context.requestData, vid = context.vid;
|
|
168
168
|
var headers = (0, http_1.toMutableHeaders)(requestData.headers);
|
|
169
169
|
try {
|
|
170
170
|
headers = (0, utils_1.removeSensitiveHeaders)(headers, this.config.sensitiveHeaders);
|
|
@@ -177,7 +177,7 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
catch (e) {
|
|
180
|
-
|
|
180
|
+
context.logger.error("Caught error preparing first party headers: ".concat(e));
|
|
181
181
|
}
|
|
182
182
|
return headers;
|
|
183
183
|
};
|
|
@@ -192,12 +192,12 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
192
192
|
headers[constants_1.FIRST_PARTY_HEADER_NAME] = [constants_1.FIRST_PARTY_HEADER_VALUE];
|
|
193
193
|
headers[constants_1.X_PX_ENFORCER_TRUE_IP_HEADER_NAME] = [ip];
|
|
194
194
|
};
|
|
195
|
-
DefaultBotDefenderFirstParty.prototype.getThirdPartySensorScriptUrl = function () {
|
|
195
|
+
DefaultBotDefenderFirstParty.prototype.getThirdPartySensorScriptUrl = function (context) {
|
|
196
196
|
try {
|
|
197
197
|
return this.urlUtils.createUrl("".concat(this.config.backendClientUrl, "/").concat(this.config.appId, "/main.min.js"));
|
|
198
198
|
}
|
|
199
199
|
catch (e) {
|
|
200
|
-
|
|
200
|
+
context.logger.debug("unable to create third party sensor URL: ".concat(e));
|
|
201
201
|
return null;
|
|
202
202
|
}
|
|
203
203
|
};
|
|
@@ -208,7 +208,7 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
208
208
|
return this.urlUtils.createUrl("".concat(backendCaptchaUrl, "/").concat(appId).concat(FirstPartySuffix_1.FirstPartySuffix.CAPTCHA, ".js").concat(originalUrl.search));
|
|
209
209
|
}
|
|
210
210
|
catch (e) {
|
|
211
|
-
|
|
211
|
+
context.logger.debug("unable to create third party captcha URL: ".concat(e));
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
@@ -219,13 +219,13 @@ var DefaultBotDefenderFirstParty = /** @class */ (function () {
|
|
|
219
219
|
var thirdPartyUrl = this.urlUtils.createUrl("".concat(this.config.backendCollectorUrl).concat(pathname).concat(originalUrl.search));
|
|
220
220
|
var host = this.urlUtils.createUrl(this.config.backendCollectorUrl).host;
|
|
221
221
|
if (!this.isValidThirdPartyUrl(thirdPartyUrl, host, pathname)) {
|
|
222
|
-
|
|
222
|
+
context.logger.debug("invalid third party url: ".concat(thirdPartyUrl));
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
225
|
return thirdPartyUrl;
|
|
226
226
|
}
|
|
227
227
|
catch (e) {
|
|
228
|
-
|
|
228
|
+
context.logger.debug("unable to create third party XHR URL: ".concat(e));
|
|
229
229
|
return null;
|
|
230
230
|
}
|
|
231
231
|
};
|
|
@@ -39,7 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.CredentialEndpoint = void 0;
|
|
40
40
|
var CredentialEndpoint = /** @class */ (function () {
|
|
41
41
|
function CredentialEndpoint(config, matcher, extractor, protocol, loginSuccessfulParser) {
|
|
42
|
-
this.config = config;
|
|
43
42
|
this.matcher = matcher;
|
|
44
43
|
this.extractor = extractor;
|
|
45
44
|
this.protocol = protocol;
|
|
@@ -48,40 +47,40 @@ var CredentialEndpoint = /** @class */ (function () {
|
|
|
48
47
|
CredentialEndpoint.prototype.matches = function (requestData) {
|
|
49
48
|
return this.matcher.matches(requestData);
|
|
50
49
|
};
|
|
51
|
-
CredentialEndpoint.prototype.getCredentialData = function (
|
|
50
|
+
CredentialEndpoint.prototype.getCredentialData = function (context) {
|
|
52
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
53
52
|
var credentials, e_1;
|
|
54
53
|
return __generator(this, function (_a) {
|
|
55
54
|
switch (_a.label) {
|
|
56
55
|
case 0:
|
|
57
56
|
_a.trys.push([0, 3, , 4]);
|
|
58
|
-
return [4 /*yield*/, this.extractor.extractCredentials(request)];
|
|
57
|
+
return [4 /*yield*/, this.extractor.extractCredentials(context.requestData.request)];
|
|
59
58
|
case 1:
|
|
60
59
|
credentials = _a.sent();
|
|
61
60
|
if (!(credentials === null || credentials === void 0 ? void 0 : credentials.user) && !(credentials === null || credentials === void 0 ? void 0 : credentials.pass)) {
|
|
62
|
-
|
|
61
|
+
context.logger.debug('unable to extract credentials');
|
|
63
62
|
return [2 /*return*/, null];
|
|
64
63
|
}
|
|
65
|
-
|
|
64
|
+
context.logger.debug("successfully extracted credentials");
|
|
66
65
|
return [4 /*yield*/, this.protocol.hashCredentials(credentials)];
|
|
67
66
|
case 2: return [2 /*return*/, _a.sent()];
|
|
68
67
|
case 3:
|
|
69
68
|
e_1 = _a.sent();
|
|
70
|
-
|
|
69
|
+
context.logger.debug("caught error extracting credentials: ".concat(e_1));
|
|
71
70
|
return [2 /*return*/, null];
|
|
72
71
|
case 4: return [2 /*return*/];
|
|
73
72
|
}
|
|
74
73
|
});
|
|
75
74
|
});
|
|
76
75
|
};
|
|
77
|
-
CredentialEndpoint.prototype.isLoginSuccessful = function (
|
|
76
|
+
CredentialEndpoint.prototype.isLoginSuccessful = function (context) {
|
|
78
77
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
78
|
return __generator(this, function (_a) {
|
|
80
79
|
try {
|
|
81
|
-
return [2 /*return*/, this.loginSuccessfulParser.isLoginSuccessful(response)];
|
|
80
|
+
return [2 /*return*/, this.loginSuccessfulParser.isLoginSuccessful(context.response)];
|
|
82
81
|
}
|
|
83
82
|
catch (e) {
|
|
84
|
-
|
|
83
|
+
context.logger.debug("caught error determining login successful: ".concat(e));
|
|
85
84
|
return [2 /*return*/, null];
|
|
86
85
|
}
|
|
87
86
|
return [2 /*return*/];
|