Details
Description
When setting a sensitive element name in the LoggingFeature, the element is not hidden if the element appears in XML with a namespace prefix.
It's not possible to just add a prefix when configuring the LoggingFeature:
- this does not work for JSON
- the namespace prefix is typically generated by the marshaller (ns1, ns2, etc) thus unknown during configuration
The solution is to change the xml regex templates in MaskSensitiveHelper by adding the optional prefix group in the opening and closing tags:
private static final String MATCH_PATTERN_XML_TEMPLATE = "(<(\\w+:)?-ELEMENT_NAME-.*?>)(.*?)(</(\\w+:)?-ELEMENT_NAME->)"; private static final String REPLACEMENT_XML_TEMPLATE = "$1XXX$4";
Attachments
Issue Links
- links to