[ 
https://issues.apache.org/jira/browse/ARTEMIS-4580?focusedWorklogId=900800&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-900800
 ]

ASF GitHub Bot logged work on ARTEMIS-4580:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jan/24 04:23
            Start Date: 20/Jan/24 04:23
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755#discussion_r1460196178


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/FQQNSendSecurityTest.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.security;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.RoleSet;
+import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.core.security.Role;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import 
org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
+import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class FQQNSendSecurityTest extends ActiveMQTestBase {
+
+   private final String USER = RandomUtil.randomString();
+   private final String PASS = RandomUtil.randomString();
+   private final String ROLE = RandomUtil.randomString();
+
+   @Override
+   @Before
+   public void setUp() throws Exception {
+      super.setUp();
+      Configuration configuration = 
createDefaultInVMConfig().setSecurityEnabled(true);
+      RoleSet roles1 = new RoleSet();
+      roles1.add(new Role(ROLE, true, true, true, true, true, true, true, 
true, true, true));
+      RoleSet roles2 = new RoleSet();
+      roles2.add(new Role(ROLE, false, false, true, true, true, true, true, 
true, true, true));
+      configuration.putSecurityRoles("foo::q1", roles1);
+      configuration.putSecurityRoles("foo", roles2);
+
+      ActiveMQServer server = createServer(false, configuration);
+
+      ActiveMQJAASSecurityManager securityManager = new 
ActiveMQJAASSecurityManager(InVMLoginModule.class.getName());
+      SecurityConfiguration securityConfiguration = new 
SecurityConfiguration();
+      securityConfiguration.addUser(USER, PASS);
+      securityConfiguration.addRole(USER, ROLE);
+      securityManager.setConfiguration(securityConfiguration);
+      server.setSecurityManager(securityManager);
+
+      server.start();
+   }
+
+   @Test

Review Comment:
   Fixed.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 900800)
    Time Spent: 0.5h  (was: 20m)

> Security settings for FQQN not enforced on send
> -----------------------------------------------
>
>                 Key: ARTEMIS-4580
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4580
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to