hvanhovell commented on code in PR #49880:
URL: https://github.com/apache/spark/pull/49880#discussion_r1952689474
##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala:
##########
@@ -366,10 +367,14 @@ object SparkConnectService extends Logging {
val debugMode =
SparkEnv.get.conf.getBoolean("spark.connect.grpc.debug.enabled", true)
val bindAddress = SparkEnv.get.conf.get(CONNECT_GRPC_BINDING_ADDRESS)
val startPort = SparkEnv.get.conf.get(CONNECT_GRPC_BINDING_PORT)
+ val localAuthToken =
System.getenv(ConnectCommon.CONNECT_LOCAL_AUTH_TOKEN_ENV_NAME)
+ ConnectCommon.setLocalAuthToken(localAuthToken)
val sparkConnectService = new SparkConnectService(debugMode)
val protoReflectionService =
if (debugMode) Some(ProtoReflectionService.newInstance()) else None
- val configuredInterceptors =
SparkConnectInterceptorRegistry.createConfiguredInterceptors()
+ val configuredInterceptors =
+ SparkConnectInterceptorRegistry.createConfiguredInterceptors() ++
+ (if (localAuthToken != null) Seq(new LocalAuthInterceptor()) else Nil)
Review Comment:
Just pass in the token as an argument to the `LocalAuthInterceptor`, there
is absolute no reason for putting this in some global variable...
--
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]