alex-plekhanov commented on a change in pull request #9290:
URL: https://github.com/apache/ignite/pull/9290#discussion_r692243654



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
##########
@@ -917,13 +927,63 @@ else if (type == EVT_CLIENT_NODE_RECONNECTED) {
                             discoCache,
                             notification.getTopSnapshot(),
                             stateFinishMsg,
-                            notification.getSpanContainer()
+                            notification.getSpanContainer(),
+                            secCtx
                         )
                     );
 
                 if (type == EVT_CLIENT_NODE_DISCONNECTED)
                     discoWrk.awaitDisconnectEvent();
             }
+
+            /** */
+            class SecurityAwareNotificationTask extends NotificationTask {
+                /** */
+                public SecurityAwareNotificationTask(DiscoveryNotification 
notification) {
+                    super(notification);
+                }
+
+                /** */
+                @Override public void run() {
+                    DiscoverySpiCustomMessage customMsg = 
notification.getCustomMsgData();
+
+                    if (customMsg instanceof 
SecurityAwareCustomMessageWrapper) {
+                        UUID secSubjId = 
((SecurityAwareCustomMessageWrapper)customMsg).securitySubjectId();
+
+                        try (OperationSecurityContext ignored = 
ctx.security().withContext(secSubjId)) {
+                            super.run();
+                        }
+                    }
+                    else {
+                        SecurityContext initiatorNodeSecCtx = 
nodeSecurityContext(
+                            marshaller,
+                            U.resolveClassLoader(ctx.config()),
+                            notification.getNode()
+                        );
+
+                        try (OperationSecurityContext ignored = 
ctx.security().withContext(initiatorNodeSecCtx)) {

Review comment:
       Ok, agree




-- 
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