vanzin commented on a change in pull request #25477: [SPARK-28760][SS][TESTS] 
Add Kafka delegation token end-to-end test with mini KDC
URL: https://github.com/apache/spark/pull/25477#discussion_r317786944
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala
 ##########
 @@ -334,19 +451,39 @@ class KafkaTestUtils(withBrokerProps: Map[String, 
Object] = Map.empty) extends L
     props.put("transaction.state.log.replication.factor", "1")
     props.put("transaction.state.log.min.isr", "1")
 
+    if (secure) {
+      props.put("listeners", "SASL_PLAINTEXT://127.0.0.1:0")
+      props.put("advertised.listeners", "SASL_PLAINTEXT://127.0.0.1:0")
+      props.put("inter.broker.listener.name", "SASL_PLAINTEXT")
+      props.put("delegation.token.master.key", UUID.randomUUID().toString)
+      props.put("sasl.enabled.mechanisms", "GSSAPI,SCRAM-SHA-512")
+    }
+
     // Can not use properties.putAll(propsMap.asJava) in scala-2.12
     // See https://github.com/scala/bug/issues/10418
     withBrokerProps.foreach { case (k, v) => props.put(k, v) }
     props
   }
 
+  private def adminClientConfiguration: Properties = {
+    val props = new Properties()
 
 Review comment:
   You could have a `createConfig` method or something that creates a new 
`Properties` and automatically does the things that 
`setDynamicJaasConfiguration` does if `secure` is true, so you don't have to 
remember to call that everywhere.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to