HyukjinKwon commented on code in PR #49880:
URL: https://github.com/apache/spark/pull/49880#discussion_r1954272416
##########
sql/connect/common/src/main/scala/org/apache/spark/sql/connect/common/config/ConnectCommon.scala:
##########
@@ -16,9 +16,23 @@
*/
package org.apache.spark.sql.connect.common.config
+import io.grpc.Metadata
+
private[sql] object ConnectCommon {
val CONNECT_GRPC_BINDING_PORT: Int = 15002
val CONNECT_GRPC_PORT_MAX_RETRIES: Int = 0
val CONNECT_GRPC_MAX_MESSAGE_SIZE: Int = 128 * 1024 * 1024
val CONNECT_GRPC_MARSHALLER_RECURSION_LIMIT: Int = 1024
+ val AUTH_TOKEN_META_DATA_KEY: Metadata.Key[String] =
+ Metadata.Key.of("Authentication", Metadata.ASCII_STRING_MARSHALLER)
+
+ val CONNECT_LOCAL_AUTH_TOKEN_ENV_NAME = "SPARK_CONNECT_LOCAL_AUTH_TOKEN"
+ private var CONNECT_LOCAL_AUTH_TOKEN: Option[String] = Option(
+ System.getenv(CONNECT_LOCAL_AUTH_TOKEN_ENV_NAME))
+ def setLocalAuthToken(token: String): Unit = CONNECT_LOCAL_AUTH_TOKEN =
Option(token)
+ def getLocalAuthToken: Option[String] = CONNECT_LOCAL_AUTH_TOKEN
+ def assertLocalAuthToken(token: Option[String]): Unit = token.foreach { t =>
+ assert(CONNECT_LOCAL_AUTH_TOKEN.isDefined)
Review Comment:
For other places, I will fix it later. But here assert is correct because if
`token` is set, `CONNECT_LOCAL_AUTH_TOKEN` must be set to for local usage.
--
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]