field-redactor 1.2.0 → 1.5.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/.github/workflows/ci.yml +38 -0
- package/CHANGELOG.md +156 -0
- package/README.md +64 -670
- package/dist/configValidator.d.ts +10 -0
- package/dist/configValidator.d.ts.map +1 -0
- package/dist/configValidator.js +94 -0
- package/dist/configValidator.js.map +1 -0
- package/dist/copyOnWriteHelpers.d.ts +20 -0
- package/dist/copyOnWriteHelpers.d.ts.map +1 -0
- package/dist/copyOnWriteHelpers.js +58 -0
- package/dist/copyOnWriteHelpers.js.map +1 -0
- package/dist/customObjectManager.d.ts +13 -7
- package/dist/customObjectManager.d.ts.map +1 -1
- package/dist/customObjectManager.js +30 -29
- package/dist/customObjectManager.js.map +1 -1
- package/dist/dryRun.d.ts +8 -0
- package/dist/dryRun.d.ts.map +1 -0
- package/dist/dryRun.js +75 -0
- package/dist/dryRun.js.map +1 -0
- package/dist/dryRunAttribution.d.ts +8 -0
- package/dist/dryRunAttribution.d.ts.map +1 -0
- package/dist/dryRunAttribution.js +106 -0
- package/dist/dryRunAttribution.js.map +1 -0
- package/dist/fieldRedactor.d.ts +43 -5
- package/dist/fieldRedactor.d.ts.map +1 -1
- package/dist/fieldRedactor.js +124 -24
- package/dist/fieldRedactor.js.map +1 -1
- package/dist/fieldRedactorConfigBuilder.d.ts +49 -0
- package/dist/fieldRedactorConfigBuilder.d.ts.map +1 -0
- package/dist/fieldRedactorConfigBuilder.js +98 -0
- package/dist/fieldRedactorConfigBuilder.js.map +1 -0
- package/dist/fieldRedactorDeps.d.ts +17 -0
- package/dist/fieldRedactorDeps.d.ts.map +1 -0
- package/dist/fieldRedactorDeps.js +41 -0
- package/dist/fieldRedactorDeps.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonWalk.d.ts +11 -0
- package/dist/jsonWalk.d.ts.map +1 -0
- package/dist/jsonWalk.js +86 -0
- package/dist/jsonWalk.js.map +1 -0
- package/dist/objectRedactor.d.ts +9 -34
- package/dist/objectRedactor.d.ts.map +1 -1
- package/dist/objectRedactor.js +11 -298
- package/dist/objectRedactor.js.map +1 -1
- package/dist/objectRedactorCow.d.ts +35 -0
- package/dist/objectRedactorCow.d.ts.map +1 -0
- package/dist/objectRedactorCow.js +300 -0
- package/dist/objectRedactorCow.js.map +1 -0
- package/dist/objectRedactorCustomObject.d.ts +49 -0
- package/dist/objectRedactorCustomObject.d.ts.map +1 -0
- package/dist/objectRedactorCustomObject.js +138 -0
- package/dist/objectRedactorCustomObject.js.map +1 -0
- package/dist/objectRedactorHelpers.d.ts +9 -0
- package/dist/objectRedactorHelpers.d.ts.map +1 -0
- package/dist/objectRedactorHelpers.js +58 -0
- package/dist/objectRedactorHelpers.js.map +1 -0
- package/dist/objectRedactorMutation.d.ts +10 -0
- package/dist/objectRedactorMutation.d.ts.map +1 -0
- package/dist/objectRedactorMutation.js +89 -0
- package/dist/objectRedactorMutation.js.map +1 -0
- package/dist/objectRedactorSync.d.ts +2 -0
- package/dist/objectRedactorSync.d.ts.map +1 -0
- package/dist/objectRedactorSync.js +7 -0
- package/dist/objectRedactorSync.js.map +1 -0
- package/dist/objectRedactorTraversal.d.ts +57 -0
- package/dist/objectRedactorTraversal.d.ts.map +1 -0
- package/dist/objectRedactorTraversal.js +576 -0
- package/dist/objectRedactorTraversal.js.map +1 -0
- package/dist/presets.d.ts +22 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +50 -0
- package/dist/presets.js.map +1 -0
- package/dist/primitiveRedactor.d.ts +13 -8
- package/dist/primitiveRedactor.d.ts.map +1 -1
- package/dist/primitiveRedactor.js +32 -27
- package/dist/primitiveRedactor.js.map +1 -1
- package/dist/redactionRules.d.ts +23 -0
- package/dist/redactionRules.d.ts.map +1 -0
- package/dist/redactionRules.js +76 -0
- package/dist/redactionRules.js.map +1 -0
- package/dist/regexUtils.d.ts +3 -0
- package/dist/regexUtils.d.ts.map +1 -0
- package/dist/regexUtils.js +8 -0
- package/dist/regexUtils.js.map +1 -0
- package/dist/secretManager.d.ts +12 -6
- package/dist/secretManager.d.ts.map +1 -1
- package/dist/secretManager.js +40 -14
- package/dist/secretManager.js.map +1 -1
- package/dist/types.d.ts +103 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -1
- package/dist/types.js.map +1 -1
- package/dist/valuePatternMatcher.d.ts +15 -0
- package/dist/valuePatternMatcher.d.ts.map +1 -0
- package/dist/valuePatternMatcher.js +30 -0
- package/dist/valuePatternMatcher.js.map +1 -0
- package/docs/guides/anti-patterns.md +107 -0
- package/docs/guides/metadata-redaction.md +112 -0
- package/docs/guides/migration-1.2-to-1.5.md +106 -0
- package/docs/guides/secret-key-modes.md +108 -0
- package/docs/guides/value-pattern-redaction.md +58 -0
- package/docs/reference/config.md +135 -0
- package/docs/release-notes/2.0.0.md +19 -0
- package/docs/release-notes/2.1.0.md +17 -0
- package/docs/release-notes/2.2.0.md +16 -0
- package/docs/release-notes/2.3.0.md +17 -0
- package/docs/release-notes/2.3.1.md +17 -0
- package/docs/release-notes/2.4.0.md +30 -0
- package/docs/release-notes/2.5.0.md +33 -0
- package/docs/release-notes/2.5.1.md +17 -0
- package/docs/release-notes/README.md +30 -0
- package/docs/release-notes/v1.0.0.md +17 -0
- package/docs/release-notes/v1.1.0.md +18 -0
- package/docs/release-notes/v1.2.0.md +18 -0
- package/docs/release-notes/v1.2.1.md +16 -0
- package/docs/release-notes/v1.2.2.md +19 -0
- package/docs/release-notes/v1.3.0.md +112 -0
- package/docs/release-notes/v1.5.0.md +88 -0
- package/jest.config.js +4 -1
- package/package.json +3 -3
package/dist/presets.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.presets = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
const AUTH_KEY_REMOVAL = {
|
|
6
|
+
deleteSecretKeys: [/authKey/i]
|
|
7
|
+
};
|
|
8
|
+
const NAME_VALUE_EVENT_SCHEMA = {
|
|
9
|
+
name: types_1.CustomObjectMatchType.Ignore,
|
|
10
|
+
value: 'name'
|
|
11
|
+
};
|
|
12
|
+
const NAME_TYPE_VALUE_METADATA_SCHEMA = {
|
|
13
|
+
name: types_1.CustomObjectMatchType.Ignore,
|
|
14
|
+
type: types_1.CustomObjectMatchType.Ignore,
|
|
15
|
+
value: 'name'
|
|
16
|
+
};
|
|
17
|
+
const KEY_VALUE_ENTRY_SCHEMA = {
|
|
18
|
+
key: types_1.CustomObjectMatchType.Ignore,
|
|
19
|
+
value: 'key'
|
|
20
|
+
};
|
|
21
|
+
const APPLICATION_LOG_SECRET_KEYS = [/email/i, /mdn/i, /phone/i, /.+name$/i, /auth/i];
|
|
22
|
+
/**
|
|
23
|
+
* Opinionated configuration presets derived from integration test fixtures.
|
|
24
|
+
* Spread into {@link FieldRedactor} or {@link FieldRedactor.createSafe} config and extend as needed.
|
|
25
|
+
*/
|
|
26
|
+
exports.presets = {
|
|
27
|
+
/**
|
|
28
|
+
* `{ name, type, value }` metadata entries with sibling-key redaction and auth key removal.
|
|
29
|
+
* Pair with your own `secretKeys` for field names that should trigger redaction.
|
|
30
|
+
*/
|
|
31
|
+
loggingMetadata() {
|
|
32
|
+
return Object.assign(Object.assign({}, AUTH_KEY_REMOVAL), { customObjects: [NAME_TYPE_VALUE_METADATA_SCHEMA] });
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Application log preset from `realExamples.spec.ts`: common PII field patterns,
|
|
36
|
+
* auth key removal, and `{ name, value }` event metadata schemas.
|
|
37
|
+
*/
|
|
38
|
+
applicationLogging() {
|
|
39
|
+
return Object.assign(Object.assign({ secretKeys: APPLICATION_LOG_SECRET_KEYS }, AUTH_KEY_REMOVAL), { customObjects: [NAME_VALUE_EVENT_SCHEMA] });
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* `{ key, value }` shaped entries (blanket coverage small schema).
|
|
43
|
+
*/
|
|
44
|
+
keyValueEntries() {
|
|
45
|
+
return {
|
|
46
|
+
customObjects: [KEY_VALUE_ENTRY_SCHEMA]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":";;;AAAA,mCAAmF;AAEnF,MAAM,gBAAgB,GAAkD;IACtE,gBAAgB,EAAE,CAAC,UAAU,CAAC;CAC/B,CAAC;AAEF,MAAM,uBAAuB,GAAiB;IAC5C,IAAI,EAAE,6BAAqB,CAAC,MAAM;IAClC,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,+BAA+B,GAAiB;IACpD,IAAI,EAAE,6BAAqB,CAAC,MAAM;IAClC,IAAI,EAAE,6BAAqB,CAAC,MAAM;IAClC,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,sBAAsB,GAAiB;IAC3C,GAAG,EAAE,6BAAqB,CAAC,MAAM;IACjC,KAAK,EAAE,KAAK;CACb,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAEtF;;;GAGG;AACU,QAAA,OAAO,GAAG;IACrB;;;OAGG;IACH,eAAe;QACb,uCACK,gBAAgB,KACnB,aAAa,EAAE,CAAC,+BAA+B,CAAC,IAChD;IACJ,CAAC;IAED;;;OAGG;IACH,kBAAkB;QAChB,qCACE,UAAU,EAAE,2BAA2B,IACpC,gBAAgB,KACnB,aAAa,EAAE,CAAC,uBAAuB,CAAC,IACxC;IACJ,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO;YACL,aAAa,EAAE,CAAC,sBAAsB,CAAC;SACxC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrimitiveRedactorConfig } from './types';
|
|
1
|
+
import { PrimitiveRedactorConfig, RedactablePrimitive, RedactedPrimitive } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Redacts primitive values based on the configuration provided in the constructor. Uses the redactor
|
|
4
4
|
* privded in the constructor to redact values, or a basic redactor which returns 'REDACTED' if no redactor
|
|
@@ -6,23 +6,28 @@ import { PrimitiveRedactorConfig } from './types';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class PrimitiveRedactor {
|
|
8
8
|
private static DEFAULT_REDACTED_TEXT;
|
|
9
|
-
private ignoreBooleans;
|
|
10
|
-
private ignoreNullOrUndefined;
|
|
11
|
-
private
|
|
9
|
+
private readonly ignoreBooleans;
|
|
10
|
+
private readonly ignoreNullOrUndefined;
|
|
11
|
+
private readonly useAsyncRedactor;
|
|
12
|
+
private readonly syncRedactor;
|
|
13
|
+
private readonly asyncRedactor?;
|
|
12
14
|
/**
|
|
13
15
|
* Creates a PrimitiveRedactor with the specified configuration.
|
|
14
16
|
* @param config The PrimitiveRedactor configuration which specifies the redactor to use, whether to
|
|
15
17
|
* ignore booleans, and whether to ignore null or undefined values.
|
|
16
18
|
*/
|
|
17
19
|
constructor(config: PrimitiveRedactorConfig);
|
|
20
|
+
usesAsyncRedactor(): boolean;
|
|
18
21
|
/**
|
|
19
22
|
* Redacts the primitive value based on the configuration provided in the constructor.
|
|
20
23
|
* @param value The value to redact.
|
|
21
24
|
* @returns The redacted value.
|
|
22
25
|
*/
|
|
23
|
-
redactValue(value:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
redactValue(value: RedactablePrimitive): Promise<RedactedPrimitive>;
|
|
27
|
+
/**
|
|
28
|
+
* Synchronously redacts a primitive value without Promise allocation.
|
|
29
|
+
*/
|
|
30
|
+
redactValueSync(value: RedactablePrimitive): RedactedPrimitive;
|
|
31
|
+
private redactWith;
|
|
27
32
|
}
|
|
28
33
|
//# sourceMappingURL=primitiveRedactor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveRedactor.d.ts","sourceRoot":"","sources":["../src/primitiveRedactor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"primitiveRedactor.d.ts","sourceRoot":"","sources":["../src/primitiveRedactor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAIlB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAc;IAClD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAU;IAChD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;IAC3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C;;;;OAIG;gBACS,MAAM,EAAE,uBAAuB;IAepC,iBAAiB,IAAI,OAAO;IAInC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQhF;;OAEG;IACI,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,iBAAiB;IAIrE,OAAO,CAAC,UAAU;CAkBnB"}
|
|
@@ -22,12 +22,21 @@ class PrimitiveRedactor {
|
|
|
22
22
|
* ignore booleans, and whether to ignore null or undefined values.
|
|
23
23
|
*/
|
|
24
24
|
constructor(config) {
|
|
25
|
-
|
|
26
|
-
if (config.redactor) {
|
|
27
|
-
this.redactor = config.redactor;
|
|
28
|
-
}
|
|
25
|
+
var _a;
|
|
29
26
|
this.ignoreBooleans = config.ignoreBooleans;
|
|
30
27
|
this.ignoreNullOrUndefined = config.ignoreNullOrUndefined;
|
|
28
|
+
this.useAsyncRedactor = !!config.redactor && !config.syncRedactor;
|
|
29
|
+
this.syncRedactor = (_a = config.syncRedactor) !== null && _a !== void 0 ? _a : (config.redactor
|
|
30
|
+
? () => {
|
|
31
|
+
throw new Error('Sync redaction is not available without syncRedactor configuration');
|
|
32
|
+
}
|
|
33
|
+
: () => PrimitiveRedactor.DEFAULT_REDACTED_TEXT);
|
|
34
|
+
if (config.redactor) {
|
|
35
|
+
this.asyncRedactor = config.redactor;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
usesAsyncRedactor() {
|
|
39
|
+
return this.useAsyncRedactor;
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
42
|
* Redacts the primitive value based on the configuration provided in the constructor.
|
|
@@ -36,33 +45,29 @@ class PrimitiveRedactor {
|
|
|
36
45
|
*/
|
|
37
46
|
redactValue(value) {
|
|
38
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
if (
|
|
40
|
-
return this.
|
|
41
|
-
}
|
|
42
|
-
else if (!value) {
|
|
43
|
-
return this.redactNullOrUndefinedValue(value);
|
|
44
|
-
}
|
|
45
|
-
return this.redactAny(value);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
redactNullOrUndefinedValue(value) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
if (this.ignoreNullOrUndefined) {
|
|
51
|
-
const result = yield Promise.resolve(value);
|
|
52
|
-
return result;
|
|
48
|
+
if (!this.useAsyncRedactor) {
|
|
49
|
+
return this.redactValueSync(value);
|
|
53
50
|
}
|
|
54
|
-
return this.
|
|
51
|
+
return this.redactWith(value, (input) => this.asyncRedactor(input));
|
|
55
52
|
});
|
|
56
53
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Synchronously redacts a primitive value without Promise allocation.
|
|
56
|
+
*/
|
|
57
|
+
redactValueSync(value) {
|
|
58
|
+
return this.redactWith(value, (input) => this.syncRedactor(input));
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return this.
|
|
65
|
-
}
|
|
60
|
+
redactWith(value, apply) {
|
|
61
|
+
if (typeof value === 'boolean') {
|
|
62
|
+
return this.ignoreBooleans ? value : apply(value);
|
|
63
|
+
}
|
|
64
|
+
if (value === null || value === undefined) {
|
|
65
|
+
return this.ignoreNullOrUndefined ? value : apply(value);
|
|
66
|
+
}
|
|
67
|
+
if (value === '' || value === 0) {
|
|
68
|
+
return this.ignoreNullOrUndefined ? value : apply(value);
|
|
69
|
+
}
|
|
70
|
+
return apply(value);
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
exports.PrimitiveRedactor = PrimitiveRedactor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveRedactor.js","sourceRoot":"","sources":["../src/primitiveRedactor.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"primitiveRedactor.js","sourceRoot":"","sources":["../src/primitiveRedactor.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA;;;;GAIG;AACH,MAAa,iBAAiB;IAQ5B;;;;OAIG;IACH,YAAY,MAA+B;;QACzC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAClE,IAAI,CAAC,YAAY,GAAG,MAAA,MAAM,CAAC,YAAY,mCAAI,CAAC,MAAM,CAAC,QAAQ;YACzD,CAAC,CAAC,GAAG,EAAE;gBACH,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;YACxF,CAAC;YACH,CAAC,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CA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QAC3D,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;;AArEH,8CAsEC;AArEgB,uCAAqB,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CustomObject, FieldRedactorConfig } from './types';
|
|
2
|
+
export declare const SECRET_REGEX_FIELDS: readonly ["secretKeys", "deepSecretKeys", "fullSecretKeys", "deleteSecretKeys"];
|
|
3
|
+
export declare const VALUE_PATTERN_FIELDS: readonly ["valuePatterns"];
|
|
4
|
+
export declare const REGEX_ARRAY_CONFIG_FIELDS: readonly ["secretKeys", "deepSecretKeys", "fullSecretKeys", "deleteSecretKeys", "valuePatterns"];
|
|
5
|
+
export type SecretRegexField = (typeof SECRET_REGEX_FIELDS)[number];
|
|
6
|
+
export type ValuePatternField = (typeof VALUE_PATTERN_FIELDS)[number];
|
|
7
|
+
export type RegexArrayConfigField = (typeof REGEX_ARRAY_CONFIG_FIELDS)[number];
|
|
8
|
+
export declare const RULE_LIST_FIELDS: readonly ["secretKeys", "deepSecretKeys", "fullSecretKeys", "deleteSecretKeys", "valuePatterns", "customObjects"];
|
|
9
|
+
export declare const hasExplicitRedactionRules: (config?: FieldRedactorConfig) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* When only value patterns are configured, shallow key matching must be disabled (`secretKeys: []`)
|
|
12
|
+
* so the legacy default does not redact every field.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveSecretKeys: (config?: FieldRedactorConfig) => RegExp[] | undefined;
|
|
15
|
+
export declare const appendRegExpArray: <F extends RegexArrayConfigField>(config: FieldRedactorConfig, field: F, patterns: RegExp[]) => void;
|
|
16
|
+
export declare const appendRegexToConfig: (config: FieldRedactorConfig, field: SecretRegexField, patterns: RegExp[]) => void;
|
|
17
|
+
export type RegisteredSchema = {
|
|
18
|
+
object: CustomObject;
|
|
19
|
+
name?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const finalizeRegisteredSchemas: (schemas: RegisteredSchema[]) => Pick<FieldRedactorConfig, "customObjects" | "schemaNames">;
|
|
22
|
+
export declare const mergePartialConfig: (target: FieldRedactorConfig, schemas: RegisteredSchema[], partial: Partial<FieldRedactorConfig>) => void;
|
|
23
|
+
//# sourceMappingURL=redactionRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redactionRules.d.ts","sourceRoot":"","sources":["../src/redactionRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5D,eAAO,MAAM,mBAAmB,iFAAkF,CAAC;AAEnH,eAAO,MAAM,oBAAoB,4BAA6B,CAAC;AAE/D,eAAO,MAAM,yBAAyB,kGAA6D,CAAC;AAEpG,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,eAAO,MAAM,gBAAgB,mHAA2D,CAAC;AAIzF,eAAO,MAAM,yBAAyB,YAAa,mBAAmB,KAAG,OACqB,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,mBAAmB,KAAG,MAAM,EAAE,GAAG,SAkB3E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,qBAAqB,UACvD,mBAAmB,SACpB,CAAC,YACE,MAAM,EAAE,KACjB,IAEF,CAAC;AAEF,eAAO,MAAM,mBAAmB,WACtB,mBAAmB,SACpB,gBAAgB,YACb,MAAM,EAAE,KACjB,IAEF,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,yBAAyB,YAC3B,gBAAgB,EAAE,KAC1B,IAAI,CAAC,mBAAmB,EAAE,eAAe,GAAG,aAAa,CAS3D,CAAC;AAqBF,eAAO,MAAM,kBAAkB,WACrB,mBAAmB,WAClB,gBAAgB,EAAE,WAClB,OAAO,CAAC,mBAAmB,CAAC,KACpC,IASF,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergePartialConfig = exports.finalizeRegisteredSchemas = exports.appendRegexToConfig = exports.appendRegExpArray = exports.resolveSecretKeys = exports.hasExplicitRedactionRules = exports.RULE_LIST_FIELDS = exports.REGEX_ARRAY_CONFIG_FIELDS = exports.VALUE_PATTERN_FIELDS = exports.SECRET_REGEX_FIELDS = void 0;
|
|
4
|
+
exports.SECRET_REGEX_FIELDS = ['secretKeys', 'deepSecretKeys', 'fullSecretKeys', 'deleteSecretKeys'];
|
|
5
|
+
exports.VALUE_PATTERN_FIELDS = ['valuePatterns'];
|
|
6
|
+
exports.REGEX_ARRAY_CONFIG_FIELDS = [...exports.SECRET_REGEX_FIELDS, ...exports.VALUE_PATTERN_FIELDS];
|
|
7
|
+
exports.RULE_LIST_FIELDS = [...exports.REGEX_ARRAY_CONFIG_FIELDS, 'customObjects'];
|
|
8
|
+
const hasNonEmptyArray = (value) => value !== undefined && value.length > 0;
|
|
9
|
+
const hasExplicitRedactionRules = (config) => exports.RULE_LIST_FIELDS.some((field) => hasNonEmptyArray(config === null || config === void 0 ? void 0 : config[field]));
|
|
10
|
+
exports.hasExplicitRedactionRules = hasExplicitRedactionRules;
|
|
11
|
+
/**
|
|
12
|
+
* When only value patterns are configured, shallow key matching must be disabled (`secretKeys: []`)
|
|
13
|
+
* so the legacy default does not redact every field.
|
|
14
|
+
*/
|
|
15
|
+
const resolveSecretKeys = (config) => {
|
|
16
|
+
const { secretKeys, deepSecretKeys, fullSecretKeys, deleteSecretKeys, customObjects, valuePatterns } = config !== null && config !== void 0 ? config : {};
|
|
17
|
+
if (secretKeys !== undefined) {
|
|
18
|
+
return secretKeys;
|
|
19
|
+
}
|
|
20
|
+
if ((valuePatterns === null || valuePatterns === void 0 ? void 0 : valuePatterns.length) &&
|
|
21
|
+
!(deepSecretKeys === null || deepSecretKeys === void 0 ? void 0 : deepSecretKeys.length) &&
|
|
22
|
+
!(fullSecretKeys === null || fullSecretKeys === void 0 ? void 0 : fullSecretKeys.length) &&
|
|
23
|
+
!(deleteSecretKeys === null || deleteSecretKeys === void 0 ? void 0 : deleteSecretKeys.length) &&
|
|
24
|
+
!(customObjects === null || customObjects === void 0 ? void 0 : customObjects.length)) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
exports.resolveSecretKeys = resolveSecretKeys;
|
|
30
|
+
const appendRegExpArray = (config, field, patterns) => {
|
|
31
|
+
var _a;
|
|
32
|
+
config[field] = [...((_a = config[field]) !== null && _a !== void 0 ? _a : []), ...patterns];
|
|
33
|
+
};
|
|
34
|
+
exports.appendRegExpArray = appendRegExpArray;
|
|
35
|
+
const appendRegexToConfig = (config, field, patterns) => {
|
|
36
|
+
(0, exports.appendRegExpArray)(config, field, patterns);
|
|
37
|
+
};
|
|
38
|
+
exports.appendRegexToConfig = appendRegexToConfig;
|
|
39
|
+
const finalizeRegisteredSchemas = (schemas) => {
|
|
40
|
+
if (schemas.length === 0) {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
const customObjects = schemas.map((entry) => entry.object);
|
|
44
|
+
const schemaNames = schemas.map((entry) => entry.name);
|
|
45
|
+
return schemaNames.some((name) => name !== undefined) ? { customObjects, schemaNames } : { customObjects };
|
|
46
|
+
};
|
|
47
|
+
exports.finalizeRegisteredSchemas = finalizeRegisteredSchemas;
|
|
48
|
+
const PRESET_SCALAR_FIELDS = [
|
|
49
|
+
'redactor',
|
|
50
|
+
'syncRedactor',
|
|
51
|
+
'ignoreBooleans',
|
|
52
|
+
'ignoreNullOrUndefined',
|
|
53
|
+
'cloneInput',
|
|
54
|
+
'strict',
|
|
55
|
+
'onConfigWarning'
|
|
56
|
+
];
|
|
57
|
+
const applyUnsetScalars = (target, partial) => {
|
|
58
|
+
for (const field of PRESET_SCALAR_FIELDS) {
|
|
59
|
+
const value = partial[field];
|
|
60
|
+
if (value !== undefined && target[field] === undefined) {
|
|
61
|
+
Object.assign(target, { [field]: value });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const mergePartialConfig = (target, schemas, partial) => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
for (const field of exports.REGEX_ARRAY_CONFIG_FIELDS) {
|
|
68
|
+
if ((_a = partial[field]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
69
|
+
(0, exports.appendRegExpArray)(target, field, partial[field]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
(_b = partial.customObjects) === null || _b === void 0 ? void 0 : _b.forEach((object) => schemas.push({ object }));
|
|
73
|
+
applyUnsetScalars(target, partial);
|
|
74
|
+
};
|
|
75
|
+
exports.mergePartialConfig = mergePartialConfig;
|
|
76
|
+
//# sourceMappingURL=redactionRules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redactionRules.js","sourceRoot":"","sources":["../src/redactionRules.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG,CAAC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,CAAU,CAAC;AAEtG,QAAA,oBAAoB,GAAG,CAAC,eAAe,CAAU,CAAC;AAElD,QAAA,yBAAyB,GAAG,CAAC,GAAG,2BAAmB,EAAE,GAAG,4BAAoB,CAAU,CAAC;AAQvF,QAAA,gBAAgB,GAAG,CAAC,GAAG,iCAAyB,EAAE,eAAe,CAAU,CAAC;AAEzF,MAAM,gBAAgB,GAAG,CAAI,KAA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CAAC,KAAK,SAAS,EAAE,CAAC;YACvD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,kBAAkB,GAAG,CAChC,MAA2B,EAC3B,OAA2B,EAC3B,OAAqC,EAC/B,EAAE;;IACR,KAAK,MAAM,KAAK,IAAI,iCAAyB,EAAE,CAAC;QAC9C,IAAI,MAAA,OAAO,CAAC,KAAK,CAAC,0CAAE,MAAM,EAAE,CAAC;YAC3B,IAAA,yBAAiB,EAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAA,OAAO,CAAC,aAAa,0CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACrE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC;AAbW,QAAA,kBAAkB,sBAa7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexUtils.d.ts","sourceRoot":"","sources":["../src/regexUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MAA2C,CAAC;AAEzF,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,MAA2C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.regexIdentity = exports.formatRegExp = void 0;
|
|
4
|
+
const formatRegExp = (regex) => `/${regex.source}/${regex.flags}`;
|
|
5
|
+
exports.formatRegExp = formatRegExp;
|
|
6
|
+
const regexIdentity = (regex) => `${regex.source}\0${regex.flags}`;
|
|
7
|
+
exports.regexIdentity = regexIdentity;
|
|
8
|
+
//# sourceMappingURL=regexUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexUtils.js","sourceRoot":"","sources":["../src/regexUtils.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;AAA5E,QAAA,YAAY,gBAAgE;AAElF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;AAA7E,QAAA,aAAa,iBAAgE"}
|
package/dist/secretManager.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SecretManagerConfig } from './types';
|
|
1
|
+
import { SecretManagerConfig, SecretSpecifierValue } from './types';
|
|
2
|
+
type KeyRule = 'remove' | 'opaque' | 'deep' | 'shallow';
|
|
2
3
|
/**
|
|
3
4
|
* Utility class for managing secrets and determining if a given value is a secret of any type. If no secrets of
|
|
4
5
|
* any type are provided in the configuration then all values are considered secrets (but not deep or full secrets).
|
|
@@ -15,25 +16,30 @@ export declare class SecretManager {
|
|
|
15
16
|
* @param key The key to check.
|
|
16
17
|
* @returns True if the key is a secret key or no secret keys exist, otherwise false.
|
|
17
18
|
*/
|
|
18
|
-
isSecretKey(key:
|
|
19
|
+
isSecretKey(key: SecretSpecifierValue): boolean;
|
|
19
20
|
/**
|
|
20
21
|
* Determines if a key is a deep secret based on the deepSecretKeys configuration provided in the constructor.
|
|
21
22
|
* @param key The key to check.
|
|
22
23
|
* @returns True if the key is a deep secret key, otherwise false.
|
|
23
24
|
*/
|
|
24
|
-
isDeepSecretKey(key:
|
|
25
|
+
isDeepSecretKey(key: SecretSpecifierValue): boolean;
|
|
25
26
|
/**
|
|
26
27
|
* Determines if a key is a full secret based on the fullSecretKeys configuration provided in the constructor.
|
|
27
28
|
* @param key The key to check.
|
|
28
29
|
* @returns True if the key is a full secret key, otherwise false.
|
|
29
30
|
*/
|
|
30
|
-
isFullSecretKey(key:
|
|
31
|
+
isFullSecretKey(key: SecretSpecifierValue): boolean;
|
|
31
32
|
/**
|
|
32
33
|
* Determines if a key is a delete secret based on the deleteSecretKeys configuration provided in the constructor.
|
|
33
34
|
* @param key The key to check.
|
|
34
35
|
* @returns True if the key is a delete secret key, otherwise false.
|
|
35
36
|
*/
|
|
36
|
-
isDeleteSecretKey(key:
|
|
37
|
-
|
|
37
|
+
isDeleteSecretKey(key: SecretSpecifierValue): boolean;
|
|
38
|
+
getKeyRulePattern(key: SecretSpecifierValue, rule: KeyRule): string | undefined;
|
|
39
|
+
classifyKeyRule(key: SecretSpecifierValue): 'remove' | 'opaque' | 'deep' | 'shallow' | 'default' | null;
|
|
40
|
+
private regexListFor;
|
|
41
|
+
private static findMatchingRegex;
|
|
42
|
+
private static matchesAnyRegex;
|
|
38
43
|
}
|
|
44
|
+
export {};
|
|
39
45
|
//# sourceMappingURL=secretManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretManager.d.ts","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secretManager.d.ts","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpE,KAAK,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAC,CAAW;IAC9B,OAAO,CAAC,cAAc,CAAC,CAAW;IAClC,OAAO,CAAC,cAAc,CAAC,CAAW;IAClC,OAAO,CAAC,gBAAgB,CAAC,CAAW;gBAExB,MAAM,EAAE,mBAAmB;IAYvC;;;;;OAKG;IACI,WAAW,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO;IAQtD;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO;IAI1D;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO;IAI1D;;;;OAIG;IACI,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO;IAIrD,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAK/E,eAAe,CAAC,GAAG,EAAE,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI;IAoB9G,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAIhC,OAAO,CAAC,MAAM,CAAC,eAAe;CAG/B"}
|
package/dist/secretManager.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SecretManager = void 0;
|
|
4
|
+
const regexUtils_1 = require("./regexUtils");
|
|
4
5
|
/**
|
|
5
6
|
* Utility class for managing secrets and determining if a given value is a secret of any type. If no secrets of
|
|
6
7
|
* any type are provided in the configuration then all values are considered secrets (but not deep or full secrets).
|
|
@@ -27,7 +28,7 @@ class SecretManager {
|
|
|
27
28
|
if (!this.secretKeys) {
|
|
28
29
|
return true;
|
|
29
30
|
}
|
|
30
|
-
return SecretManager.
|
|
31
|
+
return SecretManager.matchesAnyRegex(key, this.secretKeys);
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Determines if a key is a deep secret based on the deepSecretKeys configuration provided in the constructor.
|
|
@@ -35,10 +36,7 @@ class SecretManager {
|
|
|
35
36
|
* @returns True if the key is a deep secret key, otherwise false.
|
|
36
37
|
*/
|
|
37
38
|
isDeepSecretKey(key) {
|
|
38
|
-
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return SecretManager.valueMatchesAnyRegexValue(key, this.deepSecretKeys);
|
|
39
|
+
return !!this.deepSecretKeys && SecretManager.matchesAnyRegex(key, this.deepSecretKeys);
|
|
42
40
|
}
|
|
43
41
|
/**
|
|
44
42
|
* Determines if a key is a full secret based on the fullSecretKeys configuration provided in the constructor.
|
|
@@ -46,10 +44,7 @@ class SecretManager {
|
|
|
46
44
|
* @returns True if the key is a full secret key, otherwise false.
|
|
47
45
|
*/
|
|
48
46
|
isFullSecretKey(key) {
|
|
49
|
-
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return SecretManager.valueMatchesAnyRegexValue(key, this.fullSecretKeys);
|
|
47
|
+
return !!this.fullSecretKeys && SecretManager.matchesAnyRegex(key, this.fullSecretKeys);
|
|
53
48
|
}
|
|
54
49
|
/**
|
|
55
50
|
* Determines if a key is a delete secret based on the deleteSecretKeys configuration provided in the constructor.
|
|
@@ -57,13 +52,44 @@ class SecretManager {
|
|
|
57
52
|
* @returns True if the key is a delete secret key, otherwise false.
|
|
58
53
|
*/
|
|
59
54
|
isDeleteSecretKey(key) {
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
return !!this.deleteSecretKeys && SecretManager.matchesAnyRegex(key, this.deleteSecretKeys);
|
|
56
|
+
}
|
|
57
|
+
getKeyRulePattern(key, rule) {
|
|
58
|
+
const match = SecretManager.findMatchingRegex(key, this.regexListFor(rule));
|
|
59
|
+
return match ? (0, regexUtils_1.formatRegExp)(match) : undefined;
|
|
60
|
+
}
|
|
61
|
+
classifyKeyRule(key) {
|
|
62
|
+
if (this.isDeleteSecretKey(key)) {
|
|
63
|
+
return 'remove';
|
|
64
|
+
}
|
|
65
|
+
if (this.isFullSecretKey(key)) {
|
|
66
|
+
return 'opaque';
|
|
62
67
|
}
|
|
63
|
-
|
|
68
|
+
if (this.isDeepSecretKey(key)) {
|
|
69
|
+
return 'deep';
|
|
70
|
+
}
|
|
71
|
+
if (this.isSecretKey(key)) {
|
|
72
|
+
return this.secretKeys ? 'shallow' : 'default';
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
regexListFor(rule) {
|
|
77
|
+
switch (rule) {
|
|
78
|
+
case 'remove':
|
|
79
|
+
return this.deleteSecretKeys;
|
|
80
|
+
case 'opaque':
|
|
81
|
+
return this.fullSecretKeys;
|
|
82
|
+
case 'deep':
|
|
83
|
+
return this.deepSecretKeys;
|
|
84
|
+
case 'shallow':
|
|
85
|
+
return this.secretKeys;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
static findMatchingRegex(key, regexes) {
|
|
89
|
+
return regexes === null || regexes === void 0 ? void 0 : regexes.find((regex) => regex.test(String(key)));
|
|
64
90
|
}
|
|
65
|
-
static
|
|
66
|
-
return regexes.some((regex) => regex.test(value));
|
|
91
|
+
static matchesAnyRegex(value, regexes) {
|
|
92
|
+
return regexes.some((regex) => regex.test(String(value)));
|
|
67
93
|
}
|
|
68
94
|
}
|
|
69
95
|
exports.SecretManager = SecretManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretManager.js","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"secretManager.js","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAK5C;;;GAGG;AACH,MAAa,aAAa;IAMxB,YAAY,MAA2B;QACrC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAEhD,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACtG,IAAI,CAAC,UAAU,G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type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
/** Function values encountered during traversal are left unchanged. */
|
|
4
|
+
export type JsonFunction = (...args: never[]) => unknown;
|
|
5
|
+
/** Scalar values that may appear in JSON-like structures during redaction. */
|
|
6
|
+
export type JsonLeafValue = JsonPrimitive | Date | JsonFunction;
|
|
7
|
+
/** JSON-compatible object. */
|
|
8
|
+
export type JsonObject = {
|
|
9
|
+
[key: string]: JsonValue | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** JSON-compatible array. */
|
|
12
|
+
export type JsonArray = Array<JsonValue | undefined>;
|
|
13
|
+
/** JSON-compatible value. */
|
|
14
|
+
export type JsonValue = JsonLeafValue | JsonObject | JsonArray;
|
|
15
|
+
/**
|
|
16
|
+
* Values accepted by {@link FieldRedactor.redact} and {@link FieldRedactor.redactInPlace}.
|
|
17
|
+
* Root-level primitives, `Date`, and functions are returned unchanged without traversal.
|
|
18
|
+
*/
|
|
19
|
+
export type RedactableInput = JsonValue | undefined;
|
|
20
|
+
/** Primitive values that may be passed to a custom {@link Redactor} function. */
|
|
21
|
+
export type RedactorInput = JsonPrimitive | undefined;
|
|
22
|
+
/** Primitive values processed by {@link PrimitiveRedactor}. */
|
|
23
|
+
export type RedactablePrimitive = RedactorInput;
|
|
24
|
+
/** Result of redacting a primitive value. */
|
|
25
|
+
export type RedactedPrimitive = string | boolean | null | undefined | 0;
|
|
26
|
+
/**
|
|
27
|
+
* Sibling field value used to resolve secret specifiers in custom object schemas
|
|
28
|
+
* (for example, the string `"email"` in a `{ name, value }` metadata entry).
|
|
29
|
+
*/
|
|
30
|
+
export type SecretSpecifierValue = string | number | boolean;
|
|
31
|
+
export type Redactor = (value: RedactorInput) => Promise<string>;
|
|
32
|
+
/** Synchronous redactor for use with {@link FieldRedactor.redactSync} without Promise overhead. */
|
|
33
|
+
export type SyncRedactor = (value: RedactorInput) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Per-field redaction mode inside a {@link CustomObject} schema.
|
|
36
|
+
* Values align with the top-level doc labels: Shallow, Deep, Opaque (Full), Remove (Delete).
|
|
37
|
+
*/
|
|
2
38
|
export declare enum CustomObjectMatchType {
|
|
3
39
|
Delete = 0,
|
|
4
40
|
Full = 1,
|
|
@@ -8,21 +44,86 @@ export declare enum CustomObjectMatchType {
|
|
|
8
44
|
Ignore = 5
|
|
9
45
|
}
|
|
10
46
|
export type CustomObject = {
|
|
47
|
+
/**
|
|
48
|
+
* Object schema for **Schema** (`customObjects`) mode.
|
|
49
|
+
* Keys define required fields for matching; input objects may contain additional keys.
|
|
50
|
+
*/
|
|
11
51
|
[key: string]: CustomObjectMatchType | string;
|
|
12
52
|
};
|
|
13
53
|
export type PrimitiveRedactorConfig = {
|
|
14
54
|
redactor?: Redactor;
|
|
55
|
+
syncRedactor?: SyncRedactor;
|
|
15
56
|
ignoreBooleans: boolean;
|
|
16
57
|
ignoreNullOrUndefined: boolean;
|
|
17
58
|
};
|
|
18
59
|
export type SecretManagerConfig = {
|
|
60
|
+
/** Shallow — redact matching keys' scalar values only (`secretKeys`). */
|
|
19
61
|
secretKeys?: RegExp[];
|
|
62
|
+
/** Deep — redact matching keys and all descendant primitives (`deepSecretKeys`). */
|
|
20
63
|
deepSecretKeys?: RegExp[];
|
|
64
|
+
/** Opaque — stringify entire value at matching keys, then redact (`fullSecretKeys`). */
|
|
21
65
|
fullSecretKeys?: RegExp[];
|
|
66
|
+
/** Remove — delete matching keys from output (`deleteSecretKeys`). */
|
|
22
67
|
deleteSecretKeys?: RegExp[];
|
|
23
68
|
};
|
|
24
|
-
export type
|
|
69
|
+
export type ValuePatternConfig = {
|
|
70
|
+
/**
|
|
71
|
+
* Opt-in value-pattern redaction: redact scalar fields whose **string form** matches a pattern,
|
|
72
|
+
* regardless of key name. Lowest precedence — runs only when key-based rules leave the value unchanged.
|
|
73
|
+
*/
|
|
74
|
+
valuePatterns?: RegExp[];
|
|
75
|
+
};
|
|
76
|
+
export type FieldRedactorConfig = Partial<PrimitiveRedactorConfig> & SecretManagerConfig & ValuePatternConfig & {
|
|
25
77
|
redactor?: Redactor;
|
|
78
|
+
syncRedactor?: SyncRedactor;
|
|
79
|
+
/** Schema rules for shaped objects (`customObjects`). */
|
|
26
80
|
customObjects?: CustomObject[];
|
|
81
|
+
/**
|
|
82
|
+
* When true (default), `redact()` and `redactSync()` leave the input untouched using copy-on-write
|
|
83
|
+
* structural sharing. When false, those methods mutate the input in place (equivalent to `redactInPlace`).
|
|
84
|
+
*/
|
|
85
|
+
cloneInput?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* When true, configuration warnings throw {@link FieldRedactorConfigurationError} at construction time.
|
|
88
|
+
* When false (default), warnings are exposed via {@link FieldRedactor.configWarnings} and `onConfigWarning`.
|
|
89
|
+
*/
|
|
90
|
+
strict?: boolean;
|
|
91
|
+
/** Called for each non-fatal configuration warning when `strict` is false. */
|
|
92
|
+
onConfigWarning?: (message: string) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Optional labels parallel to `customObjects` (same index). Used in {@link FieldRedactor.dryRun} reports.
|
|
95
|
+
* Set via {@link FieldRedactorConfigBuilder.schema}.
|
|
96
|
+
*/
|
|
97
|
+
schemaNames?: (string | undefined)[];
|
|
98
|
+
};
|
|
99
|
+
export type MatchedSchemaReport = {
|
|
100
|
+
path: string;
|
|
101
|
+
schemaIndex: number;
|
|
102
|
+
schemaName?: string;
|
|
103
|
+
};
|
|
104
|
+
export type RedactionRuleLabel = 'schema' | 'opaque' | 'deep' | 'remove' | 'shallow' | 'value' | 'default';
|
|
105
|
+
export type DryRunPathRule = {
|
|
106
|
+
path: string;
|
|
107
|
+
action: 'redact' | 'delete';
|
|
108
|
+
rule: RedactionRuleLabel;
|
|
109
|
+
pattern?: string;
|
|
110
|
+
schemaIndex?: number;
|
|
111
|
+
schemaName?: string;
|
|
112
|
+
};
|
|
113
|
+
export type DryRunReport = {
|
|
114
|
+
redactedPaths: string[];
|
|
115
|
+
deletedPaths: string[];
|
|
116
|
+
matchedSchemas: MatchedSchemaReport[];
|
|
117
|
+
/** Per-path rule attribution for redacted and deleted paths. */
|
|
118
|
+
pathRules: DryRunPathRule[];
|
|
119
|
+
};
|
|
120
|
+
export type DryRunResult<T> = {
|
|
121
|
+
result: T;
|
|
122
|
+
report: DryRunReport;
|
|
27
123
|
};
|
|
124
|
+
/** JSON object or array traversed during in-place redaction. */
|
|
125
|
+
export type TraversableJson = JsonObject | JsonArray;
|
|
126
|
+
/** Mutable key/value map used while traversing JSON object or array keys in place. */
|
|
127
|
+
export type JsonRecord = Record<string, JsonValue | undefined>;
|
|
128
|
+
export declare const isJsonObject: (value: JsonValue | undefined) => value is JsonObject;
|
|
28
129
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE7D,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,IAAI,GAAG,YAAY,CAAC;AAEhE,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;CAAE,CAAC;AAElE,6BAA6B;AAC7B,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAErD,6BAA6B;AAC7B,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D;;;GAGG;AACH,M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