@monotykamary/localterm-server 2.68.4 → 2.69.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/automation-run-tracker.d.ts +1 -0
- package/dist/automation-run-tracker.d.ts.map +1 -1
- package/dist/automation-run-tracker.js +11 -0
- package/dist/automation-run-tracker.js.map +1 -1
- package/dist/automation-store.d.ts.map +1 -1
- package/dist/automation-store.js +5 -1
- package/dist/automation-store.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +7 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +10 -0
- package/dist/schemas.js.map +1 -1
- package/dist/session-manager.d.ts +1 -0
- package/dist/session-manager.d.ts.map +1 -1
- package/dist/session-manager.js +7 -1
- package/dist/session-manager.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/redact-output.d.ts +2 -0
- package/dist/utils/redact-output.d.ts.map +1 -0
- package/dist/utils/redact-output.js +24 -0
- package/dist/utils/redact-output.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { REDACTION_MASK, REDACTION_MIN_VALUE_LENGTH } from "../constants.js";
|
|
2
|
+
// Redact exact known secret values from a complete, already-assembled text
|
|
3
|
+
// string (an automation's accumulated, ANSI-stripped output log). Operating on
|
|
4
|
+
// the final string — not a streaming pipe — means a value split across chunk
|
|
5
|
+
// reads cannot slip through: every value is matched whole, so no cross-chunk
|
|
6
|
+
// overlap tracking is needed (unlike a streaming redactor). Values below the
|
|
7
|
+
// length floor are skipped: a 2-3 char value would substring-match ordinary
|
|
8
|
+
// output everywhere. Longer values are scanned first so a short value that is a
|
|
9
|
+
// substring of a longer one does not mask the longer match before it runs. The
|
|
10
|
+
// fixed single-character mask avoids leaking a value's length.
|
|
11
|
+
export const redactText = (text, values) => {
|
|
12
|
+
const applicable = values.filter((value) => value.length >= REDACTION_MIN_VALUE_LENGTH);
|
|
13
|
+
if (applicable.length === 0)
|
|
14
|
+
return text;
|
|
15
|
+
const ordered = [...applicable].sort((valueA, valueB) => valueB.length - valueA.length);
|
|
16
|
+
let redacted = text;
|
|
17
|
+
for (const value of ordered) {
|
|
18
|
+
if (!redacted.includes(value))
|
|
19
|
+
continue;
|
|
20
|
+
redacted = redacted.split(value).join(REDACTION_MASK);
|
|
21
|
+
}
|
|
22
|
+
return redacted;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=redact-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-output.js","sourceRoot":"","sources":["../../src/utils/redact-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7E,2EAA2E;AAC3E,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,MAAyB,EAAU,EAAE;IAC5E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,0BAA0B,CAAC,CAAC;IACxF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxF,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,SAAS;QACxC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|