geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [32/50] [abbrv] incubator-geode git commit: GEODE-1571: rename ExternalSecurity to IntegratedSecurity
Date Fri, 08 Jul 2016 15:51:52 GMT
GEODE-1571: rename ExternalSecurity to IntegratedSecurity


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

Branch: refs/heads/develop
Commit: 44b1f79b7733525bacdb3a5551e239c349657e08
Parents: b37f439
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Fri Jul 1 10:03:21 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Fri Jul 1 10:03:21 2016 -0700

----------------------------------------------------------------------
 .../internal/security/GeodeSecurityUtil.java    | 10 +++---
 .../security/shiro/CustomAuthRealm.java         | 12 ++++----
 .../gemfire/security/CustomSecurity.java        | 32 --------------------
 .../gemfire/security/IntegratedSecurity.java    | 32 ++++++++++++++++++++
 .../templates/SampleJsonAuthorization.java      |  4 +--
 5 files changed, 45 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b1f79b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
index 3a4edef..20507c7 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/GeodeSecurityUtil.java
@@ -49,7 +49,7 @@ import com.gemstone.gemfire.internal.security.shiro.ShiroPrincipal;
 import com.gemstone.gemfire.management.internal.security.ResourceOperation;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 import com.gemstone.gemfire.security.AuthenticationRequiredException;
-import com.gemstone.gemfire.security.CustomSecurity;
+import com.gemstone.gemfire.security.IntegratedSecurity;
 import com.gemstone.gemfire.security.GemFireSecurityException;
 import com.gemstone.gemfire.security.GeodePermission;
 import com.gemstone.gemfire.security.GeodePermission.Operation;
@@ -313,9 +313,9 @@ public class GeodeSecurityUtil {
       SecurityUtils.setSecurityManager(securityManager);
     }
 
-    // only set up shiro realm if user has implemented CustomSecurity
-    else if (authenticatorObject != null && authenticatorObject instanceof CustomSecurity)
{
-      CustomSecurity authenticator = (CustomSecurity) authenticatorObject;
+    // only set up shiro realm if user has implemented IntegratedSecurity
+    else if (authenticatorObject != null && authenticatorObject instanceof IntegratedSecurity)
{
+      IntegratedSecurity authenticator = (IntegratedSecurity) authenticatorObject;
       authenticator.init(securityProps);
       Realm realm = new CustomAuthRealm(authenticator);
       SecurityManager securityManager = new DefaultSecurityManager(realm);
@@ -366,7 +366,7 @@ public class GeodeSecurityUtil {
 
   public static boolean isIntegratedSecurity(String authenticatorFactoryName) {
     Object auth = getObject(authenticatorFactoryName);
-    return (auth instanceof CustomSecurity);
+    return (auth instanceof IntegratedSecurity);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b1f79b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/shiro/CustomAuthRealm.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/security/shiro/CustomAuthRealm.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/shiro/CustomAuthRealm.java
index dc7755e..905eded 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/security/shiro/CustomAuthRealm.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/shiro/CustomAuthRealm.java
@@ -33,7 +33,7 @@ import org.apache.shiro.subject.PrincipalCollection;
 
 import com.gemstone.gemfire.internal.security.GeodeSecurityUtil;
 import com.gemstone.gemfire.management.internal.security.ResourceConstants;
-import com.gemstone.gemfire.security.CustomSecurity;
+import com.gemstone.gemfire.security.IntegratedSecurity;
 import com.gemstone.gemfire.security.GemFireSecurityException;
 import com.gemstone.gemfire.security.GeodePermission;
 
@@ -41,9 +41,9 @@ public class CustomAuthRealm extends AuthorizingRealm{
   public static final String REALM_NAME = "CUSTOMAUTHREALM";
 
   private static final Logger logger = LogManager.getLogger(CustomAuthRealm.class);
-  private CustomSecurity externalSecurity = null;
+  private IntegratedSecurity externalSecurity = null;
 
-  public CustomAuthRealm(CustomSecurity auth) {
+  public CustomAuthRealm(IntegratedSecurity auth) {
     externalSecurity = auth;
   }
 
@@ -51,10 +51,10 @@ public class CustomAuthRealm extends AuthorizingRealm{
   public CustomAuthRealm (String authenticatorFactory) {
     Object auth = GeodeSecurityUtil.getObject(authenticatorFactory);
 
-    if(!(auth instanceof CustomSecurity)){
-      throw new GemFireSecurityException("Integrated Security requires CustomSecurity interface.");
+    if(!(auth instanceof IntegratedSecurity)){
+      throw new GemFireSecurityException("Integrated Security requires IntegratedSecurity
interface.");
     }
-    externalSecurity = (CustomSecurity) auth;
+    externalSecurity = (IntegratedSecurity) auth;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b1f79b/geode-core/src/main/java/com/gemstone/gemfire/security/CustomSecurity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/security/CustomSecurity.java b/geode-core/src/main/java/com/gemstone/gemfire/security/CustomSecurity.java
deleted file mode 100644
index 1e30902..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/security/CustomSecurity.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 java.security.Principal;
-import java.util.Properties;
-
-public interface CustomSecurity {
-
-  void init(Properties securityProps);
-
-  Principal authenticate(Properties props) throws AuthenticationFailedException;
-
-  default boolean authorize(Principal principal, GeodePermission permission) {
-    return true;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b1f79b/geode-core/src/main/java/com/gemstone/gemfire/security/IntegratedSecurity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/security/IntegratedSecurity.java
b/geode-core/src/main/java/com/gemstone/gemfire/security/IntegratedSecurity.java
new file mode 100644
index 0000000..9e44700
--- /dev/null
+++ b/geode-core/src/main/java/com/gemstone/gemfire/security/IntegratedSecurity.java
@@ -0,0 +1,32 @@
+/*
+ * 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 java.security.Principal;
+import java.util.Properties;
+
+public interface IntegratedSecurity {
+
+  void init(Properties securityProps);
+
+  Principal authenticate(Properties props) throws AuthenticationFailedException;
+
+  default boolean authorize(Principal principal, GeodePermission permission) {
+    return true;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b1f79b/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
b/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
index c69e4c6..317b705 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
@@ -43,7 +43,7 @@ import com.gemstone.gemfire.management.internal.security.ResourceConstants;
 import com.gemstone.gemfire.security.AccessControl;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 import com.gemstone.gemfire.security.Authenticator;
-import com.gemstone.gemfire.security.CustomSecurity;
+import com.gemstone.gemfire.security.IntegratedSecurity;
 import com.gemstone.gemfire.security.GeodePermission;
 import com.gemstone.gemfire.security.NotAuthorizedException;
 
@@ -95,7 +95,7 @@ import com.gemstone.gemfire.security.NotAuthorizedException;
  * }
  * </pre>
  */
-public class SampleJsonAuthorization implements CustomSecurity {
+public class SampleJsonAuthorization implements IntegratedSecurity {
 
   public static class Role {
     List<GeodePermission> permissions = new ArrayList<>();


Mime
View raw message