You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2016/06/27 21:21:30 UTC

[40/50] [abbrv] incubator-geode git commit: GEODE-1571: security for removeAll

GEODE-1571: security for removeAll


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e504d978
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e504d978
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e504d978

Branch: refs/heads/feature/GEODE-1571
Commit: e504d978d77bd545b3e73c82462b0dba73c82759
Parents: 8493cfe
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Fri Jun 24 21:20:51 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Fri Jun 24 21:20:51 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/tier/sockets/command/RemoveAll.java       | 2 +-
 .../IntegratedClientRemoveAllAuthDistributedTest.java        | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e504d978/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RemoveAll.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RemoveAll.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RemoveAll.java
index 6ed5d2f..d04a585 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RemoveAll.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RemoveAll.java
@@ -210,7 +210,7 @@ public class RemoveAll extends BaseCommand {
         servConn.setRequestSpecificTimeout(timeout);
       }
 
-      GeodeSecurityUtil.authorizeDataWrite();
+      GeodeSecurityUtil.authorizeRegionWrite(regionName);
 
       AuthorizeRequest authzRequest = servConn.getAuthzRequest();
       if (authzRequest != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e504d978/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
index 527972c..edfbdd6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
@@ -35,17 +35,17 @@ public class IntegratedClientRemoveAllAuthDistributedTest extends AbstractIntegr
   public void testRemoveAll() throws InterruptedException {
 
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("dataReader", "1234567", serverPort, SecurityTestUtils.NO_EXCEPTION);
+      Cache cache = SecurityTestUtils.createCacheClient("authRegionReader", "1234567", serverPort, SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
-      assertNotAuthorized(() -> region.removeAll(Arrays.asList("key1", "key2", "key3", "key4")), "DATA:WRITE");
+      assertNotAuthorized(() -> region.removeAll(Arrays.asList("key1", "key2", "key3", "key4")), "DATA:WRITE:AuthRegion");
     });
 
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("dataUser", "1234567", serverPort, SecurityTestUtils.NO_EXCEPTION);
+      Cache cache = SecurityTestUtils.createCacheClient("authRegionWriter", "1234567", serverPort, SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
       region.removeAll(Arrays.asList("key1", "key2", "key3", "key4"));
       assertFalse(region.containsKey("key1"));
-      assertFalse(region.containsKeyOnServer("key1"));
+      assertNotAuthorized(()->region.containsKeyOnServer("key1"), "DATA:READ:AuthRegion:key1");
     });
     ai1.join();
     ai2.join();