Class LogUtil

java.lang.Object
io.strimzi.kafka.oauth.common.LogUtil

public class LogUtil extends Object
The helper class with logging helper methods used in multiple places
  • Constructor Details

    • LogUtil

      public LogUtil()
  • Method Details

    • mask

      public static String mask(String input)
      Return masked input text.

      Masking checks the length of input. If less than 8 it returns '**********'. If less than 20 it prints out first letter in clear text, and then additional 9x '*' irrespective of actual input size. If input length is greater than 20 chars, it prints out first 4 in clear text followed by '***..***' followed by last 4.

      The idea is to give some information for debugging while not leaking too much information about secrets.

      Parameters:
      input - String with sensitive date which should be masked
      Returns:
      The new masked string
    • singleQuote

      public static String singleQuote(String value)
      Wrap the value in single quotes, or return null if value is null
      Parameters:
      value - The value to wrap in single quotes
      Returns:
      The quoted value