dgarus commented on a change in pull request #7375: PoC security context spread
URL: https://github.com/apache/ignite/pull/7375#discussion_r384455333
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
 ##########
 @@ -125,10 +120,25 @@ public IgniteSecurityProcessor(GridKernalContext ctx, 
GridSecurityProcessor secP
         return res;
     }
 
+    /** {@inheritDoc} */
+    @Override public SecurityContext securityContext(UUID subjId) {
+        return secPrc.securityContext(subjId);
+    }
+
     /** {@inheritDoc} */
     @Override public SecurityContext authenticateNode(ClusterNode node, 
SecurityCredentials cred)
         throws IgniteCheckedException {
-        return secPrc.authenticateNode(node, cred);
+        SecurityContext res = secPrc.authenticateNode(node, cred);
+
+        if (res != null) {
+            Map<String, Object> attrs = new HashMap<>(node.attributes());
+
+            attrs.put(ATTR_SECURITY_SUBJECT_ID, res.subject().id());
+
+            ((TcpDiscoveryNode)node).setAttributes(attrs);
 
 Review comment:
   Yes, you are right.
   To avoid this exception, we can, for example, add the 
IgniteClusterNode#setAttributes method (I've updated the PR).
   I tried to illustrate that we can do placing the existing logic of spreading 
security context to GridSecurityProcessor, 
   but this PoC doesn't pretend to be a merge-ready approach.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to