geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [48/48] geode git commit: rebase to origin/develop
Date Tue, 22 Aug 2017 22:36:50 GMT
rebase to origin/develop


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

Branch: refs/heads/feature/GEODE-3447
Commit: ea1d8c1f9540d86751a8ce22732bd6b42c0ae4ae
Parents: 495d788
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Aug 22 15:34:21 2017 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Aug 22 15:34:21 2017 -0700

----------------------------------------------------------------------
 .../GenericProtocolServerConnection.java        |  2 +-
 .../tier/sockets/MessageExecutionContext.java   | 43 +++++++++++++++-----
 .../GenericProtocolServerConnectionTest.java    |  2 +-
 .../protocol/protobuf/ProtobufOpsProcessor.java | 22 +++++-----
 .../protocol/AuthorizationIntegrationTest.java  |  5 ++-
 .../protobuf/ProtobufStreamProcessorTest.java   |  4 +-
 .../GetAllRequestOperationHandlerJUnitTest.java | 11 +++--
 ...onNamesRequestOperationHandlerJUnitTest.java |  5 ++-
 ...tRegionRequestOperationHandlerJUnitTest.java |  6 ++-
 .../GetRequestOperationHandlerJUnitTest.java    | 11 ++---
 .../PutAllRequestOperationHandlerJUnitTest.java | 16 +++++---
 .../PutRequestOperationHandlerJUnitTest.java    |  9 ++--
 .../RemoveRequestOperationHandlerJUnitTest.java |  9 ++--
 13 files changed, 89 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnection.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnection.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnection.java
