diff options
| author | Keith Wall <kwall@apache.org> | 2014-04-01 10:35:33 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-04-01 10:35:33 +0000 |
| commit | 403b8c70717d8a16744cd836f015d39df2fa9733 (patch) | |
| tree | ede7d62283d670cfc2891f080a5544b4a50d8c29 /java/broker-plugins/access-control | |
| parent | 02683439f40fc2161afcb45c2cacd22e1ce83004 (diff) | |
| download | qpid-python-403b8c70717d8a16744cd836f015d39df2fa9733.tar.gz | |
QPID-5653, QPID-5624: Remove support for virtual host xml and make message and configuration stores stateless.
This commit will temporarily break the UI
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1583597 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins/access-control')
3 files changed, 14 insertions, 22 deletions
diff --git a/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java b/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java index f6d8b04880..5f5e12d435 100644 --- a/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java +++ b/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java @@ -29,7 +29,6 @@ import java.util.Set; import javax.security.auth.Subject; -import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang.ObjectUtils; import org.apache.log4j.Logger; import org.apache.qpid.server.configuration.IllegalConfigurationException; @@ -64,7 +63,7 @@ public class DefaultAccessControl implements AccessControl _aclFile = new File(fileName); } - DefaultAccessControl(RuleSet rs) throws ConfigurationException + DefaultAccessControl(RuleSet rs) { _ruleSet = rs; _eventLogger = rs; diff --git a/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java b/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java index 1440904c74..6ac21f856a 100644 --- a/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java +++ b/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java @@ -36,12 +36,6 @@ import org.apache.qpid.server.security.access.Operation; import static org.mockito.Mockito.mock; -/** - * These tests check that the ACL file parsing works correctly. - * - * For each message that can be returned in a {@link ConfigurationException}, an ACL file is created that should trigger this - * particular message. - */ public class PlainConfigurationTest extends TestCase { private PlainConfiguration writeACLConfig(String...aclData) throws Exception diff --git a/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java b/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java index 72dadb736f..072bd6a87f 100644 --- a/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java +++ b/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java @@ -33,7 +33,6 @@ import javax.security.auth.Subject; import junit.framework.TestCase; -import org.apache.commons.configuration.ConfigurationException; import org.apache.qpid.server.connection.ConnectionPrincipal; import org.apache.qpid.server.logging.EventLogger; import org.apache.qpid.server.logging.EventLoggerProvider; @@ -70,12 +69,12 @@ public class DefaultAccessControlTest extends TestCase _plugin = null; } - private void setUpGroupAccessControl() throws ConfigurationException + private void setUpGroupAccessControl() { configureAccessControl(createGroupRuleSet()); } - private void configureAccessControl(final RuleSet rs) throws ConfigurationException + private void configureAccessControl(final RuleSet rs) { _plugin = new DefaultAccessControl(rs); } @@ -100,7 +99,7 @@ public class DefaultAccessControlTest extends TestCase /** * ACL plugin must always abstain if there is no subject attached to the thread. */ - public void testNoSubjectAlwaysAbstains() throws ConfigurationException + public void testNoSubjectAlwaysAbstains() { setUpGroupAccessControl(); final Result result = _plugin.authorise(Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY); @@ -111,7 +110,7 @@ public class DefaultAccessControlTest extends TestCase * Tests that an allow rule expressed with a username allows an operation performed by a thread running * with the same username. */ - public void testUsernameAllowsOperation() throws ConfigurationException + public void testUsernameAllowsOperation() { setUpGroupAccessControl(); Subject.doAs(TestPrincipalUtils.createTestSubject("user1"), new PrivilegedAction<Object>() @@ -130,7 +129,7 @@ public class DefaultAccessControlTest extends TestCase * Tests that an allow rule expressed with an <b>ACL groupname</b> allows an operation performed by a thread running * by a user who belongs to the same group.. */ - public void testGroupMembershipAllowsOperation() throws ConfigurationException + public void testGroupMembershipAllowsOperation() { setUpGroupAccessControl(); @@ -143,7 +142,7 @@ public class DefaultAccessControlTest extends TestCase * Tests that a deny rule expressed with a <b>groupname</b> denies an operation performed by a thread running * by a user who belongs to the same group. */ - public void testGroupMembershipDeniesOperation() throws ConfigurationException + public void testGroupMembershipDeniesOperation() { setUpGroupAccessControl(); authoriseAndAssertResult(Result.DENIED, "user3", DENIED_GROUP); @@ -152,7 +151,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that the catch all deny denies the operation and logs with the logging actor. */ - public void testCatchAllRuleDeniesUnrecognisedUsername() throws ConfigurationException + public void testCatchAllRuleDeniesUnrecognisedUsername() { setUpGroupAccessControl(); Subject.doAs(TestPrincipalUtils.createTestSubject("unknown", "unkgroup1", "unkgroup2"), @@ -179,7 +178,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that a grant access method rule allows any access operation to be performed on any component */ - public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnAllComponents() throws ConfigurationException + public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnAllComponents() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); @@ -205,7 +204,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that a grant access method rule allows any access operation to be performed on a specified component */ - public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException + public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnSpecifiedComponent() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); @@ -305,7 +304,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that a grant access method rule allows any access operation to be performed on a specified component */ - public void testAuthoriseAccessMethodWhenSpecifiedAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException + public void testAuthoriseAccessMethodWhenSpecifiedAccessOperationsAllowedOnSpecifiedComponent() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); @@ -342,7 +341,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that granting of all method rights on a method allows a specified operation to be performed on any component */ - public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnSpecifiedMethodForAllComponents() throws ConfigurationException + public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnSpecifiedMethodForAllComponents() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); @@ -381,7 +380,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that granting of all method rights allows any operation to be performed on any component */ - public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnAllMethodsInAllComponents() throws ConfigurationException + public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnAllMethodsInAllComponents() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); @@ -419,7 +418,7 @@ public class DefaultAccessControlTest extends TestCase /** * Tests that granting of access method rights with mask allows matching operations to be performed on the specified component */ - public void testAuthoriseAccessMethodWhenMatchingAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException + public void testAuthoriseAccessMethodWhenMatchingAccessOperationsAllowedOnSpecifiedComponent() { final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class)); |
