Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 65971 invoked from network); 17 Dec 2009 16:26:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Dec 2009 16:26:39 -0000 Received: (qmail 46504 invoked by uid 500); 17 Dec 2009 16:26:39 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 46446 invoked by uid 500); 17 Dec 2009 16:26:39 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 46437 invoked by uid 99); 17 Dec 2009 16:26:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 16:26:39 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 16:26:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6EBC32388A46; Thu, 17 Dec 2009 16:26:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r891790 - in /activemq/branches/activemq-5.3/activemq-core/src: main/java/org/apache/activemq/security/ test/java/org/apache/activemq/security/ test/resources/org/apache/activemq/security/ Date: Thu, 17 Dec 2009 16:26:07 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091217162616.6EBC32388A46@eris.apache.org> Author: dejanb Date: Thu Dec 17 16:26:01 2009 New Revision: 891790 URL: http://svn.apache.org/viewvc?rev=891790&view=rev Log: merging 891786 - https://issues.apache.org/activemq/browse/AMQ-2539 - adding temp destinations and security Modified: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java activemq/branches/activemq-5.3/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml Modified: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java?rev=891790&r1=891789&r2=891790&view=diff ============================================================================== --- activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java (original) +++ activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java Thu Dec 17 16:26:01 2009 @@ -28,6 +28,7 @@ import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; import org.apache.activemq.command.ConsumerInfo; +import org.apache.activemq.command.DestinationInfo; import org.apache.activemq.command.Message; import org.apache.activemq.command.ProducerInfo; @@ -45,6 +46,11 @@ super(next); this.authorizationMap = authorizationMap; } + + public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { + addDestination(context, info.getDestination()); + super.addDestinationInfo(context, info); + } public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { final SecurityContext securityContext = (SecurityContext)context.getSecurityContext(); Modified: activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java?rev=891790&r1=891789&r2=891790&view=diff ============================================================================== --- activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java (original) +++ activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java Thu Dec 17 16:26:01 2009 @@ -18,14 +18,20 @@ import java.net.URI; +import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.Session; +import javax.jms.TemporaryTopic; +import javax.management.ObjectName; import junit.framework.Test; import org.apache.activemq.CombinationTestSupport; import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerService; +import org.apache.activemq.broker.jmx.TopicViewMBean; import org.apache.activemq.command.ActiveMQMessage; import org.apache.activemq.command.ActiveMQQueue; import org.apache.commons.logging.Log; @@ -66,5 +72,24 @@ assertEquals("guest", ((ActiveMQMessage)sent).getUserID()); assertEquals("guest", sent.getStringProperty("JMSXUserID")); } + + public void testTempDestinations() throws Exception { + Connection conn = factory.createConnection("guest", "password"); + Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); + String name = "org.apache.activemq:BrokerName=localhost,Type=TempTopic"; + try { + conn.start(); + TemporaryTopic temp = sess.createTemporaryTopic(); + name += ",Destination=" + temp.getTopicName().replaceAll(":", "_"); + fail("Should have failed creating a temp topic"); + } catch (Exception ignore) {} + + ObjectName objName = new ObjectName(name); + TopicViewMBean mbean = (TopicViewMBean)broker.getManagementContext().newProxyInstance(objName, TopicViewMBean.class, true); + try { + System.out.println(mbean.getName()); + fail("Shouldn't have created a temp topic"); + } catch (Exception ignore) {} + } } Modified: activemq/branches/activemq-5.3/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml?rev=891790&r1=891789&r2=891790&view=diff ============================================================================== --- activemq/branches/activemq-5.3/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml (original) +++ activemq/branches/activemq-5.3/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml Thu Dec 17 16:26:01 2009 @@ -60,6 +60,9 @@ + + +