Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5DFCC200B38 for ; Fri, 8 Jul 2016 17:51:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5CC69160A5A; Fri, 8 Jul 2016 15:51:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AD966160A78 for ; Fri, 8 Jul 2016 17:51:25 +0200 (CEST) Received: (qmail 53937 invoked by uid 500); 8 Jul 2016 15:51:24 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 53839 invoked by uid 99); 8 Jul 2016 15:51:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2016 15:51:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 709EFC6A53 for ; Fri, 8 Jul 2016 15:51:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.507 X-Spam-Level: X-Spam-Status: No, score=-4.507 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.287] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id GFmDKHa5vXlP for ; Fri, 8 Jul 2016 15:51:22 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id EAAE35FD2F for ; Fri, 8 Jul 2016 15:51:21 +0000 (UTC) Received: (qmail 53504 invoked by uid 99); 8 Jul 2016 15:51:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2016 15:51:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20A78DFFF8; Fri, 8 Jul 2016 15:51:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jinmeiliao@apache.org To: commits@geode.incubator.apache.org Date: Fri, 08 Jul 2016 15:51:21 -0000 Message-Id: <0d0976df1fac43289eca21d332ddfa0a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/50] [abbrv] incubator-geode git commit: GEODE-1571: security for removeAll archived-at: Fri, 08 Jul 2016 15:51:26 -0000 Repository: incubator-geode Updated Branches: refs/heads/develop ea48bd660 -> f8b620c63 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/develop Commit: e504d978d77bd545b3e73c82462b0dba73c82759 Parents: 8493cfe Author: Jinmei Liao Authored: Fri Jun 24 21:20:51 2016 -0700 Committer: Jinmei Liao 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();