geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [66/90] [abbrv] incubator-geode git commit: GEODE-1463: Legacy OperationContexts do not set the appropriate Shiro permission tuple
Date Wed, 08 Jun 2016 00:05:43 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/670fae4b/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 fcbf04e..cb0507a 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
@@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.operations.OperationContext;
+import com.gemstone.gemfire.cache.operations.internal.ResourceOperationContext;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.security.AccessControl;
@@ -124,9 +125,9 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
       for (JsonNode op : r.get("operationsAllowed")) {
         String[] parts = op.asText().split(":");
         if (regionNames == null) {
-          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], "*"));
+          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], "*", false));
         } else {
-          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], regionNames));
+          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], regionNames,
false));
         }
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/670fae4b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContextJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContextJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContextJUnitTest.java
index 46c0e1d..5b07bdf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContextJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/ResourceOperationContextJUnitTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.*;
 import com.gemstone.gemfire.cache.operations.OperationContext;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.cache.operations.OperationContext.Resource;
+import com.gemstone.gemfire.cache.operations.internal.ResourceOperationContext;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 import org.apache.shiro.authz.permission.WildcardPermission;
@@ -49,12 +50,12 @@ public class ResourceOperationContextJUnitTest {
 
   @Test
   public void testConstructor(){
-    context = new ResourceOperationContext(null, null, null);
+    context = new ResourceOperationContext();
     assertEquals(Resource.NULL, context.getResource());
     assertEquals(OperationCode.NULL, context.getOperationCode());
     assertEquals(OperationContext.ALL_REGIONS, context.getRegionName());
 
-    context = new ResourceOperationContext(null, null);
+    context = new ResourceOperationContext();
     assertEquals(Resource.NULL, context.getResource());
     assertEquals(OperationCode.NULL, context.getOperationCode());
     assertEquals(OperationContext.ALL_REGIONS, context.getRegionName());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/670fae4b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
index 2ddc6ee..0f13246 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
@@ -22,6 +22,7 @@ import java.util.List;
 
 import com.gemstone.gemfire.cache.operations.OperationContext;
 
+import com.gemstone.gemfire.cache.operations.internal.ResourceOperationContext;
 import org.apache.shiro.authz.Permission;
 
 public class TestCommand {
@@ -41,23 +42,23 @@ public class TestCommand {
 
   private static List<TestCommand> testCommands = new ArrayList<>();
 
-  static{
+  static {
     init();
   }
-  
+
   private final String command;
   private final OperationContext permission;
-  
+
   public TestCommand(String command, OperationContext permission) {
     this.command = command;
     this.permission = permission;
   }
-  
+
   private static void createTestCommand(String command, OperationContext permission) {
     TestCommand instance = new TestCommand(command, permission);
     testCommands.add(instance);
   }
-  
+
   public String getCommand() {
     return this.command;
   }
@@ -66,13 +67,13 @@ public class TestCommand {
     return this.permission;
   }
 
-  public static List<TestCommand> getCommands(){
+  public static List<TestCommand> getCommands() {
     return testCommands;
   }
 
-  public static List<TestCommand> getPermittedCommands(Permission permission){
+  public static List<TestCommand> getPermittedCommands(Permission permission) {
     List<TestCommand> result = new ArrayList<>();
-    for(TestCommand testCommand:testCommands){
+    for (TestCommand testCommand : testCommands) {
       OperationContext cPerm = testCommand.getPermission();
       if(cPerm!=null && permission.implies(cPerm)){
         result.add(testCommand);
@@ -225,5 +226,5 @@ public class TestCommand {
     createTestCommand("disconnect", null);
     //Misc commands
     //createTestCommand("shutdown", clusterManage);
-  };
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/670fae4b/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
b/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
index 89305ac..4e951af 100755
--- a/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
+++ b/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
@@ -130,6 +130,7 @@ com/gemstone/gemfire/cache/execute/FunctionException,true,4893171227542647452
 com/gemstone/gemfire/cache/execute/FunctionInvocationTargetException,true,1,id:com/gemstone/gemfire/distributed/DistributedMember
 com/gemstone/gemfire/cache/operations/OperationContext$OperationCode,false
 com/gemstone/gemfire/cache/operations/OperationContext$Resource,false
+com/gemstone/gemfire/cache/operations/internal/ResourceOperationContext,false,isPostOperation:boolean,opResult:java/lang/Object,operation:com/gemstone/gemfire/cache/operations/OperationContext$OperationCode,regionName:java/lang/String,resource:com/gemstone/gemfire/cache/operations/OperationContext$Resource
 com/gemstone/gemfire/cache/partition/PartitionNotAvailableException,true,1
 com/gemstone/gemfire/cache/persistence/ConflictingPersistentDataException,true,-2629287782021455875
 com/gemstone/gemfire/cache/persistence/PartitionOfflineException,true,-6471045959318795870,offlineMembers:java/util/Set
@@ -257,7 +258,6 @@ com/gemstone/gemfire/internal/admin/CompoundRegionSnapshot,true,6295026394298398
 com/gemstone/gemfire/internal/admin/StatAlert,true,5725457607122449170,definitionId:int,time:java/util/Date,values:java/lang/Number[]
 com/gemstone/gemfire/internal/admin/remote/DistributionLocatorId,true,6587390186971937865,bindAddress:java/lang/String,host:java/net/InetAddress,hostnameForClients:java/lang/String,peerLocator:boolean,port:int,serverLocator:boolean
 com/gemstone/gemfire/internal/admin/remote/EntryValueNodeImpl,false,fields:com/gemstone/gemfire/internal/admin/remote/EntryValueNodeImpl[],name:java/lang/String,primitive:boolean,primitiveVal:java/lang/Object,type:java/lang/String
-com/gemstone/gemfire/internal/cache/AbstractRegionMap$1,false,this$0:com/gemstone/gemfire/internal/cache/AbstractRegionMap
 com/gemstone/gemfire/internal/cache/BackupLock,false,backupDone:java/util/concurrent/locks/Condition,backupThread:java/lang/Thread,isBackingUp:boolean
 com/gemstone/gemfire/internal/cache/BucketAdvisor$SetFromMap,true,2454657854757543876,m:java/util/Map
 com/gemstone/gemfire/internal/cache/BucketNotFoundException,false
@@ -282,7 +282,6 @@ com/gemstone/gemfire/internal/cache/ForceableLinkedBlockingQueue,true,-690393397
 com/gemstone/gemfire/internal/cache/GemFireCacheImpl$3,true,1,this$0:com/gemstone/gemfire/internal/cache/GemFireCacheImpl
 com/gemstone/gemfire/internal/cache/GemFireCacheImpl$4,true,1,this$0:com/gemstone/gemfire/internal/cache/GemFireCacheImpl
 com/gemstone/gemfire/internal/cache/GemFireCacheImpl$5,true,1,this$0:com/gemstone/gemfire/internal/cache/GemFireCacheImpl
-com/gemstone/gemfire/internal/cache/GemFireCacheImpl$6,true,1,this$0:com/gemstone/gemfire/internal/cache/GemFireCacheImpl
 com/gemstone/gemfire/internal/cache/IdentityArrayList,true,449125332499184497,size:int,wrapped:boolean
 com/gemstone/gemfire/internal/cache/IncomingGatewayStatus,true,-4579815367602658353,_memberId:java/lang/String,_socketAddress:java/net/InetAddress,_socketPort:int
 com/gemstone/gemfire/internal/cache/InitialImageOperation$GIIStatus,false


Mime
View raw message