geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [39/50] [abbrv] incubator-geode git commit: GEODE-1571: security for containsKey
Date Mon, 27 Jun 2016 21:21:29 GMT
GEODE-1571: security for containsKey


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

Branch: refs/heads/feature/GEODE-1571
Commit: 8493cfee52cb2b2e5e4577a1de120d55d4806258
Parents: 4ac886e
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Fri Jun 24 21:06:33 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Fri Jun 24 21:06:33 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/tier/sockets/command/ContainsKey.java       | 2 +-
 .../internal/cache/tier/sockets/command/ContainsKey66.java     | 2 +-
 .../IntegratedClientContainsKeyAuthDistributedTest.java        | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8493cfee/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey.java
index 3692fda..10a9067 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey.java
@@ -117,7 +117,7 @@ public class ContainsKey extends BaseCommand {
       return;
     }
 
-    GeodeSecurityUtil.authorizeDataRead();
+    GeodeSecurityUtil.authorizeRegionRead(regionName, key.toString());
 
     AuthorizeRequest authzRequest = servConn.getAuthzRequest();
     if (authzRequest != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8493cfee/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey66.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey66.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey66.java
index 5f11033..1d6c52d 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey66.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/ContainsKey66.java
@@ -120,7 +120,7 @@ public class ContainsKey66 extends BaseCommand {
       return;
     }
 
-    GeodeSecurityUtil.authorizeDataRead();
+    GeodeSecurityUtil.authorizeRegionRead(regionName, key.toString());
 
     AuthorizeRequest authzRequest = servConn.getAuthzRequest();
     if (authzRequest != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8493cfee/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
index 093d1ae..87535db 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
@@ -33,16 +33,16 @@ public class IntegratedClientContainsKeyAuthDistributedTest extends AbstractInte
   public void testContainsKey() throws InterruptedException {
 
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("dataReader", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
+      Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
       assertTrue(region.containsKeyOnServer("key1"));
+      assertNotAuthorized(() -> region.containsKeyOnServer("key3"), "DATA:READ:AuthRegion:key3");
     });
 
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
       Cache cache = SecurityTestUtils.createCacheClient("authRegionReader", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
-
-      assertNotAuthorized(() -> region.containsKeyOnServer("key3"), "DATA:READ");
+      region.containsKeyOnServer("key3");
     });
     ai1.join();
     ai2.join();


Mime
View raw message