index cd1647a..ed8886a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnection.java
@@ -62,7 +62,7 @@ public class GenericProtocolServerConnection extends ServerConnection {
         authenticator.receiveMessage(inputStream, outputStream, securityManager);
       } else {
         messageHandler.receiveMessage(inputStream, outputStream,
-            new MessageExecutionContext(this.getCache()));
+            new MessageExecutionContext(this.getCache(), authenticator.getAuthorizer()));
       }
     } catch (IOException e) {
       logger.warn(e);

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageExecutionContext.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageExecutionContext.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageExecutionContext.java
index 1cb8c9d..817df0e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageExecutionContext.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageExecutionContext.java
@@ -18,39 +18,60 @@ package org.apache.geode.internal.cache.tier.sockets;
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.internal.InternalLocator;
+import org.apache.geode.security.NoOpStreamAuthorizer;
+import org.apache.geode.security.StreamAuthorizer;
 
 @Experimental
 public class MessageExecutionContext {
   private Cache cache;
   private InternalLocator locator;
+  private StreamAuthorizer authorizer;
 
-  public MessageExecutionContext(Cache cache) {
+  public MessageExecutionContext(Cache cache, StreamAuthorizer streamAuthorizer) {
     this.cache = cache;
+    this.authorizer = streamAuthorizer;
   }
 
   public MessageExecutionContext(InternalLocator locator) {
     this.locator = locator;
+    // set a no-op authorizer until such time as locators implement authentication
+    // and authorization checks
+    this.authorizer = new NoOpStreamAuthorizer();
   }
 
-  // This throws if the cache isn't present because we know that non of the callers can take
any
-  // reasonable action if the cache is not present
+  /**
+   * Returns the cache associated with this execution
+   * <p>
+   * 
+   * @throws InvalidExecutionContextException if there is no cache available
+   */
   public Cache getCache() throws InvalidExecutionContextException {
     if (cache != null) {
       return cache;
-    } else {
-      throw new InvalidExecutionContextException(
-          "Operations on the locator should not to try to operate on a cache");
     }
+    throw new InvalidExecutionContextException(
+        "Operations on the locator should not to try to operate on a cache");
   }
 
-  // This throws if the locator isn't present because we know that non of the callers can
take any
-  // reasonable action if the locator is not present
+  /**
+   * Returns the locator associated with this execution
+   * <p>
+   * 
+   * @throws InvalidExecutionContextException if there is no locator available
+   */
   public InternalLocator getLocator() throws InvalidExecutionContextException {
     if (locator != null) {
       return locator;
-    } else {
-      throw new InvalidExecutionContextException(
-          "Operations on the server should not to try to operate on a locator");
     }
+    throw new InvalidExecutionContextException(
+        "Operations on the server should not to try to operate on a locator");
+  }
+
+  /**
+   * Returns the StreamAuthorizer associated with this execution. This can be used to perform
+   * authorization checks for the user associated with this thread.
+   */
+  public StreamAuthorizer getAuthorizer() {
+    return authorizer;
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnectionTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnectionTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnectionTest.java
index 6817b13..383fbf0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnectionTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/GenericProtocolServerConnectionTest.java
@@ -53,7 +53,7 @@ public class GenericProtocolServerConnectionTest {
     when(socketMock.getInetAddress()).thenReturn(InetAddress.getByName("localhost"));
 
     ClientProtocolMessageHandler clientProtocolMock = mock(ClientProtocolMessageHandler.class);
-    doThrow(new IOException()).when(clientProtocolMock).receiveMessage(any(), any(), any(),
any());
+    doThrow(new IOException()).when(clientProtocolMock).receiveMessage(any(), any(), any());
 
     return new GenericProtocolServerConnection(socketMock, mock(InternalCache.class),
         mock(CachedRegionHelper.class), mock(CacheServerStats.class), 0, 0, "",

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
b/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
index 43601d7..5a3f678 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
@@ -15,6 +15,7 @@
 package org.apache.geode.protocol.protobuf;
 
 import org.apache.geode.annotations.Experimental;
+import org.apache.geode.internal.cache.Token;
 import org.apache.geode.internal.cache.tier.sockets.MessageExecutionContext;
 import org.apache.geode.internal.cache.tier.sockets.InvalidExecutionContextException;
 import org.apache.geode.protocol.protobuf.registry.OperationContextRegistry;
@@ -45,22 +46,19 @@ public class ProtobufOpsProcessor {
     ClientProtocol.Response.Builder builder;
     Result result;
     try {
-      result = operationContext.getOperationHandler().process(serializationService,
-          operationContext.getFromRequest().apply(request), context);
-    } catch (InvalidExecutionContextException e) {
+      if (context.getAuthorizer().authorize(operationContext.getAccessPermissionRequired()))
{
+        result = operationContext.getOperationHandler().process(serializationService,
+            operationContext.getFromRequest().apply(request), context);
+      } else {
+        result = Failure.of(ProtobufResponseUtilities.makeErrorResponse(
+            ProtocolErrorCode.AUTHORIZATION_FAILED.codeValue,
+            "User isn't authorized for this operation."));
+      }
+    } catch (InvalidExecutionContextException exception) {
       result = Failure.of(ProtobufResponseUtilities.makeErrorResponse(
           ProtocolErrorCode.UNSUPPORTED_OPERATION.codeValue,
           "Invalid execution context found for operation."));
     }
-    Result result;
-    if (authorizer.authorize(operationContext.getAccessPermissionRequired())) {
-      result = operationContext.getOperationHandler().process(serializationService,
-          operationContext.getFromRequest().apply(request), cache);
-    } else {
-      result = Failure.of(ProtobufResponseUtilities.makeErrorResponse(
-          ProtocolErrorCode.AUTHORIZATION_FAILED.codeValue,
-          "User isn't authorized for this operation."));
-    }
 
     builder = (ClientProtocol.Response.Builder) result.map(operationContext.getToResponse(),
         operationContext.getToErrorResponse());

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/AuthorizationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/AuthorizationIntegrationTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/AuthorizationIntegrationTest.java
index 9df23d6..f6d5a5b 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/AuthorizationIntegrationTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/AuthorizationIntegrationTest.java
@@ -40,6 +40,7 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.management.internal.security.ResourceConstants;
 import org.apache.geode.protocol.protobuf.AuthenticationAPI;
 import org.apache.geode.protocol.protobuf.ClientProtocol;
 import org.apache.geode.protocol.protobuf.ProtobufSerializationService;
@@ -81,8 +82,8 @@ public class AuthorizationIntegrationTest {
   @Before
   public void setUp() throws IOException, CodecAlreadyRegisteredForTypeException {
     Properties expectedAuthProperties = new Properties();
-    expectedAuthProperties.setProperty("username", TEST_USERNAME);
-    expectedAuthProperties.setProperty("password", TEST_PASSWORD);
+    expectedAuthProperties.setProperty(ResourceConstants.USER_NAME, TEST_USERNAME);
+    expectedAuthProperties.setProperty(ResourceConstants.PASSWORD, TEST_PASSWORD);
 
     securityPrincipal = new Object();
     mockSecurityManager = mock(SecurityManager.class);

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/ProtobufStreamProcessorTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/ProtobufStreamProcessorTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/ProtobufStreamProcessorTest.java
index 668d280..bebbfde 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/ProtobufStreamProcessorTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/ProtobufStreamProcessorTest.java
@@ -27,7 +27,7 @@ import org.junit.experimental.categories.Category;
 
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.tier.sockets.MessageExecutionContext;
-import org.apache.geode.security.StreamAuthorizer;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
@@ -40,6 +40,6 @@ public class ProtobufStreamProcessorTest {
     ProtobufStreamProcessor protobufStreamProcessor = new ProtobufStreamProcessor();
     InternalCache mockInternalCache = mock(InternalCache.class);
     protobufStreamProcessor.receiveMessage(inputStream, outputStream,
-        new MessageExecutionContext(mockInternalCache));
+        new MessageExecutionContext(mockInternalCache, new NoOpStreamAuthorizer()));
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
index 64ee50b..e407083 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
@@ -35,6 +35,7 @@ import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.codec.StringCodec;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
@@ -81,8 +82,9 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processReturnsExpectedValuesForValidKeys()
       throws CodecAlreadyRegisteredForTypeException, UnsupportedEncodingTypeException,
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
-    Result<RegionAPI.GetAllResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(true), new MessageExecutionContext(cacheStub));
+    Result<RegionAPI.GetAllResponse> result =
+        operationHandler.process(serializationServiceStub, generateTestRequest(true),
+            new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(result instanceof Success);
 
@@ -101,8 +103,9 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   @Test
   public void processReturnsNoEntriesForNoKeysRequested() throws UnsupportedEncodingTypeException,
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
-    Result<RegionAPI.GetAllResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(false), new MessageExecutionContext(cacheStub));
+    Result<RegionAPI.GetAllResponse> result =
+        operationHandler.process(serializationServiceStub, generateTestRequest(false),
+            new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(result instanceof Success);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
index 2fcf575..d42ed63 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
@@ -33,6 +33,7 @@ import org.apache.geode.protocol.protobuf.RegionAPI;
 import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
 import org.apache.geode.serialization.registry.exception.CodecNotRegisteredForTypeException;
@@ -67,7 +68,7 @@ public class GetRegionNamesRequestOperationHandlerJUnitTest extends OperationHan
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     Result<RegionAPI.GetRegionNamesResponse> result = operationHandler.process(
         serializationServiceStub, ProtobufRequestUtilities.createGetRegionNamesRequest(),
-        new MessageExecutionContext(cacheStub));
+        new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
     Assert.assertTrue(result instanceof Success);
 
     RegionAPI.GetRegionNamesResponse getRegionsResponse = result.getMessage();
@@ -93,7 +94,7 @@ public class GetRegionNamesRequestOperationHandlerJUnitTest extends OperationHan
         .thenReturn(Collections.unmodifiableSet(new HashSet<Region<String, String>>()));
     Result<RegionAPI.GetRegionNamesResponse> result = operationHandler.process(
         serializationServiceStub, ProtobufRequestUtilities.createGetRegionNamesRequest(),
-        new MessageExecutionContext(emptyCache));
+        new MessageExecutionContext(emptyCache, new NoOpStreamAuthorizer()));
     Assert.assertTrue(result instanceof Success);
 
     RegionAPI.GetRegionNamesResponse getRegionsResponse = result.getMessage();

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
index 60d4985..02ba325 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
@@ -28,6 +28,7 @@ import org.apache.geode.protocol.protobuf.Failure;
 import org.apache.geode.protocol.protobuf.ProtocolErrorCode;
 import org.apache.geode.protocol.protobuf.RegionAPI;
 import org.apache.geode.protocol.protobuf.Result;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
 import org.apache.geode.serialization.registry.exception.CodecNotRegisteredForTypeException;
@@ -75,7 +76,8 @@ public class GetRegionRequestOperationHandlerJUnitTest extends OperationHandlerJ
 
 
     Result<RegionAPI.GetRegionResponse> result = operationHandler.process(serializationServiceStub,
-        MessageUtil.makeGetRegionRequest(TEST_REGION1), new MessageExecutionContext(cacheStub));
+        MessageUtil.makeGetRegionRequest(TEST_REGION1),
+        new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
     RegionAPI.GetRegionResponse response = result.getMessage();
     BasicTypes.Region region = response.getRegion();
     Assert.assertEquals(TEST_REGION1, region.getName());
@@ -101,7 +103,7 @@ public class GetRegionRequestOperationHandlerJUnitTest extends OperationHandlerJ
     String unknownRegionName = "UNKNOWN_REGION";
     Result<RegionAPI.GetRegionResponse> result = operationHandler.process(serializationServiceStub,
         MessageUtil.makeGetRegionRequest(unknownRegionName),
-        new MessageExecutionContext(emptyCache));
+        new MessageExecutionContext(emptyCache, new NoOpStreamAuthorizer()));
     Assert.assertTrue(result instanceof Failure);
     Assert.assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
         result.getErrorMessage().getError().getErrorCode());

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
index 6885666..9d11301 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
@@ -26,6 +26,7 @@ import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.codec.StringCodec;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
@@ -75,7 +76,7 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, false, false);
     Result<RegionAPI.GetResponse> result = operationHandler.process(serializationServiceStub,
-        getRequest, new MessageExecutionContext(cacheStub));
+        getRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(result instanceof Success);
     Assert.assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT,
@@ -90,7 +91,7 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.GetRequest getRequest = generateTestRequest(true, false, false);
     Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, new MessageExecutionContext(cacheStub));
+        getRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(response instanceof Failure);
     Assert.assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
@@ -103,7 +104,7 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, true, false);
     Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, new MessageExecutionContext(cacheStub));
+        getRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(response instanceof Success);
   }
@@ -114,7 +115,7 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, false, true);
     Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, new MessageExecutionContext(cacheStub));
