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 Details

    • SensitivePropRedactionUtils

      public SensitivePropRedactionUtils()
  • Method Details

    • 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 redaction
      propValue - the value of the property under consideration; returned verbatim if redaction is not necessary.
    • flattenAndRedactForLogging

      public static String flattenAndRedactForLogging(Map<String,Object> properties)