@@ -3,32 +3,32 @@ import { isNotMaskable, maskSensitiveValues } from '../logger.mask';
3
3
describe ( 'logger-mask' , ( ) => {
4
4
describe ( '#maskSensitiveValues' , ( ) => {
5
5
const data : Record < string , any > = {
6
- key : 'key1 ' ,
6
+ accessToken : 'accessToken1 ' ,
7
7
password : 'password1' ,
8
8
apiKey : 'apiKey1' ,
9
9
credential : 'credential1' ,
10
10
nested : {
11
- key : 'key2 ' ,
11
+ accessToken : 'accessToken2 ' ,
12
12
password : 'password2' ,
13
13
apiKey : 'apiKey2' ,
14
14
credential : 'credential2' ,
15
15
} ,
16
16
} ;
17
17
18
- it ( 'should mask password and key properties by default' , ( ) => {
18
+ it ( 'should mask password, accessToken, and apiKey properties by default' , ( ) => {
19
19
const result = maskSensitiveValues ( {
20
20
json : data ,
21
21
} ) ;
22
22
23
23
expect ( result ) . toEqual ( {
24
- key : '***REDACTED***' ,
24
+ accessToken : '***REDACTED***' ,
25
25
password : '***REDACTED***' ,
26
- apiKey : 'apiKey1 ' ,
26
+ apiKey : '***REDACTED*** ' ,
27
27
credential : 'credential1' ,
28
28
nested : {
29
- key : '***REDACTED***' ,
29
+ accessToken : '***REDACTED***' ,
30
30
password : '***REDACTED***' ,
31
- apiKey : 'apiKey2 ' ,
31
+ apiKey : '***REDACTED*** ' ,
32
32
credential : 'credential2' ,
33
33
} ,
34
34
} ) ;
@@ -41,12 +41,12 @@ describe('logger-mask', () => {
41
41
} ) ;
42
42
43
43
expect ( result ) . toEqual ( {
44
- key : 'key1 ' ,
44
+ accessToken : 'accessToken1 ' ,
45
45
password : 'password1' ,
46
46
apiKey : '***REDACTED***' ,
47
47
credential : '***REDACTED***' ,
48
48
nested : {
49
- key : 'key2 ' ,
49
+ accessToken : 'accessToken2 ' ,
50
50
password : 'password2' ,
51
51
apiKey : '***REDACTED***' ,
52
52
credential : '***REDACTED***' ,
@@ -62,12 +62,12 @@ describe('logger-mask', () => {
62
62
} ) ;
63
63
64
64
expect ( result ) . toEqual ( {
65
- key : 'key1 ' ,
65
+ accessToken : 'accessToken1 ' ,
66
66
password : 'password1' ,
67
67
apiKey : '***MASKED***' ,
68
68
credential : '***MASKED***' ,
69
69
nested : {
70
- key : 'key2 ' ,
70
+ accessToken : 'accessToken2 ' ,
71
71
password : 'password2' ,
72
72
apiKey : '***MASKED***' ,
73
73
credential : '***MASKED***' ,
0 commit comments