cxzl25 commented on a change in pull request #1177:
URL: https://github.com/apache/incubator-kyuubi/pull/1177#discussion_r718332276



##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala
##########
@@ -48,14 +49,18 @@ class KyuubiSessionManager private (name: String) extends 
SessionManager(name) {
 
     val username = Option(user).filter(_.nonEmpty).getOrElse("anonymous")
 
+    val sessionConf = this.getConf.getUserDefaults(user)
+    if (!sessionConf.get(HA_ZK_ACL_ENGINE_ENABLED)) {

Review comment:
       Move to `ZooKeeperACLProvider`

##########
File path: 
kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala
##########
@@ -98,17 +100,31 @@ class ServiceDiscoverySuite extends KerberizedTestHelper {
   }
 
   test("acl for zookeeper") {
-    val provider = new ZooKeeperACLProvider(conf)
-    val acl = provider.getDefaultAcl
-    assert(acl.size() === 1)
-    assert(acl === ZooDefs.Ids.OPEN_ACL_UNSAFE)
-
-    val conf1 = conf.clone.set(HA_ZK_ACL_ENABLED, true)
-    val acl1 = new ZooKeeperACLProvider(conf1).getDefaultAcl
-    assert(acl1.size() === 2)
-    val expected = ZooDefs.Ids.READ_ACL_UNSAFE
-    expected.addAll(ZooDefs.Ids.CREATOR_ALL_ACL)

Review comment:
       This will modify the original list

##########
File path: 
kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala
##########
@@ -98,17 +100,31 @@ class ServiceDiscoverySuite extends KerberizedTestHelper {
   }
 
   test("acl for zookeeper") {
-    val provider = new ZooKeeperACLProvider(conf)
-    val acl = provider.getDefaultAcl
-    assert(acl.size() === 1)
-    assert(acl === ZooDefs.Ids.OPEN_ACL_UNSAFE)
-
-    val conf1 = conf.clone.set(HA_ZK_ACL_ENABLED, true)
-    val acl1 = new ZooKeeperACLProvider(conf1).getDefaultAcl
-    assert(acl1.size() === 2)
-    val expected = ZooDefs.Ids.READ_ACL_UNSAFE
-    expected.addAll(ZooDefs.Ids.CREATOR_ALL_ACL)

Review comment:
       This (`expected.addAll`) will modify the original list




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