ignite icon indicating copy to clipboard operation
ignite copied to clipboard

`EVT_NODE_JOINED` Event security context is wrong in listener

Open icode opened this issue 8 months ago • 0 comments

// this service deployed by all permission subject server node
class DeploySyncServiceImpl : DeploySyncService {
    override fun execute() {
        // listen client node joined
        ignite.events().localListen(object : IgnitePredicate<DiscoveryEvent> {
            override fun apply(e: DiscoveryEvent): Boolean {
                // this not local node security context
                ignite.context().security().withContext(ignite.cluster().localNode().id()).use {
                    // must use `withContext` switch to local node security context
                }
                return true
            }
        }, EventType.EVT_NODE_JOINED)
    }
}

icode avatar Apr 15 '25 17:04 icode