You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2021/02/24 07:53:01 UTC

[cxf] branch 3.4.x-fixes updated (2f51b38 -> 0712c1d)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 2f51b38  Recording .gitmergeinfo Changes
     new 21a297f  Cxf 3891 regex for add sensitive element names is replace only the last element (#738)
     new 0712c1d  CXF-3891 - Checkstyle fix

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java | 2 +-
 .../java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java  | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)


[cxf] 02/02: CXF-3891 - Checkstyle fix

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0712c1daffa46eb7df27caa41a95a718a660191d
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Feb 24 07:50:03 2021 +0000

    CXF-3891 - Checkstyle fix
    
    (cherry picked from commit 56a84e00497b916a203d828bc731c8e70406a0f9)
---
 .../java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
index 9e74876..fae7bfc 100644
--- a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
+++ b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
@@ -61,11 +61,11 @@ public class MaskSensitiveHelperTest {
             "\"user\":\"testUser\", \"password\": \"XXX\"";
     
     private static final String SENSITIVE_LOGGING_MULTIPLE_ELEMENT_XML =
-        "<item><user>testUser1</user><password myAttribute=\"test\">my secret password 1</password></item>"+
-            "<item><user>testUser2</user><password>my secret password 2</password></item>";
+        "<item><user>testUser1</user><password myAttribute=\"test\">my secret password 1</password></item>"
+            + "<item><user>testUser2</user><password>my secret password 2</password></item>";
     private static final String MASKED_LOGGING_MULTIPLE_ELEMENT_XML =
-        "<item><user>testUser1</user><password myAttribute=\"test\">XXX</password></item>"+
-            "<item><user>testUser2</user><password>XXX</password></item>";
+        "<item><user>testUser1</user><password myAttribute=\"test\">XXX</password></item>"
+            + "<item><user>testUser2</user><password>XXX</password></item>";
 
     private static final Set<String> SENSITIVE_ELEMENTS = new HashSet(Arrays.asList("password"));
     private static final String APPLICATION_XML = "application/xml";


[cxf] 01/02: Cxf 3891 regex for add sensitive element names is replace only the last element (#738)

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 21a297f885b486022705065001f418d28263a516
Author: Carlos Eduardo Panarello <ca...@gmail.com>
AuthorDate: Wed Feb 24 04:48:32 2021 -0300

    Cxf 3891 regex for add sensitive element names is replace only the last element (#738)
    
    * Change regex template for xml elements
    
    * Fix regex in xml element template
    
    * Test for regex with multiple elements in xml
    
    (cherry picked from commit ebb77c1d05e2e489bdb4bb3e874d58d6027ea15d)
---
 .../main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java | 2 +-
 .../java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java  | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java
index 51361a9..811a541 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/MaskSensitiveHelper.java
@@ -27,7 +27,7 @@ import org.apache.cxf.message.Message;
 
 public class MaskSensitiveHelper {
     private static final String ELEMENT_NAME_TEMPLATE = "-ELEMENT_NAME-";
-    private static final String MATCH_PATTERN_XML_TEMPLATE = "(<-ELEMENT_NAME-.*>)(.*?)(</-ELEMENT_NAME->)";
+    private static final String MATCH_PATTERN_XML_TEMPLATE = "(<-ELEMENT_NAME-.*?>)(.*?)(</-ELEMENT_NAME->)";
     private static final String REPLACEMENT_XML_TEMPLATE = "$1XXX$3";
     private static final String MATCH_PATTERN_JSON_TEMPLATE = "\"-ELEMENT_NAME-\"[ \\t]*:[ \\t]*\"(.*?)\"";
     private static final String REPLACEMENT_JSON_TEMPLATE = "\"-ELEMENT_NAME-\": \"XXX\"";
diff --git a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
index a6d6f3a..9e74876 100644
--- a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
+++ b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/MaskSensitiveHelperTest.java
@@ -59,6 +59,13 @@ public class MaskSensitiveHelperTest {
             "\"user\":\"testUser\", \"password\": \"my secret password\"";
     private static final String MASKED_LOGGING_CONTENT_JSON =
             "\"user\":\"testUser\", \"password\": \"XXX\"";
+    
+    private static final String SENSITIVE_LOGGING_MULTIPLE_ELEMENT_XML =
+        "<item><user>testUser1</user><password myAttribute=\"test\">my secret password 1</password></item>"+
+            "<item><user>testUser2</user><password>my secret password 2</password></item>";
+    private static final String MASKED_LOGGING_MULTIPLE_ELEMENT_XML =
+        "<item><user>testUser1</user><password myAttribute=\"test\">XXX</password></item>"+
+            "<item><user>testUser2</user><password>XXX</password></item>";
 
     private static final Set<String> SENSITIVE_ELEMENTS = new HashSet(Arrays.asList("password"));
     private static final String APPLICATION_XML = "application/xml";
@@ -79,6 +86,7 @@ public class MaskSensitiveHelperTest {
         return Arrays.asList(new Object[][] {
             {SENSITIVE_LOGGING_CONTENT_XML, MASKED_LOGGING_CONTENT_XML, APPLICATION_XML},
             {SENSITIVE_LOGGING_CONTENT_XML_WITH_ATTRIBUTE, MASKED_LOGGING_CONTENT_XML_WITH_ATTRIBUTE, APPLICATION_XML},
+            {SENSITIVE_LOGGING_MULTIPLE_ELEMENT_XML, MASKED_LOGGING_MULTIPLE_ELEMENT_XML, APPLICATION_XML},
             {SENSITIVE_LOGGING_CONTENT_JSON, MASKED_LOGGING_CONTENT_JSON, APPLICATION_JSON}
         });
     }