From 1945c34a7525e1d2faddf96ef56c4394c2688627 Mon Sep 17 00:00:00 2001 From: fwang12 Date: Sat, 23 Oct 2021 23:33:06 +0800 Subject: [PATCH] fix style --- .../authentication/HadoopThriftAuthBridgeServer.scala | 7 ++++--- .../scala/org/apache/kyuubi/operation/JDBCTestUtils.scala | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/HadoopThriftAuthBridgeServer.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/HadoopThriftAuthBridgeServer.scala index 898e84808cb..4aa8ba7be77 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/HadoopThriftAuthBridgeServer.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/HadoopThriftAuthBridgeServer.scala @@ -20,8 +20,10 @@ package org.apache.kyuubi.service.authentication import java.io.IOException import java.net.InetAddress import java.security.PrivilegedAction +import java.util.Locale import javax.security.auth.callback._ import javax.security.sasl.{AuthorizeCallback, RealmCallback} + import org.apache.commons.codec.binary.Base64 import org.apache.hadoop.fs.FileSystem import org.apache.hadoop.security.{SaslRpcServer, UserGroupInformation} @@ -30,9 +32,8 @@ import org.apache.hadoop.security.token.SecretManager.InvalidToken import org.apache.thrift.{TException, TProcessor} import org.apache.thrift.protocol.TProtocol import org.apache.thrift.transport._ -import org.apache.kyuubi.Logging -import java.util.Locale +import org.apache.kyuubi.Logging class HadoopThriftAuthBridgeServer(secretMgr: KyuubiDelegationTokenManager) { import HadoopThriftAuthBridgeServer._ @@ -145,7 +146,7 @@ object HadoopThriftAuthBridgeServer { val mechanismName = saslServer.getMechanismName USER_AUTH_MECHANISM.set(mechanismName) if (mechanismName.toUpperCase(Locale.ROOT).startsWith( - AuthMethod.PLAIN.getMechanismName)) { + AuthMethod.PLAIN.getMechanismName.toUpperCase(Locale.ROOT))) { REMOTE_USER.set(endUser) wrapped.process(in, out) } else { diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala index 2cac5b9dd70..a38bc97e9f2 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala @@ -63,9 +63,7 @@ trait JDBCTestUtils extends KyuubiFunSuite { } } - protected def jdbcUrlWithConf(): String = jdbcUrlWithConf(jdbcUrl) - - protected def jdbcUrlWithConf(jdbcUrl: String): String = { + protected def jdbcUrlWithConf: String = { val sessionConfStr = sessionConfigs.map(kv => kv._1 + "=" + kv._2).mkString(";") val sparkHiveConfStr = if (sparkHiveConfigs.isEmpty) { ""