ARTEMIS-2326 remove pwd params before creating protocol mgr
This commit is contained in:
parent
f664713757
commit
f584efd574
|
@ -50,6 +50,7 @@ public class ProtonProtocolManagerFactory extends AbstractProtocolManagerFactory
|
||||||
final Map<String, Object> parameters,
|
final Map<String, Object> parameters,
|
||||||
List<BaseInterceptor> incomingInterceptors,
|
List<BaseInterceptor> incomingInterceptors,
|
||||||
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new ProtonProtocolManager(this, server, incomingInterceptors, outgoingInterceptors), parameters);
|
return BeanSupport.setData(new ProtonProtocolManager(this, server, incomingInterceptors, outgoingInterceptors), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class HornetQProtocolManagerFactory extends CoreProtocolManagerFactory {
|
||||||
hqIncoming.add(new HQPropertiesConversionInterceptor(true));
|
hqIncoming.add(new HQPropertiesConversionInterceptor(true));
|
||||||
hqOutgoing.add(new HQPropertiesConversionInterceptor(false));
|
hqOutgoing.add(new HQPropertiesConversionInterceptor(false));
|
||||||
|
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new HornetQProtocolManager(this, server, hqIncoming, hqOutgoing), parameters);
|
return BeanSupport.setData(new HornetQProtocolManager(this, server, hqIncoming, hqOutgoing), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ public class MQTTProtocolManagerFactory extends AbstractProtocolManagerFactory<M
|
||||||
final Map<String, Object> parameters,
|
final Map<String, Object> parameters,
|
||||||
List<BaseInterceptor> incomingInterceptors,
|
List<BaseInterceptor> incomingInterceptors,
|
||||||
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new MQTTProtocolManager(server, connectedClients, sessionStates, incomingInterceptors, outgoingInterceptors), parameters);
|
return BeanSupport.setData(new MQTTProtocolManager(server, connectedClients, sessionStates, incomingInterceptors, outgoingInterceptors), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class OpenWireProtocolManagerFactory extends AbstractProtocolManagerFacto
|
||||||
Map<String, Object> parameters,
|
Map<String, Object> parameters,
|
||||||
final List<BaseInterceptor> incomingInterceptors,
|
final List<BaseInterceptor> incomingInterceptors,
|
||||||
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new OpenWireProtocolManager(this, server), parameters);
|
return BeanSupport.setData(new OpenWireProtocolManager(this, server), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ public class StompProtocolManagerFactory extends AbstractProtocolManagerFactory<
|
||||||
final Map<String, Object> parameters,
|
final Map<String, Object> parameters,
|
||||||
final List<BaseInterceptor> incomingInterceptors,
|
final List<BaseInterceptor> incomingInterceptors,
|
||||||
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new StompProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
|
return BeanSupport.setData(new StompProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class CoreProtocolManagerFactory extends AbstractProtocolManagerFactory<I
|
||||||
Map<String, Object> parameters,
|
Map<String, Object> parameters,
|
||||||
final List<BaseInterceptor> incomingInterceptors,
|
final List<BaseInterceptor> incomingInterceptors,
|
||||||
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
List<BaseInterceptor> outgoingInterceptors) throws Exception {
|
||||||
|
stripPasswordParameters(parameters);
|
||||||
return BeanSupport.setData(new CoreProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
|
return BeanSupport.setData(new CoreProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.spi.core.protocol;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.BaseInterceptor;
|
import org.apache.activemq.artemis.api.core.BaseInterceptor;
|
||||||
|
@ -47,4 +48,14 @@ public abstract class AbstractProtocolManagerFactory<P extends BaseInterceptor>
|
||||||
return listOut;
|
return listOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* org.apache.commons.beanutils.BeanUtils will log all the parameters so we strip out any password parameters
|
||||||
|
* (e.g. passwords for SSL keystore & truststore)
|
||||||
|
*
|
||||||
|
* @param parameters
|
||||||
|
*/
|
||||||
|
protected void stripPasswordParameters(Map<String, Object> parameters) {
|
||||||
|
parameters.entrySet().removeIf(entries->entries.getKey().toLowerCase().contains("password"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue