@@ -43,7 +43,7 @@ describe('sanitize utilities', () => {
4343 } ) ;
4444
4545 it ( 'should detect JWT tokens' , ( ) => {
46- const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' ;
46+ const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' ; // gitleaks:allow
4747 const result = sanitizeValue ( jwt ) ;
4848 expect ( result ) . toContain ( '[REDACTED]' ) ;
4949 } ) ;
@@ -57,7 +57,7 @@ describe('sanitize utilities', () => {
5757 describe ( 'sanitizeObject' , ( ) => {
5858 it ( 'should sanitize all sensitive keys in object' , ( ) => {
5959 const obj = {
60- apiKey : 'sk-1234567890abcdefghij' ,
60+ apiKey : 'sk-1234567890abcdefghij' , // gitleaks:allow
6161 username : 'john' ,
6262 password : 'secret123' ,
6363 sessionId : 'abc-def-ghi-jkl'
@@ -74,7 +74,7 @@ describe('sanitize utilities', () => {
7474 it ( 'should handle nested objects' , ( ) => {
7575 const obj = {
7676 config : {
77- apiKey : 'sk-1234567890abcdefghij' ,
77+ apiKey : 'sk-1234567890abcdefghij' , // gitleaks:allow
7878 timeout : 5000
7979 } ,
8080 name : 'test'
@@ -89,7 +89,7 @@ describe('sanitize utilities', () => {
8989
9090 it ( 'should handle arrays' , ( ) => {
9191 const obj = {
92- tokens : [ 'sk-1234567890abcdefghijklmnop' , 'sk-9876543210zyxwvutsrqponmlkjihgfedcba' ] ,
92+ tokens : [ 'sk-1234567890abcdefghijklmnop' , 'sk-9876543210zyxwvutsrqponmlkjihgfedcba' ] , // gitleaks:allow
9393 names : [ 'alice' , 'bob' ]
9494 } ;
9595
@@ -134,7 +134,7 @@ describe('sanitize utilities', () => {
134134
135135 describe ( 'sanitizeAuthToken' , ( ) => {
136136 it ( 'should mask real tokens' , ( ) => {
137- const token = 'sk-1234567890abcdefghij1234567890' ;
137+ const token = 'sk-1234567890abcdefghij1234567890' ; // gitleaks:allow
138138 const result = sanitizeAuthToken ( token ) ;
139139
140140 expect ( result ) . toContain ( 'sk-12345' ) ;
@@ -163,8 +163,8 @@ describe('sanitize utilities', () => {
163163 it ( 'should sanitize multiple arguments' , ( ) => {
164164 const args = [
165165 'normal string' ,
166- { apiKey : 'sk-1234567890abcdefghijklmnop' , name : 'test' } ,
167- 'sk-9876543210zyxwvutsrq9876543210'
166+ { apiKey : 'sk-1234567890abcdefghijklmnop' , name : 'test' } , // gitleaks:allow
167+ 'sk-9876543210zyxwvutsrq9876543210' // gitleaks:allow
168168 ] ;
169169
170170 const result = sanitizeLogArgs ( ...args ) ;
@@ -181,7 +181,7 @@ describe('sanitize utilities', () => {
181181 123 ,
182182 true ,
183183 null ,
184- { apiKey : 'sk-1234567890abcdefghijklmnop' }
184+ { apiKey : 'sk-1234567890abcdefghijklmnop' } // gitleaks:allow
185185 ] ;
186186
187187 const result = sanitizeLogArgs ( ...args ) ;
0 commit comments