File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -225,14 +225,17 @@ export function maskTmqConfigForLog(config: TmqConfig): string {
225225 ...config ,
226226 otherConfigs : Object . fromEntries ( config . otherConfigs )
227227 } ;
228- if ( masked . token ) {
229- masked . token = "[REDACTED]" ;
230- }
231- if ( masked . password ) {
232- masked . password = "[REDACTED]" ;
233- }
234- return JSON . stringify ( masked , ( key , value ) =>
235- ( key === "url" || key === "sql_url" )
236- ? maskUrlForLog ( value ) : ( key === "td.connect.token" ? "[REDACTED]" : value )
237- ) ;
228+ return JSON . stringify ( masked , ( key , value ) => {
229+ switch ( key ) {
230+ case 'url' :
231+ case 'sql_url' :
232+ return maskUrlForLog ( value ) ;
233+ case 'token' :
234+ case 'password' :
235+ case 'td.connect.token' :
236+ return value ? '[REDACTED]' : value ;
237+ default :
238+ return value ;
239+ }
240+ } ) ;
238241}
You can’t perform that action at this time.
0 commit comments