turboFei commented on code in PR #6608:
URL: https://github.com/apache/kyuubi/pull/6608#discussion_r1716076392
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/AuthenticationProviderFactory.scala:
##########
@@ -55,6 +55,32 @@ object AuthenticationProviderFactory {
case _ => throw new AuthenticationException("Not a valid authentication
method")
}
+ def getBasicAuthenticationProvider(
+ method: AuthMethod,
+ conf: KyuubiConf): PasswdAuthenticationProvider = method match {
+ case AuthMethods.NONE => new AnonymousAuthenticationProviderImpl
+ case AuthMethods.LDAP => new LdapAuthenticationProviderImpl(conf)
+ case AuthMethods.JDBC => new JdbcAuthenticationProviderImpl(conf)
+ case AuthMethods.CUSTOM =>
+ val className = conf.get(KyuubiConf.AUTHENTICATION_CUSTOM_BASIC_CLASS)
+ if (className.isEmpty) {
+ throw new AuthenticationException(
+ "authentication.custom.basic.class must be set when auth method was
CUSTOM.")
+ }
+ ClassUtils.createInstance(className.get,
classOf[PasswdAuthenticationProvider], conf)
+ case _ => throw new AuthenticationException("Not a valid authentication
method")
+ }
+
+ def getTokenAuthenticationProvider(
+ providerClass: String,
+ conf: KyuubiConf): TokenAuthenticationProvider = {
+ if (providerClass.isEmpty) {
+ throw new AuthenticationException(
+ "authentication.custom.bearer.class must be set when auth method was
BEARER.")
Review Comment:
`authentication.custom.bearer.class must be set for token authentication`.
--
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]