jinmeiliao commented on a change in pull request #6835:
URL: https://github.com/apache/geode/pull/6835#discussion_r708731607



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java
##########
@@ -581,6 +656,33 @@ protected boolean dispatchMessage(ClientMessage 
clientMessage) throws IOExceptio
         logger.trace(msg.toString());
       }
 
+      // authorize the message before dispatching
+      String regionName = clientUpdateMessage.getRegionName();
+      Object key = clientUpdateMessage.getKeyOfInterest();
+      SecurityService securityService = getCache().getSecurityService();
+      ResourcePermission permission = new 
ResourcePermission(ResourcePermission.Resource.DATA,
+          ResourcePermission.Operation.READ,
+          regionName, key == null ? null : key.toString());

Review comment:
       done

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
##########
@@ -1164,6 +1190,20 @@ public void removeUserAuth(Message message, boolean 
keepAlive) {
     }
   }
 
+  @VisibleForTesting
+  long putSubject(Subject subject, long existingUniqueId) {
+    long uniqueId;
+    uniqueId = clientUserAuths.putSubject(subject, existingUniqueId);

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to