@lowdefy/node-utils 0.0.0-experimental-20260928120643 → 0.0.0-experimental-20260929110023
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/createSecretScrubber.js +12 -4
- package/package.json +3 -3
|
@@ -94,13 +94,21 @@ function createSecretScrubber({ secrets, env = process.env }) {
|
|
|
94
94
|
if (form.length > 0) forms.add(form);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
|
-
//
|
|
98
|
-
|
|
97
|
+
// No secrets means no pattern: an empty alternation would match at every position.
|
|
98
|
+
if (forms.size === 0) {
|
|
99
|
+
return function scrub(value) {
|
|
100
|
+
return value;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// One alternation, so every log line and Sentry string takes a single pass however many
|
|
104
|
+
// secrets there are. Longest first, so a form is replaced whole before a shorter form it
|
|
105
|
+
// contains can match at the same position.
|
|
106
|
+
const pattern = new RegExp([
|
|
99
107
|
...forms
|
|
100
|
-
].sort((a, b)=>b.length - a.length);
|
|
108
|
+
].sort((a, b)=>b.length - a.length).map((form)=>form.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
101
109
|
return function scrub(value) {
|
|
102
110
|
if (!type.isString(value)) return value;
|
|
103
|
-
return
|
|
111
|
+
return value.replace(pattern, REDACTED);
|
|
104
112
|
};
|
|
105
113
|
}
|
|
106
114
|
export default createSecretScrubber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/node-utils",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260929110023",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dist/*"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
38
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
37
|
+
"@lowdefy/errors": "0.0.0-experimental-20260929110023",
|
|
38
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260929110023",
|
|
39
39
|
"fs-extra": "11.3.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|