File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -219,19 +219,19 @@ export function maskUrlForLog(url: URL | null): string {
219219 return masked . toString ( ) . replace ( / % 5 B R E D A C T E D % 5 D / g, "[REDACTED]" ) ;
220220}
221221
222- export function maskTmqConfigForLog ( config : Map < string , any > ) : TmqConfig {
223- const maskedConfig = new TmqConfig ( config ) ;
224- if ( maskedConfig . url ) {
225- maskedConfig . url = new URL ( maskUrlForLog ( maskedConfig . url ) ) ;
222+ export function maskTmqConfigForLog ( config : TmqConfig ) : object {
223+ const masked = { ... config , otherConfigs : Object . fromEntries ( config . otherConfigs ) } ;
224+ if ( masked . url ) {
225+ masked . url = new URL ( maskUrlForLog ( masked . url ) ) ;
226226 }
227- if ( maskedConfig . sql_url ) {
228- maskedConfig . sql_url = new URL ( maskUrlForLog ( maskedConfig . sql_url ) ) ;
227+ if ( masked . sql_url ) {
228+ masked . sql_url = new URL ( maskUrlForLog ( masked . sql_url ) ) ;
229229 }
230- if ( maskedConfig . token ) {
231- maskedConfig . token = "[REDACTED]" ;
230+ if ( masked . token ) {
231+ masked . token = "[REDACTED]" ;
232232 }
233- if ( maskedConfig . password ) {
234- maskedConfig . password = "[REDACTED]" ;
233+ if ( masked . password ) {
234+ masked . password = "[REDACTED]" ;
235235 }
236- return maskedConfig ;
236+ return masked ;
237237}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export class WsConsumer {
3434 private constructor ( wsConfig : Map < string , any > ) {
3535 this . _wsConfig = new TmqConfig ( wsConfig ) ;
3636 if ( logger . isDebugEnabled ( ) ) {
37- logger . debug ( maskTmqConfigForLog ( wsConfig ) ) ;
37+ logger . debug ( maskTmqConfigForLog ( this . _wsConfig ) ) ;
3838 }
3939 if ( wsConfig . size == 0 || ! this . _wsConfig . url ) {
4040 throw new WebSocketInterfaceError (
You can’t perform that action at this time.
0 commit comments