[GitHub] incubator-geode issue #286: GEODE-2104: Fix parsing of options following --J

2016-11-15 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/286
  
LGTM. build it and start up gfsh and play with it with different options 
and see if it's not having some side effects. After that I can pull this in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/276
  
A few changes requested:

1. use Autowire to auto wire the RestSecurityService.
2. In your RestSecurityPostProcessorTest, considering only using 
"customers" region for readability. You don't needs all these "/" + REGION_NAME 
+"/key1" at all.
3. Then you can use a customer domain object specific PostProcessor to 
change the field values and assert for the value returned.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86920722
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/BaseControllerAdvice.java
 ---
@@ -50,6 +52,11 @@
 
   protected static final String REST_API_VERSION = "/v1";
 
+  public BaseControllerAdvice(final RestSecurityService securityService,
--- End diff --

use Autowire inside AbstractBaseController to auto wire the 
RestSecurityService instead of using constructors. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86920671
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"emai

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836374
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 ---
@@ -409,6 +435,34 @@ public Object postProcess(Object principal, String 
regionPath, Object key, Objec
 return newValue;
   }
 
+  private Object getPrincipal(Object principal) {
+if (principal == null) {
+  Subject subject = getSubject();
+  if (subject == null)
+return null;
+  principal = subject.getPrincipal();
+}
+return principal;
+  }
+
+  @Override
+  public Collection postProcess(Query query, Collection 
regionNames,
--- End diff --

remove this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86819415
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"email\":\"jelly.b...@ex

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836201
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/security/PostProcessor.java ---
@@ -44,6 +47,9 @@ default void init(Properties securityProps) {}
*/
   Object processRegionValue(Object principal, String regionName, Object 
key, Object value);
 
+  Collection processQueryResult(Object principal, Query query, 
Collection regions,
--- End diff --

I don't think we want to add this method in the interface. For query,  
essentially it's still getting value from region. Customers should not be 
burdened with another method to implement if they just want to manipulate the 
data. See how query result get post processed in gfsh queries. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836263
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
--- End diff --

remove this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86821510
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
--- End diff --

I think I just made a change in the rule that you don't need to call 
startServer anymore if you are using is as a rule.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836714
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/BaseControllerAdvice.java
 ---
@@ -50,6 +52,11 @@
 
   protected static final String REST_API_VERSION = "/v1";
 
+  public BaseControllerAdvice(final RestSecurityService securityService,
--- End diff --

do we need this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86820194
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"emai

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86822046
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"emai

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836287
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/SecurityService.java
 ---
@@ -87,6 +89,12 @@
   Object postProcess(Object principal, String regionPath, Object key, 
Object value,
   boolean valueIsSerialized);
 
+  Collection postProcess(Query query, Collection 
regionNames,
+  Collection results);
+
+  Collection postProcess(Object principal, Query query, 
Collection regionNames,
--- End diff --

remove this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86822375
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java
 ---
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for 
additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
ANY KIND, either express
+ * or implied. See the License for the specific language governing 
permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API;
+import static org.apache.geode.rest.internal.web.GeodeRestClient.getCode;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getContentType;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonArray;
+import static 
org.apache.geode.rest.internal.web.GeodeRestClient.getJsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.rest.internal.web.controllers.GetRegions;
+import org.apache.geode.security.templates.SamplePostProcessor;
+import org.apache.geode.security.templates.SampleSecurityManager;
+import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.apache.http.HttpResponse;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.http.MediaType;
+
+import java.net.URLEncoder;
+import java.util.Properties;
+
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class RestSecurityPostProcessorTest {
+
+  static final String REGION_NAME = "AuthRegion";
+
+  static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
+  static Properties properties = new Properties() {
+{
+  setProperty(SampleSecurityManager.SECURITY_JSON,
+  
"org/apache/geode/management/internal/security/clientServer.json");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
+  setProperty(START_DEV_REST_API, "true");
+  setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
+  setProperty(HTTP_SERVICE_PORT, restPort + "");
+  setProperty(SECURITY_POST_PROCESSOR, 
SamplePostProcessor.class.getName());
+}
+  };
+
+  @ClassRule
+  public static ServerStarterRule serverStarter = new 
ServerStarterRule(properties);
+  private final GeodeRestClient restClient = new 
GeodeRestClient("localhost", restPort);
+
+  @BeforeClass
+  public static void before() throws Exception {
+serverStarter.startServer();
+Region region =
+
serverStarter.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+region.put("key1",
+
"{\"@type\":\"com.gemstone.gemfire.web.rest.domain.Order\",\"purchaseOrderNo\":1121,\"customerId\":1012,\"description\":\"Order
 for  XYZ 
Corp\",\"orderDate\":\"02/10/2014\",\"deliveryDate\":\"02/20/2014\",\"contact\":\"Jelly
 
Bean\",\"emai

[GitHub] incubator-geode pull request #276: GEODE-1993: postprocess region/key

2016-11-07 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/276#discussion_r86836336
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 ---
@@ -409,6 +435,34 @@ public Object postProcess(Object principal, String 
regionPath, Object key, Objec
 return newValue;
   }
 
+  private Object getPrincipal(Object principal) {
+if (principal == null) {
+  Subject subject = getSubject();
+  if (subject == null)
+return null;
+  principal = subject.getPrincipal();
+}
+return principal;
+  }
+
+  @Override
+  public Collection postProcess(Query query, Collection 
regionNames,
+  Collection results) {
+return postProcess(null, query, regionNames, results);
+  }
+
+  @Override
+  public Collection postProcess(Object principal, Query query,
--- End diff --

remove this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #276: GEODE-1993: postprocess region/key

2016-10-28 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/276
  
A few things:
1. In your RestSecurityPostProcessorTest, in the before method, you can get 
ahold of the region you created and pre populate the regions with a few keys 
and values, this way, you don't need to worry about putting in values in your 
tests.
2. Looks like /{regions} end point also retrieves the values of the entire 
region, you need to post process the values there as well. 
3. query end points definitely return region values as well.
4. SecurityUtils.getSecurityService will definitely get the security 
service, but let's do it the spring way, I have a component called 
RestSecurityService, use that instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #273: Feature/geode 1983

2016-10-27 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/273#discussion_r85375614
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/SwaggerVerificationTest.java
 ---
@@ -42,6 +44,7 @@
   static Properties properties = new Properties() {
 {
   setProperty(START_DEV_REST_API, "true");
+  setProperty(SECURITY_MANAGER, SampleSecurityManager.class.getName());
--- End diff --

using SamplesecurityManager will require you to use a json file as well. 
Use SimpleSecurityManager instead. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #271: Feature/geode 2014

2016-10-25 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/271#discussion_r84983163
  
--- Diff: LICENSE ---
@@ -329,8 +302,6 @@ Apache Geode bundles the following files under the MIT 
license:
 Copyright (c) 2011 Sencha Inc.
   - jQuery JavaScript Library v1.7.2, v1.8.0 (https://jquery.com), 
Copyright (c)
--- End diff --

I believe you removed jquery1.8.0. jQuery 1.7.2 is used by pulse.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #271: Feature/geode 2014

2016-10-25 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/271#discussion_r84983273
  
--- Diff: geode-assembly/src/test/resources/expected_jars.txt ---
@@ -37,10 +37,6 @@ jline
 jna
--- End diff --

Why is this file change in this pull request? This change is already 
handled by your last pull request.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #265: GEODE-2014: Upgrade Swagger libraries

2016-10-21 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/265#discussion_r84500905
  
--- Diff: 
geode-assembly/src/test/java/org/apache/geode/rest/internal/web/SwaggerVerificationTest.java
 ---
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.rest.internal.web;
+
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.json.JSONObject;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+
+@Category(IntegrationTest.class)
+
+public class SwaggerVerificationTest extends AbstractRestTest {
+
+  @Test
+  public void isSwaggerRunning() throws Exception {
+// Check the UI
+HttpResponse response = doRequest(new 
HttpGet("/geode/swagger-ui.html"), "", "");
+assertThat(getCode(response), is(200));
+
+// Check the JSON
+response = doRequest(new HttpGet("/geode/v2/api-docs"), "", "");
--- End diff --

Just curious, why this is geode/v2, but all the api is still geode/v1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #265: GEODE-2014: Upgrade Swagger libraries

2016-10-21 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/265#discussion_r84501406
  
--- Diff: 
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/FunctionAccessController.java
 ---
@@ -93,8 +93,7 @@ protected String getRestApiVersion() {
   response = void.class
   )
   @ApiResponses({
-  @ApiResponse(code = 200, message = "OK."),
-  @ApiResponse( code = 401, message = "Invalid Username or Password." 
),
+  @ApiResponse(code = 200, message = "OK."), @ApiResponse(code = 401, 
message = "Invalid Username or Password."),
--- End diff --

use the old fomat?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #256: Feature/geode 1532

2016-10-11 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/256#discussion_r82900400
  
--- Diff: geode-pulse/src/main/webapp/WEB-INF/spring-security.xml ---
@@ -20,15 +20,14 @@
xmlns:context="http://www.springframework.org/schema/context;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation="http://www.springframework.org/schema/beans
-   http://www.springframework.org/schema/beans/spring-beans.xsd
+   http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
--- End diff --

We should use versionless xsd.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #256: Feature/geode 1532

2016-10-11 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/256#discussion_r82900331
  
--- Diff: geode-pulse/build.gradle ---
@@ -68,6 +68,11 @@ dependencies {
   testCompile project(':geode-core')
   testCompile files(project(':geode-core').sourceSets.test.output)
 
+  testCompile(group: 'com.codeborne', name: 'phantomjsdriver', version: 
project.'phantomjsdriver.version') {
+  exclude module: 'selenium-remote-driver' //by artifact name
+  exclude module: 'selenium-java' //by artifact name
+  }
+
   testCompile 'org.seleniumhq.selenium:selenium-firefox-driver:' + 
project.'selenium.version'
--- End diff --

If we are not using firefox driver anymore, we can take this out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #254: Feature/geode 999

2016-10-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/254
  
Have we decided whether we want to put uiTest in precheckin or start a new 
pipeline?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #251: Feature/geode 1570

2016-10-05 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/251
  
This is pulled into realase/1.0.0.incubating branch, but somehow github is 
not watching the checkin on that branch to close this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #254: Feature/geode 999

2016-10-05 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/254#discussion_r82066319
  
--- Diff: 
geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/PulseAbstractTest.java
 ---
@@ -166,18 +197,28 @@ public static void setUpServer(String username, 
String password, String jsonAuth
 passwordElement.submit();
 
 Thread.sleep(3000);
-WebElement userNameOnPulsePage = (new WebDriverWait(driver, 10))
-  .until(new ExpectedCondition() {
-@Override
-public WebElement apply(WebDriver d) {
-  return d.findElement(By.id("userName"));
-}
-  });
+WebElement userNameOnPulsePage = (new WebDriverWait(driver, 
10)).until(new ExpectedCondition() {
+  @Override
+  public WebElement apply(WebDriver d) {
+return d.findElement(By.id("userName"));
+  }
+});
 assertNotNull(userNameOnPulsePage);
 driver.navigate().refresh();
 Thread.sleep(7000);
   }
 
+  private static void setUpWebDriver() {
+DesiredCapabilities capabilities = new DesiredCapabilities();
+capabilities.setJavascriptEnabled(true);
+capabilities.setCapability("takesScreenshot", true);
--- End diff --

Let's not take the screen shots.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #254: Feature/geode 999

2016-10-05 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/254#discussion_r82065904
  
--- Diff: .gitignore ---
@@ -13,6 +13,8 @@ build/
 build-eclipse/
--- End diff --

do we need to checkin this file?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #254: Feature/geode 999

2016-10-05 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/254#discussion_r82066044
  
--- Diff: 
geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/PulseAbstractTest.java
 ---
@@ -136,6 +146,29 @@
 
   private static final DecimalFormat df2 = new 
DecimalFormat(PulseConstants.DECIMAL_FORMAT_PATTERN);
 
+  @Rule
+  public TestRule testWatcher = new TestWatcher() {
+@Override
+public void failed(Throwable t, Description test) {
+  takeScreenshot(test.getDisplayName());
+}
+  };
+
+  @Rule
+  public RetryRule retryRule = new RetryRule(5);
+
+  public void takeScreenshot(String screenshotName) {
--- End diff --

do we need to take screenshots?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #250: Feature/geode 1948

2016-10-04 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/250#discussion_r81788504
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java ---
@@ -156,7 +166,14 @@ protected static Properties 
loadGemFireProperties(final URL url) {
 
 if (url != null) {
   try {
-properties.load(new FileReader(new File(url.toURI(;
+File propertyFile = new File(url.toURI());
--- End diff --

This url is resolved by using gemfire.properties as default already. See 
DistributedSystem.getPropertiesFileURL(). So if gemfirePropertiesFile is not 
defined as a system property, it will use "gemfire.properties" first. We need 
to add another constant as GEODE_PREFIX in distribution config if we can not 
totally replace the GEMFIRE_PREFIX.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #250: Feature/geode 1948

2016-09-30 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/250#discussion_r81417136
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java ---
@@ -156,7 +166,14 @@ protected static Properties 
loadGemFireProperties(final URL url) {
 
 if (url != null) {
   try {
-properties.load(new FileReader(new File(url.toURI(;
+File propertyFile = new File(url.toURI());
--- End diff --

We need to have integration test for this change as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #250: Feature/geode 1948

2016-09-30 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/250#discussion_r81416934
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java ---
@@ -156,7 +166,14 @@ protected static Properties 
loadGemFireProperties(final URL url) {
 
 if (url != null) {
   try {
-properties.load(new FileReader(new File(url.toURI(;
+File propertyFile = new File(url.toURI());
--- End diff --

I believe the url is still resolved using gemfire.properties. Not sure if 
this change is effective.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #248: GEODE-1548: Specifying --J=-Dgemfire.jmx-manager...

2016-09-30 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/248
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #240: GEODE-1899: Renamed the custom 'clean' task to w...

2016-09-15 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/240
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #228: GEODE-1673: Use security.json as default

2016-08-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/228#discussion_r73898883
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/security/templates/SampleSecurityManagerTest.java
 ---
@@ -65,6 +65,16 @@ public void setUp() throws Exception {
   }
 
   @Test
+  public void shouldDefaultToSecurityJsonInClasspathIfNullProperties() 
throws Exception {
+this.sampleSecurityManager.init(null);
+  }
+
+  @Test
+  public void shouldDefaultToSecurityJsonInClasspathIfEmptyProperties() 
throws Exception {
+this.sampleSecurityManager.init(new Properties());
--- End diff --

add some asserts here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #228: GEODE-1673: Use security.json as default

2016-08-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/228#discussion_r73898764
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
 ---
@@ -126,26 +126,33 @@ public boolean authorize(final Principal principal, 
final ResourcePermission con
 
   @Override
   public void init(final Properties securityProperties) throws 
NotAuthorizedException {
-String jsonPropertyValue = 
securityProperties.getProperty(SECURITY_JSON);
+boolean initialized = false;
+
+String jsonPropertyValue = securityProperties != null ? 
securityProperties.getProperty(SECURITY_JSON) : null;
 if (jsonPropertyValue == null) {
-  throw new AuthenticationFailedException("SampleSecurityManager: 
property [" + SECURITY_JSON + "] must be set.");
-}
+  initialized = initializeFromJsonResource(DEFAULT_JSON_FILE_NAME);
+} else {
 
-// 1st try to load value as a json resource
-boolean initialized = initializeFromJsonResource(jsonPropertyValue);
+  // 1st try to load value as a json resource
+  initialized = initializeFromJsonResource(jsonPropertyValue);
 
-// 2nd try to load value as a json file
-if (!initialized) {
-  initialized = initializeFromJsonFile(new File(jsonPropertyValue));
-}
+  // 2nd try to load value as a json file
--- End diff --

Do we really need the 2nd try and 3rd try? We don't use 
SampleSeucurityManager this way. If we can get rid these additional tries, then 
the init could be simple as this:

String jsonPropertyValue = securityProperties.getProperty(SECURITY_JSON);
if(jsonPropertyValue == null) jsonPropertyValue = DEFAULT_JSON_FILE_NAME;
if(!initializeFromJsonResource(jsonPropertyValue)){
  // throw exception
}



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #228: GEODE-1673: Use security.json as default

2016-08-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/228#discussion_r73898847
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/security/templates/SampleSecurityManagerTest.java
 ---
@@ -65,6 +65,16 @@ public void setUp() throws Exception {
   }
 
   @Test
+  public void shouldDefaultToSecurityJsonInClasspathIfNullProperties() 
throws Exception {
+this.sampleSecurityManager.init(null);
--- End diff --

should we add some asserts here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #227: Rename servlet URLs from gemfire to geode

2016-08-04 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/227
  
+1. I'll pull this in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #223: GEODE-1712: introduce SecurityService and...

2016-08-02 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/223#discussion_r73215457
  
--- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/internal/security/IntegratedSecurityService.java
 ---
@@ -0,0 +1,164 @@
+package com.gemstone.gemfire.internal.security;
+
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+import org.apache.geode.security.ResourcePermission;
+import org.apache.geode.security.SecurityManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.util.ThreadState;
+
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.security.ResourceOperation;
+
+public class IntegratedSecurityService implements SecurityService {
+
+  private static Logger logger = 
LogService.getLogger(LogService.SECURITY_LOGGER_NAME);
+
+  private static SecurityService defaultInstance = new 
IntegratedSecurityService();
+
--- End diff --

Can someone just call new IntegratedSecurityService()? If so, probably just 
create a private constructor here to prevent that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #224: GEODE-1648: Introduce security-enabled-co...

2016-08-02 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/224#discussion_r73213204
  
--- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
 ---
@@ -509,8 +510,7 @@ private void registerAccessControlMBean() {
 
 
   private boolean isIntegratedSecurity() {
--- End diff --

We can get rid of this method. I believe this is called to check if we need 
to enabled pulse security in the same file as well. Yeah, what about pulse 
security? Do we need to add another enum or just say if jmx is enabled. pulse 
should be enabled as well?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #224: GEODE-1648: Introduce security-enabled-co...

2016-08-02 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/224#discussion_r73212878
  
--- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
 ---
@@ -447,8 +449,7 @@ public synchronized void start() throws IOException {
   }
 };
 
-String shiroConfig = this.config.getShiroInit();
-if (! StringUtils.isBlank(shiroConfig) || isIntegratedSecurity()) {
+if (isIntegratedSecurity()) {
--- End diff --

probably be easier to read if it just read "if 
(GeodeSecurityUtil.isJmxSecurityEnabled())" here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #224: GEODE-1648: Introduce security-enabled-co...

2016-08-02 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/224#discussion_r73211230
  
--- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
 ---
@@ -471,16 +499,27 @@ public static PostProcessor getPostProcessor() {
 return postProcessor;
   }
 
-  public static boolean isClientSecurityRequired() {
-return isClientAuthenticator || isIntegratedSecurity;
+  public static boolean isIntegratedSecurity(){
--- End diff --

We can get rid of this public method now. I believe now all the other 
components are just using component specific security enabled function.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #224: GEODE-1648: Introduce security-enabled-co...

2016-08-02 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/224#discussion_r73207985
  
--- Diff: 
geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
 ---
@@ -498,6 +502,29 @@ protected String checkRedisBindAddress(String value) {
 return value;
   }
 
+  /**
+   * First check if sslComponents are in the list of valid components. If 
so, check that no other *-ssl-* properties other than cluster-ssl-* are set.
--- End diff --

comments need to be changed here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #214: GEODE-1680: Change "list regions" to DATA:READ p...

2016-07-21 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/214
  
+1. I'll pull this in


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #210: GEODE-1647: Add Integrated Security to Peer Auth...

2016-07-20 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/210
  
I rebased it, and rewrite the GMSAuthenticator. The review is here:
https://reviews.apache.org/r/50245/


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #210: GEODE-1647: Add Integrated Security to Peer Auth...

2016-07-19 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/210
  
I'll rebase this onto the current develop, and handle the PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #207: GEODE-1647: Add Integrated Security to Peer Auth...

2016-07-14 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/207
  
this seems to have some conflict with the current develop branch. Please 
rebase again.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #201: GEODE-1617: Regions can be created with a variet...

2016-07-14 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/201
  
I think it's probably safe to get the storage team involved to review this 
PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #198: GEODE-1571: Create no argument constructor for S...

2016-07-12 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/198
  
I'll handle this PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #193: GEODE-1646: repackage new Security classes in or...

2016-07-08 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/193
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request #192: GEODE-1571: Write DUnit test for Security...

2016-07-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/192#discussion_r70114470
  
--- Diff: 
geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedSecurityCacheLifecycleDistributedTest.java
 ---
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.security;
+
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.security.Principal;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
+import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
+
+import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Spy;
+
+@Category({DistributedTest.class, SecurityTest.class})
+public class IntegratedSecurityCacheLifecycleDistributedTest extends 
JUnit4CacheTestCase {
+
+  private static SpySecurityManager spySecurityManager;
+
+  private VM locator;
+
+  @Override
+  public final void postSetUp() throws Exception {
+Host host = Host.getHost(0);
+locator = host.getVM(0);
+JSONAuthorization.setUpWithJsonFile("clientServer.json");
+int locatorPort = 
AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+String locators =  NetworkUtils.getServerHostName(host) + "[" + 
locatorPort + "]";
+
+spySecurityManager = new SpySecurityManager();
+
+locator.invoke(() -> {
+  spySecurityManager = new SpySecurityManager();
+  DistributedTestUtils.deleteLocatorStateFile(locatorPort);
+
+  final Properties properties = new Properties();
+  properties.setProperty(MCAST_PORT, "0");
+  properties.setProperty(START_LOCATOR, locators);
+  properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+  properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+  getSystem(properties);
+  getCache();
+});
+
+final Properties properties = new Properties();
+properties.setProperty(MCAST_PORT, "0");
+properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+properties.setProperty(LOCATORS, locators);
+properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+getSystem(properties);
+
+CacheServer server1 = getCache().addCacheServer();
+server1.setPort(0);
+server1.start();
+
+getCache();
+  }
+
+  @Test
+  public void initAndCloseTest () {
+locator.invoke(() -> {
+  verifyInitInvoked();
+});
+verifyInitInvoked();
+getCache().close();
+verifyCloseInvoked();
+locator.invoke(() -> {
+  getCache().close();
--- End diff --

Can we put all t

[GitHub] incubator-geode pull request #192: GEODE-1571: Write DUnit test for Security...

2016-07-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/192#discussion_r70114209
  
--- Diff: 
geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedSecurityCacheLifecycleDistributedTest.java
 ---
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.security;
+
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.security.Principal;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
+import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
+
+import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Spy;
+
+@Category({DistributedTest.class, SecurityTest.class})
+public class IntegratedSecurityCacheLifecycleDistributedTest extends 
JUnit4CacheTestCase {
+
+  private static SpySecurityManager spySecurityManager;
+
+  private VM locator;
+
+  @Override
+  public final void postSetUp() throws Exception {
+Host host = Host.getHost(0);
+locator = host.getVM(0);
+JSONAuthorization.setUpWithJsonFile("clientServer.json");
+int locatorPort = 
AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+String locators =  NetworkUtils.getServerHostName(host) + "[" + 
locatorPort + "]";
+
+spySecurityManager = new SpySecurityManager();
+
+locator.invoke(() -> {
+  spySecurityManager = new SpySecurityManager();
+  DistributedTestUtils.deleteLocatorStateFile(locatorPort);
+
+  final Properties properties = new Properties();
+  properties.setProperty(MCAST_PORT, "0");
+  properties.setProperty(START_LOCATOR, locators);
+  properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+  properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+  getSystem(properties);
+  getCache();
+});
+
+final Properties properties = new Properties();
+properties.setProperty(MCAST_PORT, "0");
+properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+properties.setProperty(LOCATORS, locators);
+properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+getSystem(properties);
+
+CacheServer server1 = getCache().addCacheServer();
+server1.setPort(0);
+server1.start();
+
+getCache();
+  }
+
+  @Test
+  public void initAndCloseTest () {
+locator.invoke(() -> {
+  verifyInitInvoked();
+});
+verifyInitInvoked();
+getCache().close();
+verifyCloseInvoked();
+locator.invoke(() -> {
+  getCache().close();
+  verifyCloseInvoked();
+   

[GitHub] incubator-geode pull request #192: GEODE-1571: Write DUnit test for Security...

2016-07-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/192#discussion_r70114133
  
--- Diff: 
geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedSecurityCacheLifecycleDistributedTest.java
 ---
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.security;
+
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.security.Principal;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
+import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
+
+import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Spy;
+
+@Category({DistributedTest.class, SecurityTest.class})
+public class IntegratedSecurityCacheLifecycleDistributedTest extends 
JUnit4CacheTestCase {
+
+  private static SpySecurityManager spySecurityManager;
+
+  private VM locator;
+
+  @Override
+  public final void postSetUp() throws Exception {
+Host host = Host.getHost(0);
+locator = host.getVM(0);
+JSONAuthorization.setUpWithJsonFile("clientServer.json");
+int locatorPort = 
AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+String locators =  NetworkUtils.getServerHostName(host) + "[" + 
locatorPort + "]";
+
+spySecurityManager = new SpySecurityManager();
+
+locator.invoke(() -> {
+  spySecurityManager = new SpySecurityManager();
+  DistributedTestUtils.deleteLocatorStateFile(locatorPort);
+
+  final Properties properties = new Properties();
+  properties.setProperty(MCAST_PORT, "0");
+  properties.setProperty(START_LOCATOR, locators);
+  properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+  properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+  getSystem(properties);
+  getCache();
+});
+
+final Properties properties = new Properties();
+properties.setProperty(MCAST_PORT, "0");
+properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+properties.setProperty(LOCATORS, locators);
+properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+getSystem(properties);
+
+CacheServer server1 = getCache().addCacheServer();
+server1.setPort(0);
+server1.start();
+
+getCache();
+  }
+
+  @Test
+  public void initAndCloseTest () {
+locator.invoke(() -> {
+  verifyInitInvoked();
+});
+verifyInitInvoked();
+getCache().close();
+verifyCloseInvoked();
+locator.invoke(() -> {
+  getCache().close();
+  verifyCloseInvoked();
+   

[GitHub] incubator-geode pull request #192: GEODE-1571: Write DUnit test for Security...

2016-07-08 Thread jinmeiliao
Github user jinmeiliao commented on a diff in the pull request:

https://github.com/apache/incubator-geode/pull/192#discussion_r70113962
  
--- Diff: 
geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedSecurityCacheLifecycleDistributedTest.java
 ---
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.security;
+
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.security.Principal;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
+import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
+
+import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Spy;
+
+@Category({DistributedTest.class, SecurityTest.class})
+public class IntegratedSecurityCacheLifecycleDistributedTest extends 
JUnit4CacheTestCase {
+
+  private static SpySecurityManager spySecurityManager;
+
+  private VM locator;
+
+  @Override
+  public final void postSetUp() throws Exception {
+Host host = Host.getHost(0);
+locator = host.getVM(0);
+JSONAuthorization.setUpWithJsonFile("clientServer.json");
+int locatorPort = 
AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+String locators =  NetworkUtils.getServerHostName(host) + "[" + 
locatorPort + "]";
+
+spySecurityManager = new SpySecurityManager();
+
+locator.invoke(() -> {
+  spySecurityManager = new SpySecurityManager();
+  DistributedTestUtils.deleteLocatorStateFile(locatorPort);
+
+  final Properties properties = new Properties();
+  properties.setProperty(MCAST_PORT, "0");
+  properties.setProperty(START_LOCATOR, locators);
+  properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+  properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+  getSystem(properties);
+  getCache();
+});
+
+final Properties properties = new Properties();
+properties.setProperty(MCAST_PORT, "0");
+properties.setProperty(SECURITY_MANAGER, 
SpySecurityManager.class.getName()+".create");
+properties.setProperty(LOCATORS, locators);
+properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+getSystem(properties);
+
+CacheServer server1 = getCache().addCacheServer();
+server1.setPort(0);
+server1.start();
+
+getCache();
+  }
+
+  @Test
+  public void initAndCloseTest () {
+locator.invoke(() -> {
+  verifyInitInvoked();
+});
+verifyInitInvoked();
+getCache().close();
+verifyCloseInvoked();
+locator.invoke(() -> {
+  getCache().close();
+  verifyCloseInvoked();
+   

[GitHub] incubator-geode issue #190: Feature/geode 11 gfsh commands

2016-07-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/190
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #183: GEODE-1615: gfsh unable to destroy region that h...

2016-07-01 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/183
  
For now, add at least a test that would cover deleting a region that has 
"-" and "_" in it. Later, you can expand your tests that would have all sorts 
of allowed characters.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #183: GEODE-1615: gfsh unable to destroy region that h...

2016-06-30 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/183
  
the fix looks good. Where is the test?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #170: GEODE-1575 - Unhandled NoClassDefFound Exception...

2016-06-21 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/170
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #161: GEODE-1549: Correct "Help" hyperlink in pulse

2016-06-21 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/161
  
I'll pull this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #166: GEODE-117 - gfsh put ignores --skip-if-exists fl...

2016-06-21 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/166
  
+1. I'll pull this in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #161: GEODE-1549: Correct "Help" hyperlink in pulse

2016-06-16 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/161
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #153: GEODE-745: add include-locator parameter in the ...

2016-06-08 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/153
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #151: GEODE-744: Incorrect use of APP_FETCH_SIZE in GF...

2016-06-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/151
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #151: GEODE-744: Incorrect use of APP_FETCH_SIZE in GF...

2016-06-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/151
  
Not sure if this works, the example it gives are those queries
echo "query --query=\"select count(*) from /replicatedRegion.keySet\"" >> 
query_region.gfsh
echo "query --query=\"SELECT COUNT(*) FROM /replicatedRegion.keySet\"" >> 
query_region.gfsh

would count() be the same as count(*)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #151: GEODE-744: Incorrect use of APP_FETCH_SIZE in GF...

2016-06-07 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/151
  
I don't think this would fix the problem. The problem is that the following 
two queries would return different results. Your change would still make them 
do that.

query --query=\"select count(*) from /replicatedRegion.keySet\"
query --query=\"SELECT COUNT(*) FROM /replicatedRegion.keySet\"

I believe what Jens suggests is to convert the query string to 
lowercase/uppercase first and then checks for "contains" limit or count.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode issue #150: Feature/geode 308

2016-06-02 Thread jinmeiliao
Github user jinmeiliao commented on the issue:

https://github.com/apache/incubator-geode/pull/150
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-511 Pulse: Residual 'Gemfire' ...

2016-03-08 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/111#issuecomment-193958882
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: Fix typos in gfsh help. [fixes #1141...

2016-02-22 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/99#issuecomment-187281359
  
I'll pull this in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-901: Remove invalid source hea...

2016-02-16 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/94#issuecomment-184875550
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-852: refactor gemfire-pulse no...

2016-01-27 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/80

GEODE-852: refactor gemfire-pulse not to generate a pulseverion.prope…

…rties file but copy it from gemfire-core

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-852

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/80.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #80


commit a1b922c97e076553c95693d5e4cf223df9be4bfb
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2016-01-27T17:18:35Z

GEODE-852: refactor gemfire-pulse not to generate a pulseverion.properties 
file but copy it from gemfire-core




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-852: refactor gemfire-pulse no...

2016-01-27 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/80#issuecomment-175766150
  
To avoid confusion, do not rename the properties file copied from 
gemfire-core


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-852: refactor gemfire-pulse no...

2016-01-27 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/80#issuecomment-175786454
  
Good point. Will create another pull request for this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-852: copyPulsePropFile needs t...

2016-01-27 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/81

GEODE-852: copyPulsePropFile needs to make sure gemfire-core builds f…

…irst

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-852

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/81.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #81


commit 8c442733126989b38539fb300598131ca7db073e
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2016-01-27T18:45:47Z

GEODE-852: copyPulsePropFile needs to make sure gemfire-core builds first




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-854: refactor gemfire-pulse no...

2016-01-26 Thread jinmeiliao
Github user jinmeiliao closed the pull request at:

https://github.com/apache/incubator-geode/pull/78


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-854: refactor gemfire-pulse no...

2016-01-26 Thread jinmeiliao
Github user jinmeiliao commented on the pull request:

https://github.com/apache/incubator-geode/pull/78#issuecomment-175088490
  
this fix needs a dependency in gemfire-core. Will not use this fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-12: license file update

2016-01-22 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/75

GEODE-12: license file update



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-12

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/75.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #75


commit ea2ec2e14d9bf41149ce2665ffdd4061ee57faa2
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2016-01-22T17:24:58Z

GEODE-12: license file update




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-749: refactor the code to look...

2016-01-19 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/73

GEODE-749: refactor the code to look for the war file in multiple pla…

…ces w/o version number and look for them in the classpath as well.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-749

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/73.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #73


commit dbdea31e0f8799775e68e04af0b92038d26121b7
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2016-01-19T23:16:06Z

GEODE-749: refactor the code to look for the war file in multiple places 
w/o version number and look for them in the classpath as well.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-401: upgrade log4j from 2.1 to...

2016-01-06 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/67

GEODE-401: upgrade log4j from 2.1 to 2.5. Remove our own configuratio…

…n watcher since log4j now has an almost the same implementation.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-401

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/67.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #67


commit ff34c46350bf1b06258c2b0af258dbd8732a91a7
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2016-01-06T17:02:44Z

GEODE-401: upgrade log4j from 2.1 to 2.5. Remove our own configuration 
watcher since log4j now has an almost the same implementation.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-649: add more logging to see t...

2015-12-22 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/64

GEODE-649: add more logging to see the reason of future failure.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-649

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/64.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #64


commit 34e2bb8c3c0b0bd532b8b50854ca00f935e5e1eb
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-12-22T16:38:29Z

GEODE-649: add more logging to see the reason of future failure.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-568: wait at most 5 seconds be...

2015-12-14 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/59

GEODE-568: wait at most 5 seconds before checking the size of the int…

…ernal region to allow eviction to complete

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-568

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/59.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #59


commit d58588a44a536c12adf0c5dcb64beda06b18e1f3
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-12-14T23:14:15Z

GEODE-568: wait at most 5 seconds before checking the size of the internal 
region to allow eviction to complete




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: Feature/geode 663: adding more secur...

2015-12-11 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/58

Feature/geode 663: adding more security test code into open source



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-663

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/58.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #58


commit 29dc5a1456ad3160f6f2176afb0cd74cb5d28569
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-12-10T23:14:19Z

GEM-164: move the security tests in gemfire-test module inside the 
com.gemstone.gemfire.security packages to the open side.

GEM-164: remove the pivotal license header

GEM-164: add ASF license headers and have RAT ignore all subprojects' IDE 
files when checking license

GEM-164: remove the duplicate license

commit e231ea0db40af1d1dca6a1ede16467eb109b39b7
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-12-11T23:27:50Z

GEODE-663: add aditional security tests to the open source




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: Feature/gem 164: move security tests...

2015-12-11 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/56

Feature/gem 164: move security tests from closed to open and remove pivotal 
license and use ASF license

…ompilation erros

Closes #34

(cherry picked from commit 058aad3663cb00de3ac83f76b9c9b72a32952ca3)
Signed-off-by: Jinmei Liao <jil...@pivotal.io>

GEODE-543: update jline lib and fix compilation errors

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-543

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/56.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #56


commit a0e48a3ef753e2e76ee6331ccaa97d8a9a58005c
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-11-11T20:06:22Z

GEODE-543: upgrade the Jline and Spring Shell libraries and fix the 
compilation erros

Closes #34

(cherry picked from commit 058aad3663cb00de3ac83f76b9c9b72a32952ca3)
Signed-off-by: Jinmei Liao <jil...@pivotal.io>

GEODE-543: update jline lib and fix compilation errors




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: Feature/gem 164: move security tests...

2015-12-11 Thread jinmeiliao
Github user jinmeiliao closed the pull request at:

https://github.com/apache/incubator-geode/pull/56


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEM-164: move the security tests in ...

2015-12-10 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/52

GEM-164: move the security tests in gemfire-test module inside the co…

…m.gemstone.gemfire.security packages to the open side.

and related resource files

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEM-164

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/52.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #52


commit 841cdf1283362d43fd855cb55979530c95db5705
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-12-10T23:14:19Z

GEM-164: move the security tests in gemfire-test module inside the 
com.gemstone.gemfire.security packages to the open side.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-390: removing PartitionManager...

2015-11-18 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/37

GEODE-390: removing PartitionManager and related tests



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-390

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/37.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #37


commit 4a07f458283a493563cbbc9caedade18774a0fae
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-11-18T17:33:28Z

GEODE-390: removing PartitionManager and related tests




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-543: upgrade the Jline and Spr...

2015-11-12 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/34

GEODE-543: upgrade the Jline and Spring Shell libraries and fix the c…

…ompilation erros

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode feature/GEODE-543

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/34.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #34


commit 7e239f303a32e56816e8c7f96778ad4b79b46775
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-11-11T20:06:22Z

GEODE-543: upgrade the Jline and Spring Shell libraries and fix the 
compilation erros




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-geode pull request: GEODE-516: increase the trylock time...

2015-11-06 Thread jinmeiliao
GitHub user jinmeiliao opened a pull request:

https://github.com/apache/incubator-geode/pull/31

GEODE-516: increase the trylock timeout to make sure the deadlock wou…

…ld happen.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinmeiliao/incubator-geode develop

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-geode/pull/31.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #31


commit 4103c1eb1e130a47da840e0be632b74cca47a8ad
Author: Jinmei Liao <jil...@pivotal.io>
Date:   2015-11-06T17:34:07Z

GEODE-516: increase the trylock timeout to make sure the deadlock would 
happen.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---