public static String maskString ( String input , String key ) { String output = input ; Map < String , Object > stringConfig = ( Map < String , Object > ) config . get ( MASK_TYPE_STRING ) ; if ( stringConfig != null ) { Map < String , Object > keyConfig = ( Map < String , Object > ) stringConfig . get ( key ) ; if ( keyConfig != null ) { Set < String > patterns = keyConfig . keySet ( ) ; for ( String pattern : patterns ) { output = output . replaceAll ( pattern , ( String ) keyConfig . get ( pattern ) ) ; } } } return output ; }
Mask the input string with a list of patterns indexed by key in string section in mask . json This is usually used to mask header values query parameters and uri parameters