You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2016/06/02 00:08:50 UTC

[64/67] [abbrv] incubator-geode git commit: GEODE-1377: Initial move of system properties from private to public

GEODE-1377: Initial move of system properties from private to public


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

Branch: refs/heads/develop
Commit: 07ba2864f4cbdb5f44ecf3e6b54da8feaa890cec
Parents: 690ca40
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Wed Jun 1 20:22:59 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Thu Jun 2 10:01:42 2016 +1000

----------------------------------------------------------------------
 .../internal/security/JSONAuthorization.java    | 26 ++------------------
 .../internal/security/MultiUserDUnitTest.java   |  4 +--
 2 files changed, 4 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/07ba2864/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
index 2582bc1..8893a99 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
@@ -43,26 +43,6 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.StreamSupport;
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.operations.OperationContext;
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.security.AccessControl;
-import com.gemstone.gemfire.security.AuthenticationFailedException;
-import com.gemstone.gemfire.security.Authenticator;
-import com.gemstone.gemfire.security.NotAuthorizedException;
-import com.gemstone.gemfire.util.test.TestUtil;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import javax.management.remote.JMXPrincipal;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.*;
 
 import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.*;
 
@@ -116,10 +96,8 @@ public class JSONAuthorization implements AccessControl, Authenticator {
         user.pwd = user.name;
       }
 
-      JSONArray ops = obj.getJSONArray(ROLES);
-      for (int j = 0; j < ops.length(); j++) {
-        String roleName = ops.getString(j);
-        user.roles.add(roleMap.get(roleName));
+      for (JsonNode r : u.get(ROLES)) {
+        user.roles.add(roleMap.get(r.asText()));
       }
       acl.put(user.name, user);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/07ba2864/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/MultiUserDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/MultiUserDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/MultiUserDUnitTest.java
index 010db07..c20f5df 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/MultiUserDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/MultiUserDUnitTest.java
@@ -51,8 +51,8 @@ public class MultiUserDUnitTest extends CliCommandTestBase {
   public void testMultiUser() throws IOException, JSONException, InterruptedException {
     Properties properties = new Properties();
     properties.put(NAME, MultiUserDUnitTest.class.getSimpleName());
-    properties.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, JSONAuthorization.class.getName() + ".create");
-    properties.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, JSONAuthorization.class.getName() + ".create");
+    properties.put(SECURITY_CLIENT_AUTHENTICATOR, JSONAuthorization.class.getName() + ".create");
+    properties.put(SECURITY_CLIENT_ACCESSOR, JSONAuthorization.class.getName() + ".create");
 
     // set up vm_0 the secure jmx manager
     Object[] results = setUpJMXManagerOnVM(0, properties, "cacheServer.json");