Class JSONAuthenticationFilter

java.lang.Object
overit.geocall.io.JSONAuthenticationFilter
All Implemented Interfaces:
IOLogFilter

public class JSONAuthenticationFilter extends Object implements IOLogFilter
This filter is used to mask the sensitive information in the JSON payload of the request and response.
  • Field Details

    • OBJECT_MAPPER

      protected static final ObjectMapper OBJECT_MAPPER
    • OBFUSCATED_VALUE

      protected static final String OBFUSCATED_VALUE
      See Also:
    • SENSITIVE_KEYS

      protected static final String[] SENSITIVE_KEYS
  • Constructor Details

    • JSONAuthenticationFilter

      public JSONAuthenticationFilter()
  • Method Details

    • filterInput

      public <T> T filterInput(T message)
      Description copied from interface: IOLogFilter
      This method allow to manage the input message, adding or modifying its content.
      Specified by:
      filterInput in interface IOLogFilter
      Type Parameters:
      T - the type of the input message. It could be a JsonElement, SOAPMessage, String, etc, depending on the service. So it's important to check che type of the instance and cast the object to the correct class in order to modify it.
      Parameters:
      message - The message
      Returns:
      the message filtered.
    • filterOutput

      public <T> T filterOutput(T message)
      Description copied from interface: IOLogFilter
      This method allow to manage the output message, adding or modifying its content.
      Specified by:
      filterOutput in interface IOLogFilter
      Type Parameters:
      T - the type of the output message. It could be a JsonElement, SOAPMessage, String, etc, depending on the service. So it's important to check che type of the instance and cast the object to the correct class in order to modify it.
      Parameters:
      message - The message
      Returns:
      the message filtered.
    • filterError

      public <T> T filterError(T message)
      Description copied from interface: IOLogFilter
      This method allow to manage the error message, adding or modifying its content.
      Specified by:
      filterError in interface IOLogFilter
      Type Parameters:
      T - the type of the error message. It could be a JsonElement, SOAPMessage, String, etc, depending on the service. So it's important to check che type of the instance and cast the object to the correct class in order to modify it.
      Parameters:
      message - The message
      Returns:
      the message filtered.
    • filterMessage

      protected <T> T filterMessage(T message)
      This method is used to mask the sensitive information in the JSON payload of the request and response.
      Parameters:
      message - The message to be filtered
      Returns:
      The filtered message
    • messageToJsonNode

      protected <T> JsonNode messageToJsonNode(T message) throws IOException
      Throws:
      IOException
    • jsonNodeToMessage

      protected <T> T jsonNodeToMessage(JsonNode filtered) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • maskSensitiveFields

      protected JsonNode maskSensitiveFields(JsonNode node)