LamiumAmplexicaule commented on code in PR #7349:
URL: https://github.com/apache/kyuubi/pull/7349#discussion_r2922700382
##########
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/zookeeper/ZookeeperClientProvider.scala:
##########
@@ -110,53 +110,56 @@ object ZookeeperClientProvider extends Logging {
*/
@throws[Exception]
def setUpZooKeeperAuth(conf: KyuubiConf): Unit = {
- def setupZkAuth(): Unit = (conf.get(HA_ZK_AUTH_PRINCIPAL),
getKeyTabFile(conf)) match {
- case (Some(principal), Some(keytab)) if
UserGroupInformation.isSecurityEnabled =>
- if (!new File(keytab).exists()) {
- throw new IOException(s"${HA_ZK_AUTH_KEYTAB.key}: $keytab does not
exists")
- }
- System.setProperty("zookeeper.sasl.clientconfig",
"KyuubiZooKeeperClient")
- conf.get(HA_ZK_AUTH_SERVER_PRINCIPAL).foreach { zkServerPrincipal =>
- // ZOOKEEPER-1467 allows configuring SPN in client
- System.setProperty("zookeeper.server.principal", zkServerPrincipal)
- }
- val zkClientPrincipal = KyuubiHadoopUtils.getServerPrincipal(principal)
- val jaasConf = jaasConfigurationCache.computeIfAbsent(
- (principal, keytab),
- _ => {
- // HDFS-16591 makes breaking change on JaasConfiguration
- DynConstructors.builder()
- .impl( // Hadoop 3.3.5 and above
-
"org.apache.hadoop.security.authentication.util.JaasConfiguration",
- classOf[String],
- classOf[String],
- classOf[String])
- .impl( // Hadoop 3.3.4 and previous
- // scalastyle:off
-
"org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager$JaasConfiguration",
- // scalastyle:on
- classOf[String],
- classOf[String],
- classOf[String])
- .build[Configuration]()
- .newInstance("KyuubiZooKeeperClient", zkClientPrincipal, keytab)
- })
- Configuration.setConfiguration(jaasConf)
- case _ =>
- }
+ def setupZkAuth(
+ principalConfKey: ConfigEntry[Option[String]],
+ keytabConfKey: ConfigEntry[Option[String]]): Unit =
+ (conf.get(principalConfKey), getKeyTabFile(conf, keytabConfKey)) match {
+ case (Some(principal), Some(keytab)) if
UserGroupInformation.isSecurityEnabled =>
+ if (!new File(keytab).exists()) {
+ throw new IOException(s"${keytabConfKey.key}: $keytab does not
exists")
+ }
+ System.setProperty("zookeeper.sasl.clientconfig",
"KyuubiZooKeeperClient")
+ conf.get(HA_ZK_AUTH_SERVER_PRINCIPAL).foreach { zkServerPrincipal =>
+ // ZOOKEEPER-1467 allows configuring SPN in client
+ System.setProperty("zookeeper.server.principal", zkServerPrincipal)
+ }
+ val zkClientPrincipal =
KyuubiHadoopUtils.getServerPrincipal(principal)
+ val jaasConf = jaasConfigurationCache.computeIfAbsent(
+ (principal, keytab),
+ _ => {
+ // HDFS-16591 makes breaking change on JaasConfiguration
+ DynConstructors.builder()
+ .impl( // Hadoop 3.3.5 and above
+
"org.apache.hadoop.security.authentication.util.JaasConfiguration",
+ classOf[String],
+ classOf[String],
+ classOf[String])
+ .impl( // Hadoop 3.3.4 and previous
+ // scalastyle:off
+
"org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager$JaasConfiguration",
+ // scalastyle:on
+ classOf[String],
+ classOf[String],
+ classOf[String])
+ .build[Configuration]()
+ .newInstance("KyuubiZooKeeperClient", zkClientPrincipal,
keytab)
+ })
+ Configuration.setConfiguration(jaasConf)
+ case _ =>
+ }
Review Comment:
I set it up according to [IntelliJ IDEA Setup Guide — Apache
Kyuubi](https://kyuubi.readthedocs.io/en/master/contributing/code/idea_setup.html),
so I understand that this indentation is the result of automatic formatting.
(It’s possible that I misconfigured something, though.)
Do I need to intentionally disable this and adjust it manually?
--
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]