Package overit.geocall.io
Class JSONAuthenticationFilter
java.lang.Object
overit.geocall.io.JSONAuthenticationFilter
- All Implemented Interfaces:
IOLogFilter
This filter is used to mask the sensitive information in the JSON payload of the request and response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final ObjectMapperprotected static final String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TfilterError(T message) This method allow to manage the error message, adding or modifying its content.<T> TfilterInput(T message) This method allow to manage the input message, adding or modifying its content.protected <T> TfilterMessage(T message) This method is used to mask the sensitive information in the JSON payload of the request and response.<T> TfilterOutput(T message) This method allow to manage the output message, adding or modifying its content.protected <T> TjsonNodeToMessage(JsonNode filtered) protected JsonNodemaskSensitiveFields(JsonNode node) protected <T> JsonNodemessageToJsonNode(T message)
-
Field Details
-
OBJECT_MAPPER
-
OBFUSCATED_VALUE
- See Also:
-
SENSITIVE_KEYS
-
-
Constructor Details
-
JSONAuthenticationFilter
public JSONAuthenticationFilter()
-
-
Method Details
-
filterInput
public <T> T filterInput(T message) Description copied from interface:IOLogFilterThis method allow to manage the input message, adding or modifying its content.- Specified by:
filterInputin interfaceIOLogFilter- 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:IOLogFilterThis method allow to manage the output message, adding or modifying its content.- Specified by:
filterOutputin interfaceIOLogFilter- 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:IOLogFilterThis method allow to manage the error message, adding or modifying its content.- Specified by:
filterErrorin interfaceIOLogFilter- 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
- Throws:
IOException
-
jsonNodeToMessage
protected <T> T jsonNodeToMessage(JsonNode filtered) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
maskSensitiveFields
-