geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbawas...@apache.org
Subject incubator-geode git commit: GEODE-1569: add post authorization processing in JMX and CLI commands
Date Thu, 25 Aug 2016 18:59:23 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 93985f96f -> 44b528d10


GEODE-1569: add post authorization processing in JMX and CLI commands

changed the Principal to be an Object to be consistent with how
other projects incuding spring-security and Apache shiro use Principal.


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

Branch: refs/heads/develop
Commit: 44b528d10f23c7eb1435d2103a877fb97c1ba91e
Parents: 93985f9
Author: Swapnil Bawaskar <sbawaskar@pivotal.io>
Authored: Tue Aug 23 15:14:26 2016 -0700
Committer: Swapnil Bawaskar <sbawaskar@pivotal.io>
Committed: Thu Aug 25 11:59:37 2016 -0700

----------------------------------------------------------------------
 .../gemfire/internal/security/shiro/CustomAuthRealm.java        | 2 +-
 .../main/java/org/apache/geode/security/SecurityManager.java    | 5 ++---
 .../apache/geode/security/templates/SampleSecurityManager.java  | 5 ++---
 .../java/com/gemstone/gemfire/security/SpySecurityManager.java  | 3 +--
 4 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b528d1/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 b9dd8c0..09b8d5f 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
@@ -71,7 +71,7 @@ public class CustomAuthRealm extends AuthorizingRealm {
     credentialProps.put(ResourceConstants.USER_NAME, username);
     credentialProps.put(ResourceConstants.PASSWORD, password);
 
-    Serializable principal  = securityManager.authenticate(credentialProps);
+    Object principal  = securityManager.authenticate(credentialProps);
 
     try {
       return new SimpleAuthenticationInfo(principal, authToken.getPassword(), REALM_NAME);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b528d1/geode-core/src/main/java/org/apache/geode/security/SecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/security/SecurityManager.java b/geode-core/src/main/java/org/apache/geode/security/SecurityManager.java
index 9db4734..16b35f1 100644
--- a/geode-core/src/main/java/org/apache/geode/security/SecurityManager.java
+++ b/geode-core/src/main/java/org/apache/geode/security/SecurityManager.java
@@ -16,7 +16,6 @@
  */
 package org.apache.geode.security;
 
-import java.io.Serializable;
 import java.util.Properties;
 
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -49,7 +48,7 @@ public interface SecurityManager {
    *        a serializable principal object
    * @throws AuthenticationFailedException
    */
-  Serializable authenticate(Properties credentials) throws AuthenticationFailedException;
+  Object authenticate(Properties credentials) throws AuthenticationFailedException;
 
   /**
    * Authorize the ResourcePermission for a given Principal
@@ -60,7 +59,7 @@ public interface SecurityManager {
    * @return
    *        true if authorized, false if not
    */
-  default boolean authorize(Serializable principal, ResourcePermission permission) {
+  default boolean authorize(Object principal, ResourcePermission permission) {
     return true;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b528d1/geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
b/geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
index 5948527..b806c9f 100644
--- a/geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
+++ b/geode-core/src/main/java/org/apache/geode/security/templates/SampleSecurityManager.java
@@ -18,7 +18,6 @@ package org.apache.geode.security.templates;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.Serializable;
 import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -97,7 +96,7 @@ public class SampleSecurityManager implements SecurityManager {
   private Map<String, User> userNameToUser;
 
   @Override
-  public boolean authorize(final Serializable principal, final ResourcePermission context)
{
+  public boolean authorize(final Object principal, final ResourcePermission context) {
     if (principal == null) return false;
 
     User user = this.userNameToUser.get(principal.toString());
@@ -128,7 +127,7 @@ public class SampleSecurityManager implements SecurityManager {
   }
 
   @Override
-  public Serializable authenticate(final Properties credentials) throws AuthenticationFailedException
{
+  public Object authenticate(final Properties credentials) throws AuthenticationFailedException
{
     String user = credentials.getProperty(ResourceConstants.USER_NAME);
     String password = credentials.getProperty(ResourceConstants.PASSWORD);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44b528d1/geode-core/src/test/java/com/gemstone/gemfire/security/SpySecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/SpySecurityManager.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/SpySecurityManager.java
index 31ebde5..91d25f0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/SpySecurityManager.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/SpySecurityManager.java
@@ -16,7 +16,6 @@
  */
 package com.gemstone.gemfire.security;
 
-import java.io.Serializable;
 import java.util.Properties;
 
 import org.apache.geode.security.SecurityManager;
@@ -32,7 +31,7 @@ public class SpySecurityManager implements SecurityManager {
   }
 
   @Override
-  public Serializable authenticate(final Properties props) throws AuthenticationFailedException
{
+  public Object authenticate(final Properties props) throws AuthenticationFailedException
{
     return null;
   }
 


Mime
View raw message