pan3793 commented on code in PR #5072:
URL: https://github.com/apache/kyuubi/pull/5072#discussion_r1268853433
##########
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationWithEngineSecuritySuite.scala:
##########
@@ -17,33 +17,36 @@
package org.apache.kyuubi.operation
+import java.nio.charset.StandardCharsets
+
import org.apache.kyuubi.WithKyuubiServer
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.ha.HighAvailabilityConf
import org.apache.kyuubi.ha.client.DiscoveryClientProvider
-import org.apache.kyuubi.service.authentication.{InternalSecurityAccessor,
ZooKeeperEngineSecuritySecretProviderImpl}
+import org.apache.kyuubi.service.authentication.InternalSecurityAccessor
-class KyuubiOperationWithEngineSecurity extends WithKyuubiServer with
HiveJDBCTestHelper {
+class KyuubiOperationWithEngineSecuritySuite extends WithKyuubiServer with
HiveJDBCTestHelper {
import DiscoveryClientProvider._
override protected def jdbcUrl: String = getJdbcUrl
private val engineSecretNode = "/SECRET"
+ private val engineSecret = "_ENGINE_SECRET_"
override protected val conf: KyuubiConf = {
KyuubiConf()
.set(KyuubiConf.ENGINE_SECURITY_ENABLED, false)
- .set(
- KyuubiConf.ENGINE_SECURITY_SECRET_PROVIDER,
- classOf[ZooKeeperEngineSecuritySecretProviderImpl].getCanonicalName)
+ .set(KyuubiConf.ENGINE_SECURITY_SECRET_PROVIDER, "zookeeper")
.set(HighAvailabilityConf.HA_ZK_ENGINE_SECURE_SECRET_NODE,
engineSecretNode)
}
override def beforeAll(): Unit = {
super.beforeAll()
withDiscoveryClient(conf) { discoveryClient =>
discoveryClient.create(engineSecretNode, "PERSISTENT", false)
- discoveryClient.startSecretNode("PERSISTENT", engineSecretNode,
"_ENGINE_SECRET_")
+ discoveryClient.startSecretNode("PERSISTENT", engineSecretNode,
engineSecret)
+ val expected = engineSecret.getBytes(StandardCharsets.UTF_8)
+ assert(discoveryClient.getData(engineSecretNode) === expected)
Review Comment:
this assertion makes sure that data has been written into znode.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]