activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject activemq git commit: Revert "https://issues.apache.org/jira/browse/AMQ-5644 - authorization map for wildcard subscriptions"
Date Fri, 06 Mar 2015 17:06:26 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 528c25c6d -> 24c2215f4


Revert "https://issues.apache.org/jira/browse/AMQ-5644 - authorization map for wildcard subscriptions"

This reverts commit 7777744dc256c11d2545056c8afb2049bb0ae165.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/24c2215f
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/24c2215f
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/24c2215f

Branch: refs/heads/master
Commit: 24c2215f4e47aafac01c28fb14e2f70ae94e81b2
Parents: 528c25c
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Fri Mar 6 18:05:42 2015 +0100
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Fri Mar 6 18:06:17 2015 +0100

----------------------------------------------------------------------
 .../security/DefaultAuthorizationMap.java         | 15 +--------------
 .../activemq/security/AuthorizationMapTest.java   | 18 ------------------
 2 files changed, 1 insertion(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/24c2215f/activemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
b/activemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
index e320a9f..e2a3d8e 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.activemq.command.ActiveMQDestination;
-import org.apache.activemq.filter.DestinationFilter;
 import org.apache.activemq.filter.DestinationMap;
 import org.apache.activemq.filter.DestinationMapEntry;
 
@@ -171,19 +170,7 @@ public class DefaultAuthorizationMap extends DestinationMap implements
Authoriza
             }
             return answer;
         }
-
-        Set answer = findWildcardMatches(key);
-
-        if (key.isPattern()) {
-            for (Iterator<Object> iterator = answer.iterator(); iterator.hasNext();
) {
-                AuthorizationEntry entry = (AuthorizationEntry)iterator.next();
-                DestinationFilter filter = DestinationFilter.parseFilter(entry.getDestination());
-                if (!filter.matches(key)) {
-                    iterator.remove();
-                }
-            }
-        }
-        return answer;
+        return findWildcardMatches(key);
     }
 
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/24c2215f/activemq-unit-tests/src/test/java/org/apache/activemq/security/AuthorizationMapTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/security/AuthorizationMapTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/security/AuthorizationMapTest.java
index c2b3bc4..b6ace87 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/security/AuthorizationMapTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/security/AuthorizationMapTest.java
@@ -89,24 +89,6 @@ public class AuthorizationMapTest extends TestCase {
         assertTrue("Contains users group", tempAdminACLs.contains(TEMP_DESTINATION_ADMINS));
     }
 
-    public void testWildcardSubscriptions() {
-        AuthorizationMap map = createAuthorizationMap();
-        Set<?> readACLs = map.getReadACLs(new ActiveMQQueue(">"));
-        assertEquals("set size: " + readACLs, 1, readACLs.size());
-        assertTrue("Contains admins group", readACLs.contains(ADMINS));
-        assertFalse("Contains users group", readACLs.contains(USERS));
-
-        readACLs = map.getReadACLs(new ActiveMQQueue("USERS.>"));
-        assertEquals("set size: " + readACLs, 2, readACLs.size());
-        assertTrue("Contains admins group", readACLs.contains(ADMINS));
-        assertTrue("Contains users group", readACLs.contains(USERS));
-
-        readACLs = map.getReadACLs(new ActiveMQQueue("USERS.FOO.>"));
-        assertEquals("set size: " + readACLs, 2, readACLs.size());
-        assertTrue("Contains admins group", readACLs.contains(ADMINS));
-        assertTrue("Contains users group", readACLs.contains(USERS));
-    }
-
     protected AuthorizationMap createWildcardAuthorizationMap() {
         DefaultAuthorizationMap answer = new DefaultAuthorizationMap();
 


Mime
View raw message