@abyss-project/monitor 9.3.0 → 9.4.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/api/error-group.api.d.ts +4 -1
- package/dist/api/error-group.api.js +13 -1
- package/dist/api/error-group.api.js.map +1 -1
- package/dist/api/incident.api.d.ts +3 -1
- package/dist/api/incident.api.js +9 -1
- package/dist/api/incident.api.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/texts/error-type-texts.d.ts +13 -0
- package/dist/texts/error-type-texts.js +154 -0
- package/dist/texts/error-type-texts.js.map +1 -0
- package/dist/texts/index.d.ts +2 -0
- package/dist/texts/index.js +19 -0
- package/dist/texts/index.js.map +1 -0
- package/dist/texts/report-texts.d.ts +42 -0
- package/dist/texts/report-texts.js +190 -0
- package/dist/texts/report-texts.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +2 -0
- package/dist/types/enum/api-error.enum.js +2 -0
- package/dist/types/enum/api-error.enum.js.map +1 -1
- package/dist/types/enum/error-report-export-channel.enum.d.ts +5 -0
- package/dist/types/enum/error-report-export-channel.enum.js +10 -0
- package/dist/types/enum/error-report-export-channel.enum.js.map +1 -0
- package/dist/types/enum/export-removal-reason.enum.d.ts +14 -0
- package/dist/types/enum/export-removal-reason.enum.js +19 -0
- package/dist/types/enum/export-removal-reason.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +7 -0
- package/dist/types/enum/index.js +7 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/monitor-report-block.enum.d.ts +10 -0
- package/dist/types/enum/monitor-report-block.enum.js +23 -0
- package/dist/types/enum/monitor-report-block.enum.js.map +1 -0
- package/dist/types/enum/report-absent-source.enum.d.ts +8 -0
- package/dist/types/enum/report-absent-source.enum.js +13 -0
- package/dist/types/enum/report-absent-source.enum.js.map +1 -0
- package/dist/types/enum/report-block-availability.enum.d.ts +4 -0
- package/dist/types/enum/report-block-availability.enum.js +9 -0
- package/dist/types/enum/report-block-availability.enum.js.map +1 -0
- package/dist/types/enum/report-block-reason.enum.d.ts +11 -0
- package/dist/types/enum/report-block-reason.enum.js +16 -0
- package/dist/types/enum/report-block-reason.enum.js.map +1 -0
- package/dist/types/enum/report-observed-unknown.enum.d.ts +7 -0
- package/dist/types/enum/report-observed-unknown.enum.js +12 -0
- package/dist/types/enum/report-observed-unknown.enum.js.map +1 -0
- package/dist/types/interface/api/requests/error-group.request.d.ts +25 -1
- package/dist/types/interface/api/requests/incident.request.d.ts +11 -0
- package/dist/types/interface/api/responses/error-group.response.d.ts +34 -1
- package/dist/types/interface/api/responses/incident.response.d.ts +13 -0
- package/dist/types/interface/index.d.ts +1 -0
- package/dist/types/interface/index.js +1 -0
- package/dist/types/interface/index.js.map +1 -1
- package/dist/types/interface/models/monitor-error-report-export.model.d.ts +16 -0
- package/dist/types/interface/models/monitor-error-report-export.model.js +3 -0
- package/dist/types/interface/models/monitor-error-report-export.model.js.map +1 -0
- package/dist/utils/error-report/index.d.ts +1 -0
- package/dist/utils/error-report/index.js +18 -0
- package/dist/utils/error-report/index.js.map +1 -0
- package/dist/utils/error-report/report-optimizer.d.ts +19 -0
- package/dist/utils/error-report/report-optimizer.js +54 -0
- package/dist/utils/error-report/report-optimizer.js.map +1 -0
- package/dist/utils/export-redaction/iban.d.ts +1 -0
- package/dist/utils/export-redaction/iban.js +19 -0
- package/dist/utils/export-redaction/iban.js.map +1 -0
- package/dist/utils/export-redaction/index.d.ts +1 -0
- package/dist/utils/export-redaction/index.js +18 -0
- package/dist/utils/export-redaction/index.js.map +1 -0
- package/dist/utils/export-redaction/luhn.d.ts +1 -0
- package/dist/utils/export-redaction/luhn.js +22 -0
- package/dist/utils/export-redaction/luhn.js.map +1 -0
- package/dist/utils/export-redaction/patterns.d.ts +3 -0
- package/dist/utils/export-redaction/patterns.js +109 -0
- package/dist/utils/export-redaction/patterns.js.map +1 -0
- package/dist/utils/export-redaction/redact-for-export.d.ts +25 -0
- package/dist/utils/export-redaction/redact-for-export.js +170 -0
- package/dist/utils/export-redaction/redact-for-export.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yEAAuD;AACvD,sDAAoC;AACpC,mEAAiD;AACjD,iEAA+C;AAC/C,0EAAwD;AACxD,uEAAqD;AACrD,+EAA6D;AAC7D,mEAAiD;AACjD,qEAAmD;AACnD,6EAA2D;AAC3D,sEAAoD;AACpD,6EAA2D;AAC3D,8EAA4D;AAC5D,gFAA8D;AAC9D,8EAA4D;AAC5D,4EAA0D;AAC1D,mEAAiD;AACjD,iEAA+C;AAC/C,kEAAgD;AAChD,oEAAkD;AAClD,8EAA4D;AAC5D,+EAA6D;AAC7D,iEAA+C;AAC/C,qEAAmD;AACnD,+DAA6C;AAG7C,wCAAsB;AACtB,wCAAsB;AACtB,+CAA6B;AAC7B,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yEAAuD;AACvD,sDAAoC;AACpC,mEAAiD;AACjD,iEAA+C;AAC/C,0EAAwD;AACxD,uEAAqD;AACrD,+EAA6D;AAC7D,mEAAiD;AACjD,qEAAmD;AACnD,6EAA2D;AAC3D,sEAAoD;AACpD,6EAA2D;AAC3D,8EAA4D;AAC5D,gFAA8D;AAC9D,8EAA4D;AAC5D,4EAA0D;AAC1D,mEAAiD;AACjD,iEAA+C;AAC/C,kEAAgD;AAChD,oEAAkD;AAClD,8EAA4D;AAC5D,+EAA6D;AAC7D,iEAA+C;AAC/C,qEAAmD;AACnD,6EAA2D;AAC3D,+DAA6C;AAG7C,wCAAsB;AACtB,wCAAsB;AACtB,+CAA6B;AAC7B,mDAAiC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MonitorTextLocale } from '../../../texts/error-type-texts';
|
|
2
|
+
import { ErrorReportExportChannel, MonitorReportBlock } from '../../enum';
|
|
3
|
+
export interface IMonitorErrorReportExport {
|
|
4
|
+
id: string;
|
|
5
|
+
groupId: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
applicationId: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
channel: ErrorReportExportChannel;
|
|
10
|
+
userId: string | null;
|
|
11
|
+
mcpConnectionId: string | null;
|
|
12
|
+
blocks: MonitorReportBlock[];
|
|
13
|
+
locale: MonitorTextLocale;
|
|
14
|
+
estimatedTokens: number;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-error-report-export.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/monitor-error-report-export.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './report-optimizer';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./report-optimizer"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/error-report/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ErrorGroupStatus } from '../../types/enum/error-group-status.enum';
|
|
2
|
+
import { MonitorErrorType } from '../../types/enum/error-type.enum';
|
|
3
|
+
import { MonitorReportBlock } from '../../types/enum/monitor-report-block.enum';
|
|
4
|
+
import { ReportBlockAvailability } from '../../types/enum/report-block-availability.enum';
|
|
5
|
+
import { ReportBlockReason } from '../../types/enum/report-block-reason.enum';
|
|
6
|
+
export declare const REPORT_TOKEN_BUDGET = 12000;
|
|
7
|
+
export interface IReportBlockSuggestion {
|
|
8
|
+
block: MonitorReportBlock;
|
|
9
|
+
reason: ReportBlockReason;
|
|
10
|
+
}
|
|
11
|
+
export declare const REPORT_BLOCK_SUGGESTIONS: Record<MonitorErrorType, ReadonlyArray<IReportBlockSuggestion>>;
|
|
12
|
+
export interface ISuggestReportBlocksInput {
|
|
13
|
+
errorType: MonitorErrorType;
|
|
14
|
+
status: ErrorGroupStatus;
|
|
15
|
+
currentReleaseIsFirst: boolean;
|
|
16
|
+
availability: Record<MonitorReportBlock, ReportBlockAvailability>;
|
|
17
|
+
}
|
|
18
|
+
export declare const suggestReportBlocks: (input: ISuggestReportBlocksInput) => IReportBlockSuggestion[];
|
|
19
|
+
export declare const estimateTokens: (text: string) => number;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.estimateTokens = exports.suggestReportBlocks = exports.REPORT_BLOCK_SUGGESTIONS = exports.REPORT_TOKEN_BUDGET = void 0;
|
|
4
|
+
const error_group_status_enum_1 = require("../../types/enum/error-group-status.enum");
|
|
5
|
+
const error_type_enum_1 = require("../../types/enum/error-type.enum");
|
|
6
|
+
const monitor_report_block_enum_1 = require("../../types/enum/monitor-report-block.enum");
|
|
7
|
+
const report_block_availability_enum_1 = require("../../types/enum/report-block-availability.enum");
|
|
8
|
+
const report_block_reason_enum_1 = require("../../types/enum/report-block-reason.enum");
|
|
9
|
+
exports.REPORT_TOKEN_BUDGET = 12000;
|
|
10
|
+
const { SYMPTOM, REQUEST, RELEASE, STATS, NEIGHBOURS, LINKED_INCIDENT, OCCURRENCES } = monitor_report_block_enum_1.MonitorReportBlock;
|
|
11
|
+
const always = { block: SYMPTOM, reason: report_block_reason_enum_1.ReportBlockReason.ALWAYS_INCLUDED };
|
|
12
|
+
const release = { block: RELEASE, reason: report_block_reason_enum_1.ReportBlockReason.RULES_OUT_FALSE_LEAD };
|
|
13
|
+
const stats = { block: STATS, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_FREQUENCY };
|
|
14
|
+
const request = { block: REQUEST, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_REQUEST };
|
|
15
|
+
const neighbours = { block: NEIGHBOURS, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_REQUEST_PATH };
|
|
16
|
+
const linkedIncident = { block: LINKED_INCIDENT, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_ONGOING_INCIDENT };
|
|
17
|
+
exports.REPORT_BLOCK_SUGGESTIONS = {
|
|
18
|
+
[error_type_enum_1.MonitorErrorType.TIMEOUT_DOWNSTREAM]: [
|
|
19
|
+
always,
|
|
20
|
+
release,
|
|
21
|
+
stats,
|
|
22
|
+
linkedIncident,
|
|
23
|
+
{ block: REQUEST, reason: report_block_reason_enum_1.ReportBlockReason.KEY_FOR_TIMEOUT },
|
|
24
|
+
],
|
|
25
|
+
[error_type_enum_1.MonitorErrorType.CONNECTION_REFUSED]: [always, release, stats, linkedIncident],
|
|
26
|
+
[error_type_enum_1.MonitorErrorType.VALIDATION_FAILED]: [always, request, neighbours, release],
|
|
27
|
+
[error_type_enum_1.MonitorErrorType.PERMISSION_DENIED]: [always, request, neighbours],
|
|
28
|
+
[error_type_enum_1.MonitorErrorType.NOT_FOUND]: [always, request, release],
|
|
29
|
+
[error_type_enum_1.MonitorErrorType.RATE_LIMITED]: [always, stats, request],
|
|
30
|
+
[error_type_enum_1.MonitorErrorType.RESOURCE_EXHAUSTED]: [
|
|
31
|
+
always,
|
|
32
|
+
stats,
|
|
33
|
+
release,
|
|
34
|
+
{ block: OCCURRENCES, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_SATURATION_PATTERN },
|
|
35
|
+
],
|
|
36
|
+
[error_type_enum_1.MonitorErrorType.SERIALIZATION]: [always, request, neighbours, release],
|
|
37
|
+
[error_type_enum_1.MonitorErrorType.CONFIGURATION]: [always, release, stats],
|
|
38
|
+
[error_type_enum_1.MonitorErrorType.UNKNOWN]: [always, request, release, stats, neighbours],
|
|
39
|
+
};
|
|
40
|
+
const suggestReportBlocks = (input) => {
|
|
41
|
+
const regression = input.status === error_group_status_enum_1.ErrorGroupStatus.REGRESSED || input.currentReleaseIsFirst;
|
|
42
|
+
return exports.REPORT_BLOCK_SUGGESTIONS[input.errorType]
|
|
43
|
+
.filter(({ block }) => input.availability[block] === report_block_availability_enum_1.ReportBlockAvailability.AVAILABLE)
|
|
44
|
+
.map(({ block, reason }) => ({
|
|
45
|
+
block,
|
|
46
|
+
reason: block === RELEASE && regression ? report_block_reason_enum_1.ReportBlockReason.REGRESSION_DETECTED : reason,
|
|
47
|
+
}))
|
|
48
|
+
.sort((left, right) => monitor_report_block_enum_1.MONITOR_REPORT_BLOCK_ORDER.indexOf(left.block) -
|
|
49
|
+
monitor_report_block_enum_1.MONITOR_REPORT_BLOCK_ORDER.indexOf(right.block));
|
|
50
|
+
};
|
|
51
|
+
exports.suggestReportBlocks = suggestReportBlocks;
|
|
52
|
+
const estimateTokens = (text) => Math.ceil(text.length / 4);
|
|
53
|
+
exports.estimateTokens = estimateTokens;
|
|
54
|
+
//# sourceMappingURL=report-optimizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-optimizer.js","sourceRoot":"","sources":["../../../src/utils/error-report/report-optimizer.ts"],"names":[],"mappings":";;;AAAA,sFAA4E;AAC5E,sEAAoE;AACpE,0FAGoD;AACpD,oGAA0F;AAC1F,wFAA8E;AAGjE,QAAA,mBAAmB,GAAG,KAAK,CAAC;AAQzC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,GAClF,8CAAkB,CAAC;AACrB,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,4CAAiB,CAAC,eAAe,EAAE,CAAC;AAC7E,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,4CAAiB,CAAC,oBAAoB,EAAE,CAAC;AACnF,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,4CAAiB,CAAC,eAAe,EAAE,CAAC;AAC1E,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,4CAAiB,CAAC,aAAa,EAAE,CAAC;AAC5E,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,4CAAiB,CAAC,kBAAkB,EAAE,CAAC;AACvF,MAAM,cAAc,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,4CAAiB,CAAC,sBAAsB,EAAE,CAAC;AAOvF,QAAA,wBAAwB,GAGjC;IACF,CAAC,kCAAgB,CAAC,kBAAkB,CAAC,EAAE;QACrC,MAAM;QACN,OAAO;QACP,KAAK;QACL,cAAc;QACd,EAAE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C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,wDAAuB,CAAC,SAAS,CAAC;SACtF,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3B,KAAK;QACL,MAAM,EAAE,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,4CAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM;KACzF,CAAC,CAAC;SACF,IAAI,CACH,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,sDAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9C,sDAA0B,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAClD,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,mBAAmB,uBAa9B;AAGK,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAAtE,QAAA,cAAc,kBAAwD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const passesIbanCheck: (compact: string) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.passesIbanCheck = void 0;
|
|
4
|
+
const IBAN_SHAPE = /^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/;
|
|
5
|
+
const passesIbanCheck = (compact) => {
|
|
6
|
+
const iban = compact.toUpperCase();
|
|
7
|
+
if (!IBAN_SHAPE.test(iban))
|
|
8
|
+
return false;
|
|
9
|
+
const rearranged = iban.slice(4) + iban.slice(0, 4);
|
|
10
|
+
let remainder = 0;
|
|
11
|
+
for (const char of rearranged) {
|
|
12
|
+
const code = char.charCodeAt(0);
|
|
13
|
+
remainder =
|
|
14
|
+
code <= 57 ? (remainder * 10 + (code - 48)) % 97 : (remainder * 100 + (code - 55)) % 97;
|
|
15
|
+
}
|
|
16
|
+
return remainder === 1;
|
|
17
|
+
};
|
|
18
|
+
exports.passesIbanCheck = passesIbanCheck;
|
|
19
|
+
//# sourceMappingURL=iban.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iban.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/iban.ts"],"names":[],"mappings":";;;AACA,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAM7C,MAAM,eAAe,GAAG,CAAC,OAAe,EAAW,EAAE;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAEhC,SAAS;YACP,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAC5F,CAAC;IACD,OAAO,SAAS,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redact-for-export';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./redact-for-export"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const passesLuhn: (digits: string) => boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.passesLuhn = void 0;
|
|
4
|
+
const passesLuhn = (digits) => {
|
|
5
|
+
if (!/^\d+$/.test(digits))
|
|
6
|
+
return false;
|
|
7
|
+
let sum = 0;
|
|
8
|
+
let double = false;
|
|
9
|
+
for (let index = digits.length - 1; index >= 0; index -= 1) {
|
|
10
|
+
let digit = digits.charCodeAt(index) - 48;
|
|
11
|
+
if (double) {
|
|
12
|
+
digit *= 2;
|
|
13
|
+
if (digit > 9)
|
|
14
|
+
digit -= 9;
|
|
15
|
+
}
|
|
16
|
+
sum += digit;
|
|
17
|
+
double = !double;
|
|
18
|
+
}
|
|
19
|
+
return sum % 10 === 0;
|
|
20
|
+
};
|
|
21
|
+
exports.passesLuhn = passesLuhn;
|
|
22
|
+
//# sourceMappingURL=luhn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"luhn.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/luhn.ts"],"names":[],"mappings":";;;AACO,MAAM,UAAU,GAAG,CAAC,MAAc,EAAW,EAAE;IACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC3D,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,IAAI,CAAC,CAAC;YACX,IAAI,KAAK,GAAG,CAAC;gBAAE,KAAK,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,IAAI,KAAK,CAAC;QACb,MAAM,GAAG,CAAC,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAdW,QAAA,UAAU,cAcrB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MonitorTextLocale } from '../../texts/error-type-texts';
|
|
2
|
+
import { ExportRemovalReason } from '../../types/enum/export-removal-reason.enum';
|
|
3
|
+
export declare const replaceExportPatterns: (text: string, locale: MonitorTextLocale, onRemoval: (reason: ExportRemovalReason) => void) => string;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceExportPatterns = void 0;
|
|
4
|
+
const report_texts_1 = require("../../texts/report-texts");
|
|
5
|
+
const export_removal_reason_enum_1 = require("../../types/enum/export-removal-reason.enum");
|
|
6
|
+
const iban_1 = require("./iban");
|
|
7
|
+
const luhn_1 = require("./luhn");
|
|
8
|
+
const EXPORT_EMAIL_PLACEHOLDER = '<email>';
|
|
9
|
+
const EXPORT_IP_PLACEHOLDER = '<ip>';
|
|
10
|
+
const whole = (match) => match.length;
|
|
11
|
+
const digitCount = (match) => match.replace(/\D/g, '').length;
|
|
12
|
+
const acceptBearer = (match) => {
|
|
13
|
+
const token = match.replace(/^\S+\s+/, '');
|
|
14
|
+
return token.length >= 6 && (/[0-9._~+/=-]/.test(token) || token.length >= 20) ? match.length : 0;
|
|
15
|
+
};
|
|
16
|
+
const acceptCard = (match) => (0, luhn_1.passesLuhn)(match.replace(/\D/g, '')) ? match.length : 0;
|
|
17
|
+
const acceptIban = (match) => {
|
|
18
|
+
const parts = match.split(' ');
|
|
19
|
+
for (let kept = parts.length; kept >= 1; kept -= 1) {
|
|
20
|
+
const candidate = parts.slice(0, kept).join(' ');
|
|
21
|
+
if ((0, iban_1.passesIbanCheck)(candidate.replace(/ /g, '')))
|
|
22
|
+
return candidate.length;
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
};
|
|
26
|
+
const acceptPhone = (match) => {
|
|
27
|
+
const digits = digitCount(match);
|
|
28
|
+
return digits >= 9 && digits <= 15 ? match.length : 0;
|
|
29
|
+
};
|
|
30
|
+
const HEX_GROUP = /^[0-9A-Fa-f]{1,4}$/;
|
|
31
|
+
const hexGroups = (part) => {
|
|
32
|
+
if (part === '')
|
|
33
|
+
return [];
|
|
34
|
+
const groups = part.split(':');
|
|
35
|
+
return groups.every((group) => HEX_GROUP.test(group)) ? groups : null;
|
|
36
|
+
};
|
|
37
|
+
const acceptIpv6 = (match) => {
|
|
38
|
+
if (!/[0-9A-Fa-f]/.test(match) || match.includes(':::'))
|
|
39
|
+
return 0;
|
|
40
|
+
const halves = match.split('::');
|
|
41
|
+
if (halves.length > 2)
|
|
42
|
+
return 0;
|
|
43
|
+
const groups = halves.map(hexGroups);
|
|
44
|
+
if (groups.some((group) => group === null))
|
|
45
|
+
return 0;
|
|
46
|
+
const total = groups.reduce((sum, group) => sum + group.length, 0);
|
|
47
|
+
const valid = halves.length === 1 ? total === 8 : total <= 7;
|
|
48
|
+
return valid ? match.length : 0;
|
|
49
|
+
};
|
|
50
|
+
const OCTET = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)';
|
|
51
|
+
const EXPORT_TEXT_PATTERNS = [
|
|
52
|
+
{
|
|
53
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.BEARER,
|
|
54
|
+
regex: /(?<![A-Za-z0-9])(?:bearer|basic)[ \t]+[A-Za-z0-9\-._~+/]+=*/gi,
|
|
55
|
+
accept: acceptBearer,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.JWT,
|
|
59
|
+
regex: /(?<![A-Za-z0-9_-])eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
|
|
60
|
+
accept: whole,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.EMAIL,
|
|
64
|
+
regex: /(?<![A-Za-z0-9._%+-])[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,
|
|
65
|
+
accept: whole,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.IBAN,
|
|
69
|
+
regex: /(?<![A-Za-z0-9])[A-Za-z]{2}\d{2}(?:(?: [A-Za-z0-9]{4}){2,7}(?: [A-Za-z0-9]{1,3})?|[A-Za-z0-9]{11,30})(?![A-Za-z0-9])/g,
|
|
70
|
+
accept: acceptIban,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.CARD_NUMBER,
|
|
74
|
+
regex: /(?<![\w+.-]|\d[ -])\d(?:[ -]?\d){12,18}(?!\w|[ -]\d)/g,
|
|
75
|
+
accept: acceptCard,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.PHONE,
|
|
79
|
+
regex: /(?<![\w+.-]|\d[ .-])(?:\+\d(?:[ .-]?\d){8,14}|0\d(?:[ .-]?\d){7,13})(?!\w|[ .-]\d)/g,
|
|
80
|
+
accept: acceptPhone,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.IP,
|
|
84
|
+
regex: new RegExp(`(?<![\\w.])(?:${OCTET}\\.){3}${OCTET}(?!\\w|\\.\\d)`, 'g'),
|
|
85
|
+
accept: whole,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
reason: export_removal_reason_enum_1.ExportRemovalReason.IP,
|
|
89
|
+
regex: /(?<![\w:.])(?:[0-9A-Fa-f]{0,4}:){2,7}[0-9A-Fa-f]{0,4}(?![\w:])/g,
|
|
90
|
+
accept: acceptIpv6,
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
const replacementOf = (reason, locale) => {
|
|
94
|
+
if (reason === export_removal_reason_enum_1.ExportRemovalReason.EMAIL)
|
|
95
|
+
return EXPORT_EMAIL_PLACEHOLDER;
|
|
96
|
+
if (reason === export_removal_reason_enum_1.ExportRemovalReason.IP)
|
|
97
|
+
return EXPORT_IP_PLACEHOLDER;
|
|
98
|
+
const texts = report_texts_1.MONITOR_REPORT_TEXTS[locale];
|
|
99
|
+
return texts.removedValue(texts.removalLabels[reason]);
|
|
100
|
+
};
|
|
101
|
+
const replaceExportPatterns = (text, locale, onRemoval) => EXPORT_TEXT_PATTERNS.reduce((current, pattern) => current.replace(pattern.regex, (match) => {
|
|
102
|
+
const length = pattern.accept(match);
|
|
103
|
+
if (length === 0)
|
|
104
|
+
return match;
|
|
105
|
+
onRemoval(pattern.reason);
|
|
106
|
+
return replacementOf(pattern.reason, locale) + match.slice(length);
|
|
107
|
+
}), text);
|
|
108
|
+
exports.replaceExportPatterns = replaceExportPatterns;
|
|
109
|
+
//# sourceMappingURL=patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/patterns.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,4FAAkF;AAClF,iCAAyC;AACzC,iCAAoC;AAGpC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAE3C,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAkBrC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;AAEtD,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAG9E,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAC3C,IAAA,iBAAU,EAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAA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E,OAAO,KAAK,CAAC;IAC/B,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC,CAAC,EACJ,IAAI,CACL,CAAC;AAdS,QAAA,qBAAqB,yBAc9B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MonitorTextLocale } from '../../texts/error-type-texts';
|
|
2
|
+
import { ExportRemovalReason } from '../../types/enum/export-removal-reason.enum';
|
|
3
|
+
export declare const EXPORT_MAX_DEPTH = 16;
|
|
4
|
+
export declare const EXPORT_REMOVAL_PATH_MAX_LENGTH = 120;
|
|
5
|
+
export declare const EXPORT_HEADER_ALLOWLIST: readonly string[];
|
|
6
|
+
export declare const EXPORT_CREDENTIAL_KEYS: ReadonlySet<string>;
|
|
7
|
+
export interface IExportRemoval {
|
|
8
|
+
path: string;
|
|
9
|
+
reason: ExportRemovalReason;
|
|
10
|
+
count: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const isExportCredentialKey: (key: string) => boolean;
|
|
13
|
+
export declare const redactForExport: (value: unknown, path: string, locale: MonitorTextLocale) => {
|
|
14
|
+
value: unknown;
|
|
15
|
+
removals: IExportRemoval[];
|
|
16
|
+
};
|
|
17
|
+
export declare const redactTextForExport: (text: string, path: string, locale: MonitorTextLocale) => {
|
|
18
|
+
text: string;
|
|
19
|
+
removals: IExportRemoval[];
|
|
20
|
+
};
|
|
21
|
+
export declare const redactHeadersForExport: (headers: Record<string, string> | null, path: string, locale: MonitorTextLocale) => {
|
|
22
|
+
value: Record<string, string> | null;
|
|
23
|
+
removals: IExportRemoval[];
|
|
24
|
+
};
|
|
25
|
+
export declare const mergeRemovals: (lists: IExportRemoval[][]) => IExportRemoval[];
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeRemovals = exports.redactHeadersForExport = exports.redactTextForExport = exports.redactForExport = exports.isExportCredentialKey = exports.EXPORT_CREDENTIAL_KEYS = exports.EXPORT_HEADER_ALLOWLIST = exports.EXPORT_REMOVAL_PATH_MAX_LENGTH = exports.EXPORT_MAX_DEPTH = void 0;
|
|
4
|
+
const report_texts_1 = require("../../texts/report-texts");
|
|
5
|
+
const export_removal_reason_enum_1 = require("../../types/enum/export-removal-reason.enum");
|
|
6
|
+
const body_redaction_1 = require("../body-redaction");
|
|
7
|
+
const patterns_1 = require("./patterns");
|
|
8
|
+
exports.EXPORT_MAX_DEPTH = 16;
|
|
9
|
+
exports.EXPORT_REMOVAL_PATH_MAX_LENGTH = 120;
|
|
10
|
+
exports.EXPORT_HEADER_ALLOWLIST = [
|
|
11
|
+
'content-type',
|
|
12
|
+
'content-length',
|
|
13
|
+
'accept',
|
|
14
|
+
'user-agent',
|
|
15
|
+
'x-request-id',
|
|
16
|
+
];
|
|
17
|
+
exports.EXPORT_CREDENTIAL_KEYS = new Set([
|
|
18
|
+
'iban',
|
|
19
|
+
'card',
|
|
20
|
+
'cvv',
|
|
21
|
+
'cvc',
|
|
22
|
+
'pan',
|
|
23
|
+
'ssn',
|
|
24
|
+
]);
|
|
25
|
+
const normalizeKey = (key) => key.toLowerCase().replace(/[_-]/g, '');
|
|
26
|
+
const isExportCredentialKey = (key) => (0, body_redaction_1.isCredentialBodyKey)(key, body_redaction_1.CapturedBodySide.REQUEST) ||
|
|
27
|
+
exports.EXPORT_CREDENTIAL_KEYS.has(normalizeKey(key));
|
|
28
|
+
exports.isExportCredentialKey = isExportCredentialKey;
|
|
29
|
+
const safePath = (path, locale) => {
|
|
30
|
+
const redacted = (0, patterns_1.replaceExportPatterns)(path, locale, () => undefined);
|
|
31
|
+
return redacted.length > exports.EXPORT_REMOVAL_PATH_MAX_LENGTH
|
|
32
|
+
? `${redacted.slice(0, exports.EXPORT_REMOVAL_PATH_MAX_LENGTH - 1)}…`
|
|
33
|
+
: redacted;
|
|
34
|
+
};
|
|
35
|
+
class RemovalCollector {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.byKey = new Map();
|
|
38
|
+
}
|
|
39
|
+
add(path, reason, count) {
|
|
40
|
+
if (count <= 0)
|
|
41
|
+
return;
|
|
42
|
+
const key = `${reason}\u0000${path}`;
|
|
43
|
+
const existing = this.byKey.get(key);
|
|
44
|
+
if (existing) {
|
|
45
|
+
existing.count += count;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.byKey.set(key, { path, reason, count });
|
|
49
|
+
}
|
|
50
|
+
list() {
|
|
51
|
+
return [...this.byKey.values()].map((removal) => ({ ...removal }));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const removedValue = (reason, locale) => {
|
|
55
|
+
const texts = report_texts_1.MONITOR_REPORT_TEXTS[locale];
|
|
56
|
+
return texts.removedValue(texts.removalLabels[reason]);
|
|
57
|
+
};
|
|
58
|
+
const remove = (reason, path, context) => {
|
|
59
|
+
context.collector.add(safePath(path, context.locale), reason, 1);
|
|
60
|
+
return removedValue(reason, context.locale);
|
|
61
|
+
};
|
|
62
|
+
const redactText = (text, path, context) => {
|
|
63
|
+
const counts = new Map();
|
|
64
|
+
const redacted = (0, patterns_1.replaceExportPatterns)(text, context.locale, (reason) => {
|
|
65
|
+
counts.set(reason, (counts.get(reason) ?? 0) + 1);
|
|
66
|
+
});
|
|
67
|
+
if (counts.size > 0) {
|
|
68
|
+
const where = safePath(path, context.locale);
|
|
69
|
+
for (const [reason, count] of counts)
|
|
70
|
+
context.collector.add(where, reason, count);
|
|
71
|
+
}
|
|
72
|
+
return redacted;
|
|
73
|
+
};
|
|
74
|
+
const joinKey = (path, key) => (path === '' ? key : `${path}.${key}`);
|
|
75
|
+
const defineKey = (target, key, value) => {
|
|
76
|
+
let name = key;
|
|
77
|
+
for (let rank = 2; Object.prototype.hasOwnProperty.call(target, name); rank += 1) {
|
|
78
|
+
name = `${key} (${rank})`;
|
|
79
|
+
}
|
|
80
|
+
Object.defineProperty(target, name, {
|
|
81
|
+
value,
|
|
82
|
+
enumerable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
configurable: true,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const walk = (value, path, depth, ancestors, context) => {
|
|
88
|
+
if (value === null || value === undefined || typeof value === 'boolean')
|
|
89
|
+
return value;
|
|
90
|
+
if (typeof value === 'string')
|
|
91
|
+
return redactText(value, path, context);
|
|
92
|
+
if (typeof value === 'number') {
|
|
93
|
+
if (!Number.isSafeInteger(value))
|
|
94
|
+
return value;
|
|
95
|
+
const asText = value.toString();
|
|
96
|
+
const redacted = redactText(asText, path, context);
|
|
97
|
+
return redacted === asText ? value : redacted;
|
|
98
|
+
}
|
|
99
|
+
if (typeof value !== 'object')
|
|
100
|
+
return remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, path, context);
|
|
101
|
+
if (value instanceof Date)
|
|
102
|
+
return value;
|
|
103
|
+
if (depth > exports.EXPORT_MAX_DEPTH || ancestors.has(value)) {
|
|
104
|
+
return remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, path, context);
|
|
105
|
+
}
|
|
106
|
+
ancestors.add(value);
|
|
107
|
+
try {
|
|
108
|
+
if (Array.isArray(value)) {
|
|
109
|
+
return value.map((item, index) => walk(item, `${path}[${index}]`, depth + 1, ancestors, context));
|
|
110
|
+
}
|
|
111
|
+
const safe = {};
|
|
112
|
+
for (const [key, item] of Object.entries(value)) {
|
|
113
|
+
const childPath = joinKey(path, key);
|
|
114
|
+
const safeKey = redactText(key, path, context);
|
|
115
|
+
const safeValue = (0, exports.isExportCredentialKey)(key)
|
|
116
|
+
? remove(export_removal_reason_enum_1.ExportRemovalReason.CREDENTIAL_KEY, childPath, context)
|
|
117
|
+
: walk(item, childPath, depth + 1, ancestors, context);
|
|
118
|
+
defineKey(safe, safeKey, safeValue);
|
|
119
|
+
}
|
|
120
|
+
return safe;
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
ancestors.delete(value);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const redactForExport = (value, path, locale) => {
|
|
127
|
+
const context = { locale, collector: new RemovalCollector() };
|
|
128
|
+
const redacted = walk(value, path, 1, new Set(), context);
|
|
129
|
+
return { value: redacted, removals: context.collector.list() };
|
|
130
|
+
};
|
|
131
|
+
exports.redactForExport = redactForExport;
|
|
132
|
+
const redactTextForExport = (text, path, locale) => {
|
|
133
|
+
const context = { locale, collector: new RemovalCollector() };
|
|
134
|
+
const redacted = redactText(text, path, context);
|
|
135
|
+
return { text: redacted, removals: context.collector.list() };
|
|
136
|
+
};
|
|
137
|
+
exports.redactTextForExport = redactTextForExport;
|
|
138
|
+
const redactHeadersForExport = (headers, path, locale) => {
|
|
139
|
+
if (headers === null)
|
|
140
|
+
return { value: null, removals: [] };
|
|
141
|
+
const context = { locale, collector: new RemovalCollector() };
|
|
142
|
+
const safe = {};
|
|
143
|
+
for (const [name, headerValue] of Object.entries(headers)) {
|
|
144
|
+
const childPath = joinKey(path, name);
|
|
145
|
+
const safeName = redactText(name, path, context);
|
|
146
|
+
let safeValue;
|
|
147
|
+
if (!exports.EXPORT_HEADER_ALLOWLIST.includes(name.toLowerCase())) {
|
|
148
|
+
safeValue = remove(export_removal_reason_enum_1.ExportRemovalReason.HEADER, childPath, context);
|
|
149
|
+
}
|
|
150
|
+
else if (typeof headerValue !== 'string') {
|
|
151
|
+
safeValue = remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, childPath, context);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
safeValue = redactText(headerValue, childPath, context);
|
|
155
|
+
}
|
|
156
|
+
defineKey(safe, safeName, safeValue);
|
|
157
|
+
}
|
|
158
|
+
return { value: safe, removals: context.collector.list() };
|
|
159
|
+
};
|
|
160
|
+
exports.redactHeadersForExport = redactHeadersForExport;
|
|
161
|
+
const mergeRemovals = (lists) => {
|
|
162
|
+
const collector = new RemovalCollector();
|
|
163
|
+
for (const list of lists) {
|
|
164
|
+
for (const removal of list)
|
|
165
|
+
collector.add(removal.path, removal.reason, removal.count);
|
|
166
|
+
}
|
|
167
|
+
return collector.list();
|
|
168
|
+
};
|
|
169
|
+
exports.mergeRemovals = mergeRemovals;
|
|
170
|
+
//# sourceMappingURL=redact-for-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-for-export.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/redact-for-export.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,4FAAkF;AAClF,sDAA0E;AAC1E,yCAAmD;AAGtC,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAGtB,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAMrC,QAAA,uBAAuB,GAAsB;IACxD,cAAc;IACd,gBAAgB;IAChB,QAAQ;IACR,YAAY;IACZ,cAAc;CACf,CAAC;AAGW,QAAA,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC,CAAC;AASH,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAG9E,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAW,EAAE,CAC5D,IAAA,oCAAmB,EAAC,GAAG,EAAE,iCAAgB,CAAC,OAAO,CAAC;IAClD,8BAAsB,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAFnC,QAAA,qBAAqB,yBAEc;AAMhD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,MAAyB,EAAU,EAAE;IACnE,MAAM,QAAQ,GAAG,IAAA,gCAAqB,EAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAA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utils/index.js
CHANGED
|
@@ -26,4 +26,6 @@ __exportStar(require("./body-redaction"), exports);
|
|
|
26
26
|
__exportStar(require("./node-require"), exports);
|
|
27
27
|
__exportStar(require("./release.utils"), exports);
|
|
28
28
|
__exportStar(require("./error-fingerprint"), exports);
|
|
29
|
+
__exportStar(require("./export-redaction"), exports);
|
|
30
|
+
__exportStar(require("./error-report"), exports);
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,0DAAwC;AACxC,4DAA0C;AAC1C,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC;AAChC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,0DAAwC;AACxC,4DAA0C;AAC1C,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/monitor",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "Core package to interact with Abyss-Monitor",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"eslint-plugin-node": "^11.1.0",
|
|
53
53
|
"eslint-plugin-prettier": "^3.4.0",
|
|
54
54
|
"eslint-plugin-promise": "^5.1.0",
|
|
55
|
+
"intl-messageformat": "10.7.7",
|
|
55
56
|
"ioredis-mock": "^8.13.1",
|
|
56
57
|
"jest": "^29.7.0",
|
|
57
58
|
"prettier": "2.3.1",
|