Package org.apache.solr.crossdc.common
Class SensitivePropRedactionUtils
- java.lang.Object
-
- org.apache.solr.crossdc.common.SensitivePropRedactionUtils
-
public class SensitivePropRedactionUtils extends Object
Helper functionality related to redacting arbitrary properties which may contain sensitive password information.Used primarily as a safeguard before logging out configuration properties. Redaction logic heavily depends on string matching against elements of the
PATTERNS_REQUIRING_REDACTION_LOWERCASE
block-list.
-
-
Constructor Summary
Constructors Constructor Description SensitivePropRedactionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
flattenAndRedactForLogging(Map<String,Object> properties)
static boolean
propertyRequiresRedaction(String propName)
static String
redactPropertyIfNecessary(String propName, String propValue)
Redacts a property value if necessary, and returns the result.
-
-
-
Method Detail
-
propertyRequiresRedaction
public static boolean propertyRequiresRedaction(String propName)
-
redactPropertyIfNecessary
public static String redactPropertyIfNecessary(String propName, String propValue)
Redacts a property value if necessary, and returns the result.Redaction only occurs when the property name matches a pattern on the
PATTERNS_REQUIRING_REDACTION_LOWERCASE
block-list.- Parameters:
propName
- the name or key of the property being considered for redactionpropValue
- the value of the property under consideration; returned verbatim if redaction is not necessary.
-
-