Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0dc75fe
implement JDBC Authentication Method
bowenliang123 Aug 15, 2022
0e7f0ad
refactor config and init process.remove unused import.
bowenliang123 Aug 15, 2022
996f796
add unit test in JdbcAuthenticationProviderImplSuite
bowenliang123 Aug 15, 2022
49c18c2
update
bowenliang123 Aug 15, 2022
df4be56
update code style
bowenliang123 Aug 15, 2022
7025330
fix derby startup error in test
bowenliang123 Aug 15, 2022
46cc1dd
add config docs in docs/deployment/settings.md
bowenliang123 Aug 15, 2022
15176b2
fix import orders
bowenliang123 Aug 15, 2022
cd2c7c2
update settings.md config doc
bowenliang123 Aug 15, 2022
1dc4187
update settings.md config doc
bowenliang123 Aug 15, 2022
575301c
update options usage
bowenliang123 Aug 15, 2022
30974d1
update format
bowenliang123 Aug 15, 2022
3672919
fix ddl statement and remove truncate statement in test
bowenliang123 Aug 16, 2022
cdec206
more test cases
bowenliang123 Aug 16, 2022
653bc12
add more checks for query sql
bowenliang123 Aug 16, 2022
aeb19ce
update doc
bowenliang123 Aug 16, 2022
b9ffac3
Merge branch 'master' into feature-jdbc-auth-provider
bowenliang123 Aug 16, 2022
9885f81
add JDBC condition for getValidPasswordAuthMethod
bowenliang123 Aug 16, 2022
4ebe12e
add JDBC value to AuthTypes enum
bowenliang123 Aug 16, 2022
1c956df
update KyuubiAuthenticationFactorySuite
bowenliang123 Aug 16, 2022
5a0ac49
output password length only in checkConfigs
bowenliang123 Aug 16, 2022
3a4d5fe
update checkConfigs() signature
bowenliang123 Aug 16, 2022
a4fe582
refactor connection creation on using HikariDataSource in HikariCP. a…
bowenliang123 Aug 16, 2022
543c66c
prefer scala style string usage
bowenliang123 Aug 16, 2022
6765aff
changed to use in-memory derby db for test
bowenliang123 Aug 16, 2022
77f5f86
remove unuseful comment
bowenliang123 Aug 16, 2022
a9404fa
use {} for intercept
bowenliang123 Aug 16, 2022
6fc42bf
code styling
bowenliang123 Aug 16, 2022
e9af096
use clone instead of repeatly generating configs
bowenliang123 Aug 16, 2022
d5f43e0
remove unuseful logs for unrecognized placeholder error
bowenliang123 Aug 16, 2022
17403b3
cleanup docs
bowenliang123 Aug 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use {} for intercept
  • Loading branch information
bowenliang123 committed Aug 16, 2022
commit a9404fa30e9b6a23a2117599188448573b3f9a91
Original file line number Diff line number Diff line change
Expand Up @@ -82,45 +82,50 @@ class JdbcAuthenticationProviderImplSuite extends KyuubiFunSuite {

providerImpl.authenticate(authUser, authPasswd)

val e1 = intercept[AuthenticationException](providerImpl.authenticate("", ""))
val e1 = intercept[AuthenticationException]{
providerImpl.authenticate("", "")
}
assert(e1.getMessage.contains("user is null"))

val e2 = intercept[AuthenticationException](providerImpl.authenticate("kyuubi", ""))
val e2 = intercept[AuthenticationException]{
providerImpl.authenticate("kyuubi", "")
}
assert(e2.getMessage.contains("password is null"))

val e4 = intercept[AuthenticationException](
providerImpl.authenticate(authPasswd, "pass"))
val e4 = intercept[AuthenticationException]{
providerImpl.authenticate(authPasswd, "pass")
}
assert(e4.isInstanceOf[AuthenticationException])

conf = genJdbcAuthConfigs
conf.unset(AUTHENTICATION_JDBC_URL)
val e5 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e5 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e5.getMessage.contains("JDBC url is not configured"))

conf = genJdbcAuthConfigs
conf.unset(AUTHENTICATION_JDBC_USERNAME)
val e6 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e6 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e6.getMessage.contains("JDBC username or password is not configured"))

conf = genJdbcAuthConfigs
conf.unset(AUTHENTICATION_JDBC_PASSWORD)
val e7 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e7 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e7.getMessage.contains("JDBC username or password is not configured"))

conf = genJdbcAuthConfigs
conf.unset(AUTHENTICATION_JDBC_QUERY)
val e8 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e8 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e8.getMessage.contains("Query SQL is not configured"))

conf.set(
AUTHENTICATION_JDBC_QUERY,
"INSERT INTO user_auth (username, password) " +
" VALUES ('demouser','demopassword'); ")
val e9 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e9 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e9.getMessage.contains("Query SQL must start with \"SELECT\""))

conf.unset(AUTHENTICATION_JDBC_URL)
val e10 = intercept[IllegalArgumentException](new JdbcAuthenticationProviderImpl(conf))
val e10 = intercept[IllegalArgumentException]{new JdbcAuthenticationProviderImpl(conf)}
assert(e10.getMessage.contains("JDBC url is not configured"))
}

Expand Down