[KYUUBI #3701] Allow JDBC authencation to connect auth db with no user name
### _Why are the changes needed?_ to close #3701 . ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3702 from bowenliang123/3701-jdbc-auth. Closes #3701 7a04d091 [Bowen Liang] skip not empty checking for kyuubi.authentication.jdbc.user config Authored-by: Bowen Liang <liangbowen@gf.com.cn> Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
parent
738e35100a
commit
010cfdfcd5
@ -108,8 +108,7 @@ class JdbcAuthenticationProviderImpl(conf: KyuubiConf) extends PasswdAuthenticat
|
||||
// Check if JDBC parameters valid
|
||||
require(driverClass.nonEmpty, "JDBC driver class is not configured.")
|
||||
require(authDbJdbcUrl.nonEmpty, "JDBC url is not configured.")
|
||||
require(authDbUser.nonEmpty, "JDBC user is not configured.")
|
||||
// allow empty auth db password
|
||||
// allow empty auth db user or password
|
||||
require(authQuery.nonEmpty, "Query SQL is not configured")
|
||||
|
||||
val query = authQuery.get.trim.toLowerCase
|
||||
|
||||
@ -104,11 +104,6 @@ class JdbcAuthenticationProviderImplSuite extends KyuubiFunSuite {
|
||||
val e5 = intercept[IllegalArgumentException] { new JdbcAuthenticationProviderImpl(_conf) }
|
||||
assert(e5.getMessage.contains("JDBC url is not configured"))
|
||||
|
||||
_conf = conf.clone
|
||||
_conf.unset(AUTHENTICATION_JDBC_USER)
|
||||
val e6 = intercept[IllegalArgumentException] { new JdbcAuthenticationProviderImpl(_conf) }
|
||||
assert(e6.getMessage.contains("JDBC user is not configured"))
|
||||
|
||||
_conf = conf.clone
|
||||
_conf.unset(AUTHENTICATION_JDBC_QUERY)
|
||||
val e8 = intercept[IllegalArgumentException] { new JdbcAuthenticationProviderImpl(_conf) }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user