+        getRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(response instanceof Success);
   }
@@ -136,7 +137,7 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
     RegionAPI.GetRequest getRequest =
         ProtobufRequestUtilities.createGetRequest(TEST_REGION, encodedKey).getGetRequest();
     Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, new MessageExecutionContext(cacheStub));
+        getRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(response instanceof Failure);
     Assert.assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
index 955013f..618bec2 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
@@ -23,6 +23,7 @@ import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
 import org.apache.geode.serialization.registry.exception.CodecNotRegisteredForTypeException;
@@ -73,8 +74,9 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
       CodecAlreadyRegisteredForTypeException, InvalidExecutionContextException {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(false, true), new MessageExecutionContext(cacheStub));
+    Result<RegionAPI.PutAllResponse> result =
+        operationHandler.process(serializationServiceStub, generateTestRequest(false, true),
+            new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     Assert.assertTrue(result instanceof Success);
 
@@ -87,8 +89,9 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processWithInvalidEntrySucceedsAndReturnsFailedKey() throws Exception {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(true, true), new MessageExecutionContext(cacheStub));
+    Result<RegionAPI.PutAllResponse> result =
+        operationHandler.process(serializationServiceStub, generateTestRequest(true, true),
+            new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Success);
     verify(regionMock).put(TEST_KEY1, TEST_VALUE1);
@@ -106,8 +109,9 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processWithNoEntriesPasses() throws Exception {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(false, false), new MessageExecutionContext(cacheStub));
+    Result<RegionAPI.PutAllResponse> result =
+        operationHandler.process(serializationServiceStub, generateTestRequest(false, false),
+            new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Success);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
index d36ad41..34b0ce0 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
@@ -26,6 +26,7 @@ import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
 import org.apache.geode.serialization.registry.exception.CodecNotRegisteredForTypeException;
@@ -68,7 +69,7 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
       CodecAlreadyRegisteredForTypeException, InvalidExecutionContextException {
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
     Result<RegionAPI.PutResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(), new MessageExecutionContext(cacheStub));
+        generateTestRequest(), new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Success);
 
