field-redactor 1.1.0 → 1.2.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/README.md +130 -107
- package/dist/fieldRedactor.d.ts.map +1 -1
- package/dist/fieldRedactor.js +3 -2
- package/dist/fieldRedactor.js.map +1 -1
- package/dist/objectRedactor.d.ts.map +1 -1
- package/dist/objectRedactor.js +42 -15
- package/dist/objectRedactor.js.map +1 -1
- package/dist/secretManager.d.ts +7 -0
- package/dist/secretManager.d.ts.map +1 -1
- package/dist/secretManager.js +13 -1
- package/dist/secretManager.js.map +1 -1
- package/dist/types.d.ts +7 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -5
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,9 +36,10 @@ console.log(primitiveResult); // "foobar"
|
|
|
36
36
|
await fieldRedactor.redactInPlace(myJsonObject);
|
|
37
37
|
console.log(myJsonObject); // { foo: "REDACTED", fizz: null }
|
|
38
38
|
```
|
|
39
|
-
> **Note:** `null` and `undefined` values are not redacted by default.
|
|
40
|
-
> **Note:** `null`, `undefined`, `string`, `Date`, `Function`, and primitive value inputs are completely ignored.
|
|
41
39
|
|
|
40
|
+
> **Note:** `null`, `undefined`, `string`, `Date`, `Function`, and primitive value inputs are completely ignored.
|
|
41
|
+
>
|
|
42
|
+
> **Note:** `null` and `undefined` values are not redacted by default.
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
## Customization
|
|
@@ -51,6 +52,7 @@ The true power of this tool comes from its customization. FieldRedactor can be c
|
|
|
51
52
|
| `secretKeys` | `RegExp[]` | `null` | Specifies which values at any level of the JSON object should be redacted. Objects are not deeply redacted, but primitive values in arrays are. If not specified, all values are considered secret. |
|
|
52
53
|
| `deepSecretKeys` | `RegExp[]` | `[]` | Specifies keys at any level of the JSON object to be deeply redacted. All values within matching objects are fully redacted unless matching a custom object. |
|
|
53
54
|
| `fullSecretKeys` | `RegExp[]` | `[]` | Specifies keys at any level of the JSON object to be stringified and fully redacted. Primarily used for objects and arrays. |
|
|
55
|
+
| `deleteSecretKeys` | `RegExp[]` | `[]` | Specifies keys at any level of the JSON object to be completely deleted. |
|
|
54
56
|
| `customObjects` | `CustomObject[]` | `[]` | Specifies custom objects requiring fine-tuned redaction logic, such as referencing sibling keys. See the "Custom Objects" section for details. |
|
|
55
57
|
| `ignoreBooleans` | `boolean` | `false` | If `true`, booleans will not be redacted even if secret. |
|
|
56
58
|
| `ignoreNullOrUndefined` | `boolean` | `true` | If `true`, `null` and `undefined` values will not be redacted. |
|
|
@@ -83,16 +85,14 @@ console.log(result);
|
|
|
83
85
|
```
|
|
84
86
|
|
|
85
87
|
### `secretKeys` Configuration
|
|
86
|
-
|
|
88
|
+
* Specifies values which should be redacted.
|
|
89
|
+
* __All values are considered secret if no secrets of any type are specified.__
|
|
90
|
+
* has lowest precedence of all secret specifiers.
|
|
87
91
|
|
|
88
92
|
#### Details
|
|
89
93
|
- **Type:** `RegExp[]`
|
|
90
|
-
- **Default:** All values considered secret
|
|
91
|
-
|
|
92
|
-
- **Effect:** Matches keys in objects or child objects and redacts their values, if primitive. Arrays are processed recursively, with primitives redacted.
|
|
93
|
-
- If the value is an object it will be assessed using the same logic, regardless of if its key value is a secret.
|
|
94
|
-
- if an array value is an object it will be assessed using the same logic, regardless of if its key value is a secret.
|
|
95
|
-
- Has lowest precedence when compared to `deepSecretKeys`, `fullSecretKeys`, and `customObjects` configurations.
|
|
94
|
+
- **Default:** All values considered secret unless a secret field is specified.
|
|
95
|
+
- **Effect:** Matches keys in objects, child objects, or array value primitives. Assessed recursively.
|
|
96
96
|
|
|
97
97
|
#### Example
|
|
98
98
|
##### Code
|
|
@@ -106,14 +106,11 @@ const myJsonObject = {
|
|
|
106
106
|
firstName: "Foo",
|
|
107
107
|
lastName: "Bar",
|
|
108
108
|
Salutation: "Mr.",
|
|
109
|
-
preference: "email",
|
|
110
|
-
lastUpdated: "2024-12-01T22:07:26.448Z"
|
|
111
109
|
},
|
|
112
110
|
someSecretData: ["fizz", "buzz", { deep: "is not redacted", name: "foobar" }],
|
|
113
|
-
hobbies: ["Basketball", "Baseball", "Tennis"]
|
|
114
111
|
}
|
|
115
112
|
const fieldRedactor = new FieldRedactor({
|
|
116
|
-
secretKeys: [/email/i, /name/i, /
|
|
113
|
+
secretKeys: [/email/i, /name/i, /userid/i, /someSecretData/i],
|
|
117
114
|
});
|
|
118
115
|
const result = await fieldRedactor.redact(myJsonObject);
|
|
119
116
|
console.log(result);
|
|
@@ -123,33 +120,31 @@ console.log(result);
|
|
|
123
120
|
```json
|
|
124
121
|
{
|
|
125
122
|
"timestamp": "2024-12-01T22:07:26.448Z",
|
|
126
|
-
"userId":
|
|
123
|
+
"userId": "REDACTED",
|
|
127
124
|
"contactInfo": {
|
|
128
125
|
"email": "REDACTED",
|
|
129
126
|
"firstName": "REDACTED",
|
|
130
127
|
"lastName": "REDACTED",
|
|
131
128
|
"Salutation": "Mr.",
|
|
132
|
-
"preference": "email",
|
|
133
|
-
"lastUpdated": "2024-12-01T22:07:26.448Z"
|
|
134
129
|
},
|
|
135
|
-
"someSecretData": ["REDACTED", "REDACTED", { "deep": "is not redacted", "name": "REDACTED" }]
|
|
136
|
-
"hobbies": ["Basketball", "Baseball", "Tennis"]
|
|
130
|
+
"someSecretData": ["REDACTED", "REDACTED", { "deep": "is not redacted", "name": "REDACTED" }]
|
|
137
131
|
}
|
|
138
132
|
```
|
|
139
133
|
|
|
140
|
-
> -
|
|
141
|
-
> -
|
|
142
|
-
> -
|
|
143
|
-
> - object in `someSecretData` was evaluated separate from primitives in the same array
|
|
134
|
+
> - `email` and `name` fields were all redacted
|
|
135
|
+
> - primitives in `someSecretData` array were redacted
|
|
136
|
+
> - object values in `someSecretData` was evaluated and redacted if applicable
|
|
144
137
|
|
|
145
138
|
### `deepSecretKeys` Configuration
|
|
146
|
-
|
|
139
|
+
* Specifies values which should be deeply redacted
|
|
140
|
+
* Has higher precedence than `secretKeys`
|
|
141
|
+
* All children of the key will have their values redacted unless `fullSecretKey` or `customObject` has precedence.
|
|
147
142
|
|
|
148
143
|
#### Details
|
|
149
144
|
- **Type:** `RegExp[]`
|
|
150
145
|
- **Default:** `[]`
|
|
151
146
|
- **Effect:** Matches keys in objects or child objects and deeply redacts all values, including values in child objects or objects within arrays.
|
|
152
|
-
-
|
|
147
|
+
- _Note: has higher precedence than `secretKeys`._
|
|
153
148
|
|
|
154
149
|
#### Example
|
|
155
150
|
##### Code
|
|
@@ -163,16 +158,11 @@ const myJsonObject = {
|
|
|
163
158
|
firstName: "Foo",
|
|
164
159
|
lastName: "Bar",
|
|
165
160
|
Salutation: "Mr.",
|
|
166
|
-
preference: "email",
|
|
167
|
-
lastUpdated: "2024-12-01T22:07:26.448Z",
|
|
168
161
|
lastUpdatedBy: {
|
|
169
|
-
|
|
170
|
-
lastName: "Doe",
|
|
171
|
-
id: "12345"
|
|
162
|
+
id: 1
|
|
172
163
|
}
|
|
173
164
|
},
|
|
174
|
-
someSecretData: ["fizz", "buzz", { deep: "FOO", name: "BAR" }]
|
|
175
|
-
hobbies: ["Basketball", "Baseball", "Tennis", {contactInfo: "foobar"}]
|
|
165
|
+
someSecretData: ["fizz", "buzz", { deep: "FOO", name: "BAR" }]
|
|
176
166
|
}
|
|
177
167
|
const fieldRedactor = new FieldRedactor({
|
|
178
168
|
deepSecretKeys: [/someSecretData/i, /contactInfo/i]
|
|
@@ -191,28 +181,24 @@ console.log(result);
|
|
|
191
181
|
"firstName": "REDACTED",
|
|
192
182
|
"lastName": "REDACTED",
|
|
193
183
|
"Salutation": "REDACTED",
|
|
194
|
-
"preference": "REDACTED",
|
|
195
|
-
"lastUpdated": "REDACTED",
|
|
196
184
|
"lastUpdatedBy": {
|
|
197
|
-
"firstName": "REDACTED",
|
|
198
|
-
"lastName": "REDACTED",
|
|
199
185
|
"id": "REDACTED"
|
|
200
186
|
}
|
|
201
187
|
},
|
|
202
|
-
"someSecretData": ["REDACTED", "REDACTED", { "deep": "REDACTED", "name": "REDACTED" }]
|
|
203
|
-
"hobbies": ["Basketball", "Baseball", "Tennis", { "contactInfo": "REDACTED" }]
|
|
188
|
+
"someSecretData": ["REDACTED", "REDACTED", { "deep": "REDACTED", "name": "REDACTED" }]
|
|
204
189
|
}
|
|
205
190
|
```
|
|
206
|
-
> - All values in `contactInfo` were redacted
|
|
207
|
-
> - All values in `someSecretData` were redacted
|
|
191
|
+
> - All values in `contactInfo` were redacted
|
|
192
|
+
> - All values in `someSecretData` were redacted
|
|
208
193
|
|
|
209
194
|
### `fullSecretKeys` Configuration
|
|
210
|
-
Specifies values which should be stringified and
|
|
195
|
+
* Specifies values which should be stringified and redacted
|
|
196
|
+
* _Note: has higher precedence than `secretKeys` and `deepSecretKeys`_
|
|
211
197
|
|
|
212
198
|
#### Details
|
|
213
199
|
- **Type:** `RegExp[]`
|
|
214
200
|
- **Default:** `[]`
|
|
215
|
-
- **Effect:** Matches keys
|
|
201
|
+
- **Effect:** Matches keys and stringifies + redacts their values.
|
|
216
202
|
- Has higher precedence than `secretKeys` and `deepSecretKeys` but lower precedence than `customObjects`.
|
|
217
203
|
|
|
218
204
|
#### Example
|
|
@@ -230,12 +216,10 @@ const myJsonObject = {
|
|
|
230
216
|
Salutation: "Mr.",
|
|
231
217
|
preference: "email",
|
|
232
218
|
lastUpdated: "2024-12-01T22:07:26.448Z"
|
|
233
|
-
}
|
|
234
|
-
someSecretData: ["fizz", "buzz", { deep: "foo", name: "bar" }],
|
|
235
|
-
hobbies: ["Basketball", "Baseball", "Tennis"]
|
|
219
|
+
}
|
|
236
220
|
}
|
|
237
221
|
const fieldRedactor = new FieldRedactor({
|
|
238
|
-
fullSecretKeys: [/someSecretData/i
|
|
222
|
+
fullSecretKeys: [/someSecretData/i],
|
|
239
223
|
});
|
|
240
224
|
const result = await fieldRedactor.redact(myJsonObject);
|
|
241
225
|
console.log(result);
|
|
@@ -246,26 +230,58 @@ console.log(result);
|
|
|
246
230
|
{
|
|
247
231
|
"timestamp": "2024-12-01T22:07:26.448Z",
|
|
248
232
|
"userId": 271,
|
|
249
|
-
"contactInfo": "REDACTED"
|
|
250
|
-
"someSecretData": "REDACTED",
|
|
251
|
-
"hobbies": ["Basketball", "Baseball", "Tennis"]
|
|
233
|
+
"contactInfo": "REDACTED"
|
|
252
234
|
}
|
|
253
235
|
```
|
|
254
236
|
> - Entirity of `contactInfo` was redacted.
|
|
255
|
-
|
|
237
|
+
|
|
238
|
+
### `deleteSecretKeys` Configuration
|
|
239
|
+
* Specifies values which should be completely deleted.
|
|
240
|
+
|
|
241
|
+
#### Details
|
|
242
|
+
- **Type:** `RegExp[]`
|
|
243
|
+
- **Default:** `[]`
|
|
244
|
+
- **Effect:** Matches keys and deletes them from output.
|
|
245
|
+
- Has lower precedence than `customObjects`
|
|
246
|
+
|
|
247
|
+
#### Example
|
|
248
|
+
##### Code
|
|
249
|
+
```typescript
|
|
250
|
+
import { FieldRedactor } from 'field-redactor';
|
|
251
|
+
|
|
252
|
+
const myJsonObject = {
|
|
253
|
+
timestamp: "2024-12-01T22:07:26.448Z",
|
|
254
|
+
userId: 271,
|
|
255
|
+
appAuthKey: "12345-67890"
|
|
256
|
+
}
|
|
257
|
+
const fieldRedactor = new FieldRedactor({
|
|
258
|
+
deleteSecretKeys: [/authKey/i],
|
|
259
|
+
});
|
|
260
|
+
const result = await fieldRedactor.redact(myJsonObject);
|
|
261
|
+
console.log(result);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
##### Output
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"timestamp": "2024-12-01T22:07:26.448Z",
|
|
268
|
+
"userId": 271
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
> - `appAuthKey` was deleted
|
|
256
272
|
|
|
257
273
|
### `customObjects` Configuration
|
|
258
|
-
**One of the most powerful features of this library and why it was written in the first place.**
|
|
274
|
+
* **One of the most powerful features of this library and why it was written in the first place.**
|
|
275
|
+
* Combining CustomObjects with secrets yields a powerful and highly customizable redaction tool capable of conditionally redacting a broad variety of input JSON objects correctly according to a user-specified schema.
|
|
259
276
|
|
|
260
277
|
#### Details
|
|
261
278
|
- **Type:** `CustomObject` (See `CustomObject` Schema Section)
|
|
262
279
|
- **Default:** `[]`
|
|
263
|
-
- **Effect:** Any object that matches the schema will be
|
|
264
|
-
-
|
|
265
|
-
- If a
|
|
280
|
+
- **Effect:** Any object that matches the schema will be redacted based on its schema.
|
|
281
|
+
- _Note: has highest precedence_
|
|
282
|
+
- -_Note: If a custom object is nested inside another, the child takes precedence_
|
|
266
283
|
|
|
267
284
|
#### `CustomObject` Schema
|
|
268
|
-
A custom object takes the following format:
|
|
269
285
|
```typescript
|
|
270
286
|
{
|
|
271
287
|
[key]: CustomObjectMatchType | string
|
|
@@ -274,91 +290,98 @@ A custom object takes the following format:
|
|
|
274
290
|
|
|
275
291
|
- `key`
|
|
276
292
|
- **Type:** `string`
|
|
277
|
-
- **Effect:** Specifies the key
|
|
293
|
+
- **Effect:** Specifies the key to match on.
|
|
278
294
|
- `value`:
|
|
279
295
|
- **Type:** `CustomObjectMatchType | string`
|
|
280
296
|
- **Effect:** Specifies how the value should be redacted
|
|
281
|
-
- `string` - checks if
|
|
282
|
-
- `CustomObjectMatchType` - Redacts according to the match type.
|
|
297
|
+
- `string` - checks if a sibling key with this name exists and contains a secret value. If so, redacts according to the secret specifier.
|
|
298
|
+
- `CustomObjectMatchType` - Redacts according to the match type.
|
|
283
299
|
|
|
284
300
|
|
|
285
301
|
#### `CustomObjectMatchType` Enum
|
|
302
|
+
Specifies how a value should be redacted in a CustomObject if not using a `string` sibling specifier.
|
|
303
|
+
|
|
286
304
|
| Key | Description |
|
|
287
305
|
| --- | ----------- |
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
306
|
+
| `Delete` | Delete the value from the result. |
|
|
307
|
+
| `Full` | Stringify value and redact. |
|
|
308
|
+
| `Deep` | Redact if primitive and deeply redact if object or array. |
|
|
309
|
+
| `Shallow` | Redact if primitive or array of primitives and revert to normal rules otherwise, including objects in arrays. |
|
|
310
|
+
| `Pass` | Do not redact, but revert to normal rules for child objects or objects in arrays. |
|
|
311
|
+
| `Ignore` | Skip evaluation entirely. |
|
|
293
312
|
|
|
294
313
|
#### Example
|
|
295
314
|
```typescript
|
|
296
|
-
import { FieldRedactor } from 'field-redactor';
|
|
315
|
+
import { FieldRedactor, CustomObjectMatchType } from 'field-redactor';
|
|
297
316
|
|
|
298
|
-
const
|
|
299
|
-
name: CustomObjectMatchType.Ignore,
|
|
300
|
-
type: CustomObjectMatchType.Ignore,
|
|
301
|
-
significance: CustomObjectMatchType.Ignore,
|
|
302
|
-
shallowValue: "name",
|
|
303
|
-
deepValue: "type",
|
|
304
|
-
fullValue: "significance"
|
|
317
|
+
const myCustomObject1 = {
|
|
305
318
|
shallow: CustomObjectMatchType.Shallow,
|
|
306
319
|
deep: CustomObjectMatchType.Deep,
|
|
307
320
|
full: CustomObjectMatchType.Full,
|
|
321
|
+
delete: CustomObjectMatchType.Delete
|
|
308
322
|
pass: CustomObjectMatchType.Pass,
|
|
309
323
|
ignore: CustomObjectMatchType.Ignore
|
|
310
324
|
};
|
|
311
325
|
|
|
326
|
+
const myCustomObject2 = {
|
|
327
|
+
name: CustomObjectMatchType.Ignore,
|
|
328
|
+
type: CustomObjectMatchType.Ignore,
|
|
329
|
+
shallowValue: "name",
|
|
330
|
+
deepValue: "type",
|
|
331
|
+
}
|
|
332
|
+
|
|
312
333
|
const myJsonObject = {
|
|
313
334
|
timestamp: "2024-12-01T22:07:26.448Z",
|
|
314
335
|
userId: 271,
|
|
315
336
|
data: [
|
|
316
337
|
{
|
|
317
|
-
name: "email",
|
|
318
|
-
type: "Secure",
|
|
319
|
-
significance: "meta"
|
|
320
|
-
shallowValue: "foo.bar@example.com",
|
|
321
|
-
deepValue: "foobar",
|
|
322
|
-
fullValue: "hello",
|
|
323
338
|
shallow: "hello",
|
|
324
339
|
deep: "hello",
|
|
325
340
|
full: "hello",
|
|
341
|
+
delete: "hello",
|
|
326
342
|
pass: "hello",
|
|
327
343
|
ignore: "hello"
|
|
328
344
|
},
|
|
329
345
|
{
|
|
330
346
|
name: "email",
|
|
331
347
|
type: "Secure",
|
|
332
|
-
|
|
333
|
-
|
|
348
|
+
shallowValue: "foo.bar@example.com",
|
|
349
|
+
deepValue: "foobar",
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
shallow: {
|
|
334
353
|
hello: "world",
|
|
335
354
|
email: "foobar"
|
|
336
355
|
},
|
|
337
|
-
|
|
356
|
+
deep: {
|
|
338
357
|
hello: "world",
|
|
339
358
|
email: "foobar"
|
|
340
359
|
},
|
|
341
|
-
|
|
360
|
+
full: {
|
|
342
361
|
hello: "world",
|
|
343
362
|
email: "foobar"
|
|
344
363
|
},
|
|
345
|
-
|
|
364
|
+
delete: {
|
|
346
365
|
hello: "world",
|
|
347
366
|
email: "foobar"
|
|
348
367
|
},
|
|
349
|
-
|
|
368
|
+
pass: {
|
|
350
369
|
hello: "world",
|
|
351
370
|
email: "foobar"
|
|
352
371
|
},
|
|
353
|
-
|
|
372
|
+
ignore: {
|
|
354
373
|
hello: "world",
|
|
355
374
|
email: "foobar"
|
|
356
|
-
}
|
|
357
|
-
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
{
|
|
378
|
+
name: "email",
|
|
379
|
+
type: "Secure",
|
|
380
|
+
shallowValue: {
|
|
358
381
|
hello: "world",
|
|
359
382
|
email: "foobar"
|
|
360
383
|
},
|
|
361
|
-
|
|
384
|
+
deepValue: {
|
|
362
385
|
hello: "world",
|
|
363
386
|
email: "foobar"
|
|
364
387
|
}
|
|
@@ -369,7 +392,7 @@ const fieldRedactor = new FieldRedactor({
|
|
|
369
392
|
secretKeys: [/email/],
|
|
370
393
|
deepSecretKeys: [/secure/i],
|
|
371
394
|
fullSecretKeys: [/meta/i],
|
|
372
|
-
customObjects: [
|
|
395
|
+
customObjects: [myCustomObject1, myCustomObject2]
|
|
373
396
|
});
|
|
374
397
|
const result = await fieldRedactor.redact(myJsonObject);
|
|
375
398
|
console.log(result);
|
|
@@ -382,11 +405,6 @@ console.log(result);
|
|
|
382
405
|
"userId": 271,
|
|
383
406
|
"data": [
|
|
384
407
|
{
|
|
385
|
-
"name": "email",
|
|
386
|
-
"type": "Secure",
|
|
387
|
-
"shallowValue": "REDACTED",
|
|
388
|
-
"deepValue": "REDACTED",
|
|
389
|
-
"fullValue": "REDACTED",
|
|
390
408
|
"shallow": "REDACTED",
|
|
391
409
|
"deep": "REDACTED",
|
|
392
410
|
"full": "REDACTED",
|
|
@@ -396,15 +414,10 @@ console.log(result);
|
|
|
396
414
|
{
|
|
397
415
|
"name": "email",
|
|
398
416
|
"type": "Secure",
|
|
399
|
-
"shallowValue":
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
"deepValue": {
|
|
404
|
-
"hello": "REDACTED",
|
|
405
|
-
"email": "REDACTED"
|
|
406
|
-
},
|
|
407
|
-
"fullValue": "REDACTED",
|
|
417
|
+
"shallowValue": "REDACTED",
|
|
418
|
+
"deepValue": "REDACTED"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
408
421
|
"shallow": {
|
|
409
422
|
"hello": "world",
|
|
410
423
|
"email": "REDACTED"
|
|
@@ -423,14 +436,22 @@ console.log(result);
|
|
|
423
436
|
"email": "foobar"
|
|
424
437
|
}
|
|
425
438
|
}
|
|
439
|
+
{
|
|
440
|
+
"name": "email",
|
|
441
|
+
"type": "Secure",
|
|
442
|
+
"shallowValue": {
|
|
443
|
+
"hello": "world",
|
|
444
|
+
"email": "REDACTED"
|
|
445
|
+
},
|
|
446
|
+
"deepValue": {
|
|
447
|
+
"hello": "REDACTED",
|
|
448
|
+
"email": "REDACTED"
|
|
449
|
+
}
|
|
450
|
+
}
|
|
426
451
|
]
|
|
427
|
-
}
|
|
452
|
+
}
|
|
428
453
|
```
|
|
429
|
-
>
|
|
430
|
-
> - The first object contains only primitives whereas the second contains objects to highlight the differences
|
|
431
|
-
> - `name` and `type` field were never redacted in either object because `CustomObjectMatchType` was `Ignore`
|
|
432
|
-
> - `shallowValue`, `deepValue`, and `fullValue` had string key specifiers which matched a `shallowKey`, `deepSecretKey`, and `fullSecretKey`, respectively, and were redacted according to those rules.
|
|
433
|
-
> - `shallow`, `deep`, `full`, `pass`, and `ignore` fields were redacted according to their `CustomObjectMatchType` value specified in the schema.
|
|
454
|
+
> - Example shows both primitives and objects to highlight differences
|
|
434
455
|
|
|
435
456
|
### `ignoreBooleans` Configuration
|
|
436
457
|
- **Type:** `boolean`
|
|
@@ -520,6 +541,7 @@ const fieldRedactor: FieldRedactor = new FieldRedactor({
|
|
|
520
541
|
redactor: myRedactor,
|
|
521
542
|
secretKeys: [/email/, /name/i, /someSecretData/, /children/],
|
|
522
543
|
deepSecretKeys: [/accountInfo/i, /someDeepSecretData/i, /privateInfo/i],
|
|
544
|
+
deleteSecretKeys: [/authKey/i],
|
|
523
545
|
customObjects: [metadataCustomObject, actionsCustomObject],
|
|
524
546
|
ignoreNullOrUndefined: false
|
|
525
547
|
});
|
|
@@ -527,6 +549,7 @@ const fieldRedactor: FieldRedactor = new FieldRedactor({
|
|
|
527
549
|
const myJsonObjectToRedact = {
|
|
528
550
|
timestamp: "2024-12-01T22:07:26.448Z",
|
|
529
551
|
userId: 271,
|
|
552
|
+
authKey: 12345,
|
|
530
553
|
contactInfo: {
|
|
531
554
|
email: "foo.bar@example.com",
|
|
532
555
|
salutation: "Mr.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldRedactor.d.ts","sourceRoot":"","sources":["../src/fieldRedactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAO9C;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAwC;IACxD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;gBACpC,MAAM,CAAC,EAAE,mBAAmB;
|
|
1
|
+
{"version":3,"file":"fieldRedactor.d.ts","sourceRoot":"","sources":["../src/fieldRedactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAO9C;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAwC;IACxD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;gBACpC,MAAM,CAAC,EAAE,mBAAmB;IAyBxC;;;;;;OAMG;IACU,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAK7C;;;;;OAKG;IACU,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAYrD,OAAO,CAAC,sBAAsB;CAG/B"}
|
package/dist/fieldRedactor.js
CHANGED
|
@@ -27,7 +27,7 @@ const errors_1 = require("./errors");
|
|
|
27
27
|
class FieldRedactor {
|
|
28
28
|
constructor(config) {
|
|
29
29
|
this.deepCopy = (0, rfdc_1.default)({ proto: true, circles: true });
|
|
30
|
-
const { redactor, secretKeys, deepSecretKeys, fullSecretKeys, customObjects } = config || {};
|
|
30
|
+
const { redactor, secretKeys, deepSecretKeys, fullSecretKeys, deleteSecretKeys, customObjects } = config || {};
|
|
31
31
|
const ignoreNullOrUndefined = typeof (config === null || config === void 0 ? void 0 : config.ignoreNullOrUndefined) === 'boolean' ? config.ignoreNullOrUndefined : true;
|
|
32
32
|
const ignoreBooleans = typeof (config === null || config === void 0 ? void 0 : config.ignoreBooleans) === 'boolean' ? config.ignoreBooleans : true;
|
|
33
33
|
const primitiveRedactor = new primitiveRedactor_1.PrimitiveRedactor({
|
|
@@ -38,7 +38,8 @@ class FieldRedactor {
|
|
|
38
38
|
const secretManager = new secretManager_1.SecretManager({
|
|
39
39
|
secretKeys,
|
|
40
40
|
deepSecretKeys,
|
|
41
|
-
fullSecretKeys
|
|
41
|
+
fullSecretKeys,
|
|
42
|
+
deleteSecretKeys
|
|
42
43
|
});
|
|
43
44
|
const customObjectChecker = new customObjectManager_1.CustomObjectManager(customObjects);
|
|
44
45
|
this.objectRedactor = new objectRedactor_1.ObjectRedactor(primitiveRedactor, secretManager, customObjectChecker);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldRedactor.js","sourceRoot":"","sources":["../src/fieldRedactor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,qDAAkD;AAClD,2DAAwD;AACxD,mDAAgD;AAChD,+DAA4D;AAC5D,qCAA8C;AAE9C;;;;GAIG;AACH,MAAa,aAAa;IAGxB,YAAY,MAA4B;QAFhC,aAAQ,GAAG,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAGtD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"fieldRedactor.js","sourceRoot":"","sources":["../src/fieldRedactor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,qDAAkD;AAClD,2DAAwD;AACxD,mDAAgD;AAChD,+DAA4D;AAC5D,qCAA8C;AAE9C;;;;GAIG;AACH,MAAa,aAAa;IAGxB,YAAY,MAA4B;QAFhC,aAAQ,GAAG,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAGtD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAE/G,MAAM,qBAAqB,GACzB,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,CAAA,KAAK,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,KAAK,QAAQ,IAAI,KAAK,YAAY,IAAI,CAAC;IACtE,CAAC;CACF;AA7DD,sCA6DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectRedactor.d.ts","sourceRoot":"","sources":["../src/objectRedactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFhB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,mBAAmB;IAGxD;;;;;OAKG;IACU,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAWtC,+BAA+B;
|
|
1
|
+
{"version":3,"file":"objectRedactor.d.ts","sourceRoot":"","sources":["../src/objectRedactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFhB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,mBAAmB;IAGxD;;;;;OAKG;IACU,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YAWtC,+BAA+B;YAoB/B,mBAAmB;YASnB,oBAAoB;YAkBpB,oBAAoB;YAqBpB,oBAAoB;YAUpB,yBAAyB;YAYzB,8BAA8B;IAa5C,OAAO,CAAC,oDAAoD;YAS9C,gDAAgD;YAahD,gDAAgD;YAyBhD,+BAA+B;YAa/B,iDAAiD;YAejD,gDAAgD;YAsBhD,kCAAkC;YAalC,oDAAoD;YAsBpD,oDAAoD;IAQlE,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,QAAQ;YAIF,4BAA4B;CAS3C"}
|
package/dist/objectRedactor.js
CHANGED
|
@@ -49,6 +49,9 @@ class ObjectRedactor {
|
|
|
49
49
|
if (customObject) {
|
|
50
50
|
yield this.handleCustomObjectInPlace(value, customObject);
|
|
51
51
|
}
|
|
52
|
+
else if (this.secretManager.isDeleteSecretKey(key)) {
|
|
53
|
+
delete object[key];
|
|
54
|
+
}
|
|
52
55
|
else if (this.secretManager.isFullSecretKey(key)) {
|
|
53
56
|
object[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value));
|
|
54
57
|
}
|
|
@@ -161,18 +164,26 @@ class ObjectRedactor {
|
|
|
161
164
|
}
|
|
162
165
|
handleCustomObjectArrayValueIfStringKeySpecified(value, key, stringKey) {
|
|
163
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
if (this.secretManager.
|
|
167
|
+
if (this.secretManager.isDeleteSecretKey(stringKey)) {
|
|
168
|
+
delete value[key];
|
|
169
|
+
}
|
|
170
|
+
else if (this.secretManager.isFullSecretKey(stringKey)) {
|
|
165
171
|
value[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value[key]));
|
|
166
172
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
else {
|
|
174
|
+
const isDeepSecretKey = this.secretManager.isDeepSecretKey(stringKey);
|
|
175
|
+
if (isDeepSecretKey || this.secretManager.isSecretKey(stringKey)) {
|
|
176
|
+
value[key] = yield this.redactAllArrayValues(value[key], isDeepSecretKey);
|
|
177
|
+
}
|
|
170
178
|
}
|
|
171
179
|
});
|
|
172
180
|
}
|
|
173
181
|
handleCustomObjectArrayValueIfMatchTypeSpecified(value, key, matchType) {
|
|
174
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
183
|
switch (matchType) {
|
|
184
|
+
case types_1.CustomObjectMatchType.Delete:
|
|
185
|
+
delete value[key];
|
|
186
|
+
return Promise.resolve();
|
|
176
187
|
case types_1.CustomObjectMatchType.Full:
|
|
177
188
|
value[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value[key]));
|
|
178
189
|
return Promise.resolve();
|
|
@@ -206,6 +217,9 @@ class ObjectRedactor {
|
|
|
206
217
|
if (customObject) {
|
|
207
218
|
yield this.handleCustomObjectInPlace(value[key], customObject);
|
|
208
219
|
}
|
|
220
|
+
else if (this.secretManager.isDeleteSecretKey(stringKey)) {
|
|
221
|
+
delete value[key];
|
|
222
|
+
}
|
|
209
223
|
else if (this.secretManager.isFullSecretKey(stringKey)) {
|
|
210
224
|
value[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value[key]));
|
|
211
225
|
}
|
|
@@ -220,6 +234,9 @@ class ObjectRedactor {
|
|
|
220
234
|
handleCustomObjectOjectValueIfMatchTypeSpecified(value, key, matchType) {
|
|
221
235
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
236
|
switch (matchType) {
|
|
237
|
+
case types_1.CustomObjectMatchType.Delete:
|
|
238
|
+
delete value[key];
|
|
239
|
+
return Promise.resolve();
|
|
223
240
|
case types_1.CustomObjectMatchType.Full:
|
|
224
241
|
value[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value[key]));
|
|
225
242
|
return Promise.resolve();
|
|
@@ -236,34 +253,44 @@ class ObjectRedactor {
|
|
|
236
253
|
handleCustomObjectValueIfPrimitive(value, customObject, key) {
|
|
237
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
238
255
|
if (typeof customObject[key] === 'number') {
|
|
239
|
-
|
|
256
|
+
return this.handleCustomObjectPrimitiveValueIfMatchTypeSpecified(value, key, customObject[key]);
|
|
240
257
|
}
|
|
241
258
|
else {
|
|
242
|
-
|
|
259
|
+
const secretKey = this.getStringSpecifiedCustomObjectSecretKeyValueIfExists(value, customObject, key);
|
|
260
|
+
if (!secretKey) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
yield this.handleCustomObjectPrimitiveValueIfStringKeySpecified(value, secretKey, key);
|
|
243
264
|
}
|
|
244
265
|
});
|
|
245
266
|
}
|
|
246
|
-
handleCustomObjectPrimitiveValueIfMatchTypeSpecified(value, matchValue) {
|
|
267
|
+
handleCustomObjectPrimitiveValueIfMatchTypeSpecified(value, key, matchValue) {
|
|
247
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
248
269
|
switch (matchValue) {
|
|
270
|
+
case types_1.CustomObjectMatchType.Delete:
|
|
271
|
+
delete value[key];
|
|
272
|
+
return;
|
|
249
273
|
case types_1.CustomObjectMatchType.Full:
|
|
250
|
-
|
|
274
|
+
value[key] = yield this.primitiveRedactor.redactValue(this.getStringValue(value[key]));
|
|
275
|
+
return;
|
|
251
276
|
case types_1.CustomObjectMatchType.Deep:
|
|
252
277
|
case types_1.CustomObjectMatchType.Shallow:
|
|
253
|
-
|
|
278
|
+
value[key] = yield this.primitiveRedactor.redactValue(value[key]);
|
|
279
|
+
return;
|
|
254
280
|
case types_1.CustomObjectMatchType.Pass:
|
|
255
281
|
default:
|
|
256
|
-
return Promise.resolve(
|
|
282
|
+
return Promise.resolve();
|
|
257
283
|
}
|
|
258
284
|
});
|
|
259
285
|
}
|
|
260
|
-
handleCustomObjectPrimitiveValueIfStringKeySpecified(value,
|
|
286
|
+
handleCustomObjectPrimitiveValueIfStringKeySpecified(value, secretKey, key) {
|
|
261
287
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
288
|
+
if (this.secretManager.isDeleteSecretKey(secretKey)) {
|
|
289
|
+
delete value[key];
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
value[key] = yield this.redactPrimitiveValueIfSecret(secretKey, value[key], false);
|
|
265
293
|
}
|
|
266
|
-
return this.redactPrimitiveValueIfSecret(secretKey, value[key], false);
|
|
267
294
|
});
|
|
268
295
|
}
|
|
269
296
|
getStringValue(val) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectRedactor.js","sourceRoot":"","sources":["../src/objectRedactor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA8D;AAK9D;;;;;GAKG;AACH,MAAa,cAAc;IACzB,YACmB,iBAAoC,EACpC,aAA4B,EAC5B,gBAAqC;QAFrC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,kBAAa,GAAb,aAAa,CAAe;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAqB;IACrD,CAAC;IAEJ;;;;;OAKG;IACU,aAAa,CAAC,KAAU;;YACnC,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;YAC1E,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAC5D,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,CAAC,+BAA+B,CAAC,KAAK,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;IAEa,+BAA+B;6DAAC,MAAW,EAAE,qBAA8B,KAAK;YAC5F,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBACtC,MAAM,KAAK,GAAQ,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;gBAC1E,IAAI,YAAY,EAAE,CAAC;oBACjB,M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,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAEO,QAAQ,CAAC,KAAU;QACzB,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnG,CAAC;IAEa,4BAA4B,CAAC,GAAW,EAAE,KAAU,EAAE,kBAA2B;;YAC7F,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5C,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,CAAC;iBAAM,IAAI,kBAAkB,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChH,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;KAAA;CACF;AAlSD,wCAkSC"}
|
package/dist/secretManager.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class SecretManager {
|
|
|
7
7
|
private secretKeys?;
|
|
8
8
|
private deepSecretKeys?;
|
|
9
9
|
private fullSecretKeys?;
|
|
10
|
+
private deleteSecretKeys?;
|
|
10
11
|
constructor(config: SecretManagerConfig);
|
|
11
12
|
/**
|
|
12
13
|
* Determines if the given key is a secret. If no secrets of any type are provided then this function
|
|
@@ -27,6 +28,12 @@ export declare class SecretManager {
|
|
|
27
28
|
* @returns True if the key is a full secret key, otherwise false.
|
|
28
29
|
*/
|
|
29
30
|
isFullSecretKey(key: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Determines if a key is a delete secret based on the deleteSecretKeys configuration provided in the constructor.
|
|
33
|
+
* @param key The key to check.
|
|
34
|
+
* @returns True if the key is a delete secret key, otherwise false.
|
|
35
|
+
*/
|
|
36
|
+
isDeleteSecretKey(key: string): boolean;
|
|
30
37
|
private static valueMatchesAnyRegexValue;
|
|
31
38
|
}
|
|
32
39
|
//# sourceMappingURL=secretManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretManager.d.ts","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAC,CAAW;IAC9B,OAAO,CAAC,cAAc,CAAC,CAAW;IAClC,OAAO,CAAC,cAAc,CAAC,CAAW;
|
|
1
|
+
{"version":3,"file":"secretManager.d.ts","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;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,MAAM,GAAG,OAAO;IAQxC;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAQ5C;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAQ5C;;;;OAIG;IACI,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAQ9C,OAAO,CAAC,MAAM,CAAC,yBAAyB;CAGzC"}
|
package/dist/secretManager.js
CHANGED
|
@@ -9,7 +9,8 @@ class SecretManager {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
this.deepSecretKeys = config.deepSecretKeys;
|
|
11
11
|
this.fullSecretKeys = config.fullSecretKeys;
|
|
12
|
-
|
|
12
|
+
this.deleteSecretKeys = config.deleteSecretKeys;
|
|
13
|
+
if (!config.secretKeys && (config.deepSecretKeys || config.fullSecretKeys || config.deleteSecretKeys)) {
|
|
13
14
|
this.secretKeys = [];
|
|
14
15
|
}
|
|
15
16
|
else {
|
|
@@ -50,6 +51,17 @@ class SecretManager {
|
|
|
50
51
|
}
|
|
51
52
|
return SecretManager.valueMatchesAnyRegexValue(key, this.fullSecretKeys);
|
|
52
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Determines if a key is a delete secret based on the deleteSecretKeys configuration provided in the constructor.
|
|
56
|
+
* @param key The key to check.
|
|
57
|
+
* @returns True if the key is a delete secret key, otherwise false.
|
|
58
|
+
*/
|
|
59
|
+
isDeleteSecretKey(key) {
|
|
60
|
+
if (!this.deleteSecretKeys) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return SecretManager.valueMatchesAnyRegexValue(key, this.deleteSecretKeys);
|
|
64
|
+
}
|
|
53
65
|
static valueMatchesAnyRegexValue(value, regexes) {
|
|
54
66
|
return regexes.some((regex) => regex.test(value));
|
|
55
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretManager.js","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"secretManager.js","sourceRoot":"","sources":["../src/secretManager.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,aAAa;IAMxB,YAAY,MAA2B;QAC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C,yBAAyB,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC7E,CAAC;IAEO,MAAM,CAAC,yBAAyB,CAAC,KAAa,EAAE,OAAiB;QACvE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACpD,CAAC;CACF;AA1ED,sCA0EC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export type Redactor = (value: any) => Promise<string>;
|
|
2
2
|
export declare enum CustomObjectMatchType {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Delete = 0,
|
|
4
|
+
Full = 1,
|
|
5
|
+
Deep = 2,
|
|
6
|
+
Shallow = 3,
|
|
7
|
+
Pass = 4,
|
|
8
|
+
Ignore = 5
|
|
8
9
|
}
|
|
9
10
|
export type CustomObject = {
|
|
10
11
|
[key: string]: CustomObjectMatchType | string;
|
|
@@ -18,6 +19,7 @@ export type SecretManagerConfig = {
|
|
|
18
19
|
secretKeys?: RegExp[];
|
|
19
20
|
deepSecretKeys?: RegExp[];
|
|
20
21
|
fullSecretKeys?: RegExp[];
|
|
22
|
+
deleteSecretKeys?: RegExp[];
|
|
21
23
|
};
|
|
22
24
|
export type FieldRedactorConfig = Partial<PrimitiveRedactorConfig> & SecretManagerConfig & {
|
|
23
25
|
redactor?: Redactor;
|
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,QAAQ,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEvD,oBAAY,qBAAqB;IAC/B,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,IAAI,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B,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAChE,mBAAmB,GAAG;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CustomObjectMatchType = void 0;
|
|
4
4
|
var CustomObjectMatchType;
|
|
5
5
|
(function (CustomObjectMatchType) {
|
|
6
|
-
CustomObjectMatchType[CustomObjectMatchType["
|
|
7
|
-
CustomObjectMatchType[CustomObjectMatchType["
|
|
8
|
-
CustomObjectMatchType[CustomObjectMatchType["
|
|
9
|
-
CustomObjectMatchType[CustomObjectMatchType["
|
|
10
|
-
CustomObjectMatchType[CustomObjectMatchType["
|
|
6
|
+
CustomObjectMatchType[CustomObjectMatchType["Delete"] = 0] = "Delete";
|
|
7
|
+
CustomObjectMatchType[CustomObjectMatchType["Full"] = 1] = "Full";
|
|
8
|
+
CustomObjectMatchType[CustomObjectMatchType["Deep"] = 2] = "Deep";
|
|
9
|
+
CustomObjectMatchType[CustomObjectMatchType["Shallow"] = 3] = "Shallow";
|
|
10
|
+
CustomObjectMatchType[CustomObjectMatchType["Pass"] = 4] = "Pass";
|
|
11
|
+
CustomObjectMatchType[CustomObjectMatchType["Ignore"] = 5] = "Ignore";
|
|
11
12
|
})(CustomObjectMatchType || (exports.CustomObjectMatchType = CustomObjectMatchType = {}));
|
|
12
13
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,qEAAM,CAAA;IACN,iEAAI,CAAA;IACJ,iEAAI,CAAA;IACJ,uEAAO,CAAA;IACP,iEAAI,CAAA;IACJ,qEAAM,CAAA;AACR,CAAC,EAPW,qBAAqB,qCAArB,qBAAqB,QAOhC"}
|