You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/11/03 00:46:33 UTC

[1/2] activemq-artemis git commit: ARTEMIS-1492 obfuscate passwords in acceptorControl

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 5a89fcd09 -> 520fe1c5b


ARTEMIS-1492 obfuscate passwords in acceptorControl


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/096d9840
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/096d9840
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/096d9840

Branch: refs/heads/master
Commit: 096d98407fe2da985ae372cb157dcd0ec5bcc215
Parents: 5a89fcd
Author: Justin Bertram <jb...@apache.org>
Authored: Wed Nov 1 11:54:01 2017 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Nov 2 20:46:26 2017 -0400

----------------------------------------------------------------------
 .../artemis/core/management/impl/AcceptorControlImpl.java   | 9 ++++++++-
 .../tests/integration/management/AcceptorControlTest.java   | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/096d9840/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AcceptorControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AcceptorControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AcceptorControlImpl.java
index ce511ef..57a6116 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AcceptorControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AcceptorControlImpl.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.core.management.impl;
 
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanOperationInfo;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -73,7 +74,13 @@ public class AcceptorControlImpl extends AbstractControl implements AcceptorCont
    public Map<String, Object> getParameters() {
       clearIO();
       try {
-         return configuration.getParams();
+         Map<String, Object> clone = new HashMap(configuration.getParams());
+         for (Map.Entry<String, Object> entry : clone.entrySet()) {
+            if (entry.getKey().toLowerCase().contains("password")) {
+               entry.setValue("****");
+            }
+         }
+         return clone;
       } finally {
          blockOnIO();
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/096d9840/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
index dc1c4ea..c6ba3dc 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
@@ -29,6 +29,7 @@ import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.management.Notification;
 import org.apache.activemq.artemis.tests.integration.SimpleNotificationService;
@@ -50,6 +51,7 @@ public class AcceptorControlTest extends ManagementTestBase {
    @Test
    public void testAttributes() throws Exception {
       TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
+      acceptorConfig.getParams().put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "password");
 
       Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig);
       ActiveMQServer service = createServer(false, config);
@@ -60,6 +62,8 @@ public class AcceptorControlTest extends ManagementTestBase {
 
       Assert.assertEquals(acceptorConfig.getName(), acceptorControl.getName());
       Assert.assertEquals(acceptorConfig.getFactoryClassName(), acceptorControl.getFactoryClassName());
+      Assert.assertNotEquals(acceptorConfig.getParams().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME), acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
+      Assert.assertEquals("****", acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
    }
 
    @Test


[2/2] activemq-artemis git commit: This closes #1631

Posted by cl...@apache.org.
This closes #1631


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/520fe1c5
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/520fe1c5
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/520fe1c5

Branch: refs/heads/master
Commit: 520fe1c5b5813dd9790f91aff24663b67796d392
Parents: 5a89fcd 096d984
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Nov 2 20:46:27 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Nov 2 20:46:27 2017 -0400

----------------------------------------------------------------------
 .../artemis/core/management/impl/AcceptorControlImpl.java   | 9 ++++++++-
 .../tests/integration/management/AcceptorControlTest.java   | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------