@@ -99,7 +100,7 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
     RegionAPI.PutRequest putRequest =
         ProtobufRequestUtilities.createPutRequest(TEST_REGION, testEntry).getPutRequest();
     Result<RegionAPI.PutResponse> result = operationHandler.process(serializationServiceStub,
-        putRequest, new MessageExecutionContext(cacheStub));
+        putRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Failure);
     assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,
@@ -113,7 +114,7 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
     when(cacheStub.getRegion(TEST_REGION)).thenReturn(null);
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
     Result<RegionAPI.PutResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(), new MessageExecutionContext(cacheStub));
+        generateTestRequest(), new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Failure);
     assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
@@ -128,7 +129,7 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
 
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
     Result<RegionAPI.PutResponse> result = operationHandler.process(serializationServiceStub,
-        generateTestRequest(), new MessageExecutionContext(cacheStub));
+        generateTestRequest(), new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Failure);
     assertEquals(ProtocolErrorCode.CONSTRAINT_VIOLATION.codeValue,

http://git-wip-us.apache.org/repos/asf/geode/blob/ea1d8c1f/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
index 4350ece..0830bcd 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
@@ -27,6 +27,7 @@ import org.apache.geode.protocol.protobuf.Result;
 import org.apache.geode.protocol.protobuf.Success;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.protocol.protobuf.utilities.ProtobufUtilities;
+import org.apache.geode.security.NoOpStreamAuthorizer;
 import org.apache.geode.serialization.codec.StringCodec;
 import org.apache.geode.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.serialization.registry.exception.CodecAlreadyRegisteredForTypeException;
@@ -76,7 +77,7 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(false, false).getRemoveRequest();
     Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, new MessageExecutionContext(cacheStub));
+        removeRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Success);
     verify(regionStub).remove(TEST_KEY);
@@ -88,7 +89,7 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(true, false).getRemoveRequest();
     Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, new MessageExecutionContext(cacheStub));
+        removeRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Failure);
     assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
@@ -101,7 +102,7 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(false, true).getRemoveRequest();
     Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, new MessageExecutionContext(cacheStub));
+        removeRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Success);
   }
@@ -124,7 +125,7 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
     RegionAPI.RemoveRequest removeRequest =
         ProtobufRequestUtilities.createRemoveRequest(TEST_REGION, encodedKey).getRemoveRequest();;
     Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, new MessageExecutionContext(cacheStub));
+        removeRequest, new MessageExecutionContext(cacheStub, new NoOpStreamAuthorizer()));
 
     assertTrue(result instanceof Failure);
     assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,


Mime
View raw message