Package org.apache.zookeeper.common
Class LogRedactor
- java.lang.Object
-
- org.apache.zookeeper.common.LogRedactor
-
public class LogRedactor extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertiesredactSensitiveValues(Map<?,?> properties)Redacts all values which ends with "password" from the given properties / map.static StringredactValue(String key, String value)Returns redacted value when the key ends with "password".
-
-
-
Method Detail
-
redactSensitiveValues
public static Properties redactSensitiveValues(Map<?,?> properties)
Redacts all values which ends with "password" from the given properties / map. Other values are not changed.- Parameters:
properties- the properties in which all passwords should be redacted.- Returns:
- new Properties object containing all values, passwords redacted.
-
redactValue
public static String redactValue(String key, String value)
Returns redacted value when the key ends with "password". Otherwise, just returns the value.- Parameters:
key- the key to check if it ends with "password".- Returns:
- redacted value when the key ends with "password". Otherwise, the value.
-
-