jbonofre commented on code in PR #1918:
URL: https://github.com/apache/activemq/pull/1918#discussion_r3079506758


##########
activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java:
##########
@@ -44,6 +44,8 @@ public class BrokerView implements BrokerViewMBean {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(BrokerView.class);
 
+    private static final Set<String> DENIED_TRANSPORT_SCHEMES = Set.of("vm", 
"http");

Review Comment:
   Should we consider `https` here?



##########
activemq-unit-tests/src/test/java/org/apache/activemq/jmx/JmxCreateNCTest.java:
##########
@@ -82,35 +80,44 @@ public void testBridgeRegistration() throws Exception {
 
     @Test
     public void testVmBridgeBlocked() throws Exception {
+        testDeniedBridgeBlocked("vm");
+    }
+
+    @Test
+    public void testHttpBridgeBlocked() throws Exception {
+        testDeniedBridgeBlocked("http");
+    }
+
+    protected void testDeniedBridgeBlocked(String scheme) throws Exception {
         // Test composite network connector uri
         try {
-            proxy.addNetworkConnector("static:(vm://localhost)");
-            fail("Should have failed trying to add vm connector bridge");
+            proxy.addNetworkConnector("static:(" + scheme + "://localhost)");
+            fail("Should have failed trying to add connector bridge");
         } catch (IllegalArgumentException e) {
-            assertEquals("VM scheme is not allowed", e.getMessage());
+            assertEquals("Transport scheme '" + scheme + "' is not allowed", 
e.getMessage());
         }
 
         try {
-            proxy.addNetworkConnector("multicast:(vm://localhost)");
+            proxy.addNetworkConnector("multicast:(" + scheme + 
"://localhost)");
             fail("Should have failed trying to add vm connector bridge");

Review Comment:
   nit: `vm` can be removed here (for consistency to other).
   
   
   ```suggestion
               fail("Should have failed trying to add connector bridge");
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to