nucleus-core-ts 0.10.240 → 0.10.241
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/.build-ok
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.10.
|
|
1
|
+
0.10.241
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
];
|
|
9
9
|
const SECRET_NAME = /key|secret|token|password|passwd|credential|authorization/i;
|
|
10
10
|
const SECRET_VALUE = /^[A-Za-z0-9+/_=.-]{20,}$/;
|
|
11
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
11
12
|
const TEXT_RULES = [
|
|
12
13
|
[
|
|
13
14
|
'bearer',
|
|
@@ -109,7 +110,9 @@ function removeHits(text, where, name, options, findings) {
|
|
|
109
110
|
}
|
|
110
111
|
const hosts = options.internalHosts;
|
|
111
112
|
if (hosts) out = out.replace(new RegExp(hosts.source, hosts.flags.includes('g') ? hosts.flags : `${hosts.flags}g`), (found)=>hit('host', found));
|
|
112
|
-
|
|
113
|
+
// A UUID under a key-named field (`owner_key`, `credential_id`) is a record id, not a secret; the ids that name a
|
|
114
|
+
// person are mapped by the identity table before this point.
|
|
115
|
+
return SECRET_NAME.test(name) && SECRET_VALUE.test(out) && !UUID.test(out) ? hit('key', out) : out;
|
|
113
116
|
}
|
|
114
117
|
/** Maps identity entries, then removes every rule hit from one string; unmapped hits are reported. `name` is the key the string sits under. */ export function scrubText(text, where, name, options, findings) {
|
|
115
118
|
return mapIdentity(text, options.identity ?? {}, findings).map((segment)=>segment.mapped ? segment.text : removeHits(segment.text, where, name, options, findings)).join('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nucleus-core-ts",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.241",
|
|
4
4
|
"description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
|
|
5
5
|
"author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|