Package overit.geocall.cxf.filter
Class AuthenticationFilter
java.lang.Object
overit.geocall.cxf.filter.AuthenticationFilter
- All Implemented Interfaces:
IOLogFilter
This filter obfuscates authentication sensitive information (e.g.
UsernameToken password value, apiKey, secrets, tokens, etc.)
-
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.<T> TfilterOutput(T message) This method allow to manage the output message, adding or modifying its content.protected booleanChecks if the node name contains any sensitive keyword (case insensitive).protected voidObfuscates the content of a sensitive node.
-
Constructor Details
-
AuthenticationFilter
public AuthenticationFilter()
-
-
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.
-
isSensitiveNode
Checks if the node name contains any sensitive keyword (case insensitive).- Parameters:
n- the node to check.- Returns:
trueif the node name contains a sensitive keyword.
-
obfuscateNode
Obfuscates the content of a sensitive node. This includes text content and the "value" attribute if present.- Parameters:
n- the node to obfuscate.
-