You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/01/25 02:10:35 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1813: Enable the internal secure authentication between Kyuubi server and engine

ulysses-you commented on a change in pull request #1813:
URL: https://github.com/apache/incubator-kyuubi/pull/1813#discussion_r791300041



##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
##########
@@ -1070,6 +1070,59 @@ object KyuubiConf {
       .stringConf
       .createWithDefault("engine_operation_logs")
 
+  val ENGINE_SECURE_ENABLED: ConfigEntry[Boolean] =
+    buildConf("engine.secure.enabled")
+      .doc("Whether to enable the internal secure access between Kyuubi server and engine.")
+      .version("1.5.0")
+      .booleanConf
+      .createWithDefault(false)
+
+  val ENGINE_SECURE_TOKEN_MAX_LIFETIME: ConfigEntry[Long] =
+    buildConf("engine.secure.token.max.lifetime")
+      .doc("The max lifetime of the token used for secure access between Kyuubi server and engine.")
+      .version("1.5.0")
+      .timeConf
+      .createWithDefault(Duration.ofMinutes(10).toMillis)
+
+  val ENGINE_SECURE_SECRET_PROVIDER: ConfigEntry[String] =
+    buildConf("engine.secure.secret.provider")
+      .doc("The class used to manage the engine secure access secret. This class must be a " +
+        "subclass of EngineSecureAccessSecretProvider.")

Review comment:
       seems the class name `EngineSecureAccessSecretProvider` is wrong.

##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
##########
@@ -1070,6 +1070,59 @@ object KyuubiConf {
       .stringConf
       .createWithDefault("engine_operation_logs")
 
+  val ENGINE_SECURE_ENABLED: ConfigEntry[Boolean] =
+    buildConf("engine.secure.enabled")

Review comment:
       security ?

##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/AuthenticationProviderFactory.scala
##########
@@ -30,6 +30,10 @@ object AuthenticationProviderFactory {
   def getAuthenticationProvider(
       method: AuthMethod,
       conf: KyuubiConf): PasswdAuthenticationProvider = method match {
+    case _
+        if conf.get(KyuubiConf.ENGINE_SECURE_ENABLED) &&
+          !EngineSecureAccessor.get().isServer =>
+      new EngineSecureAuthenticationProviderImpl

Review comment:
       the key here is `isServer` so can we make it clearly like:
   ```
   def getAuthenticationProvider(
         method: AuthMethod,
         conf: KyuubiConf): PasswdAuthenticationProvider = {
     if (isServer) {
        getAuthenticationProviderForServer()
     } else {
        getAuthenticationProviderForEngine()
     }
   
   }
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org