[
https://issues.apache.org/jira/browse/CXF-8982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17823061#comment-17823061
]
Gaëtan Pitteloud commented on CXF-8982:
---------------------------------------
Pull request submitted here: https://github.com/apache/cxf/pull/1721
> LoggingFeature does not hide sensitive xml elements with namespace prefix
> -------------------------------------------------------------------------
>
> Key: CXF-8982
> URL: https://issues.apache.org/jira/browse/CXF-8982
> Project: CXF
> Issue Type: Improvement
> Components: logging
> Affects Versions: 4.0.3
> Reporter: Gaëtan Pitteloud
> Priority: Major
>
> 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:
>
> {code:java}
> private static final String MATCH_PATTERN_XML_TEMPLATE =
> "(<(\\w+:)?-ELEMENT_NAME-.*?>)(.*?)(</(\\w+:)?-ELEMENT_NAME->)";
> private static final String REPLACEMENT_XML_TEMPLATE = "$1XXX$4";
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)