You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2009/10/21 13:38:44 UTC
svn commit: r827967 - in /qpid/trunk/qpid/java/systests:
etc/config-systests-acl-settings.xml
src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Author: robbie
Date: Wed Oct 21 11:38:44 2009
New Revision: 827967
URL: http://svn.apache.org/viewvc?rev=827967&view=rev
Log:
QPID-1304: update ACL test + configuration file to use a static ACL configuration (with a secondary virtualhost)
Modified:
qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Modified: qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml?rev=827967&r1=827966&r2=827967&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml Wed Oct 21 11:38:44 2009
@@ -134,6 +134,26 @@
</security>
</test>
</virtualhost>
+
+ <virtualhost>
+ <name>test2</name>
+ <test2>
+ <security>
+ <access>
+ <class>org.apache.qpid.server.security.access.plugins.SimpleXML</class>
+ </access>
+
+ <access_control_list>
+ <!-- This section grants specific users full permissions to all artifacts in this virtualhost -->
+ <access>
+ <users>
+ <user>guest</user>
+ </users>
+ </access>
+ </access_control_list>
+ </security>
+ </test2>
+ </virtualhost>
</virtualhosts>
</broker>
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=827967&r1=827966&r2=827967&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Wed Oct 21 11:38:44 2009
@@ -26,9 +26,11 @@
import org.apache.qpid.AMQConnectionFailureException;
import org.apache.qpid.client.AMQAuthenticationException;
import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQConnectionURL;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.jms.ConnectionURL;
import org.apache.qpid.test.utils.QpidTestCase;
import org.apache.qpid.url.URLSyntaxException;
@@ -119,17 +121,19 @@
public void testAccessVhostAuthorisedGuest() throws IOException, Exception
{
- //The 'guest' user normally has no access, as tested below in testAccessNoRights(), and so is unable to perform
- //actions such as connecting (and by extension, creating a queue, and consuming from a queue etc). In order to test
- //the vhost-wide 'access' right, we will now give the guest user 'access' ACL rights and perform various such actions.
- setConfigurationProperty("virtualhosts.virtualhost.test.security.access_control_list.access.users.user", "guest");
+ //The 'guest' user has no access to the 'test' vhost, as tested below in testAccessNoRights(), and so
+ //is unable to perform actions such as connecting (and by extension, creating a queue, and consuming
+ //from a queue etc). In order to test the vhost-wide 'access' ACL right, the 'guest' user has been given
+ //this right in the 'test2' vhost.
setUpACLTest();
try
{
- //get a connection
- Connection conn = getConnection("guest", "guest");
+ //get a connection to the 'test2' vhost using the guest user and perform various actions.
+ Connection conn = getConnection(new AMQConnectionURL(
+ "amqp://username:password@clientid/test2?brokerlist='" + getBroker() + "'"));
+
((AMQConnection) conn).setConnectionListener(this);
Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org