-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29957][TEST] Reset MiniKDC's default enctypes to fit jdk8/jdk11 #26594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
e9ef3ba
3ec2891
2e282f2
a224fad
3456ff9
dfdf589
7ab6192
476d60e
b782e99
10a0006
03f7fb1
e252dd0
4facbee
223533f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,14 +17,15 @@ | |
|
|
||
| package org.apache.spark.sql.kafka010 | ||
|
|
||
| import java.io.{File, IOException} | ||
| import java.io.{File, IOException, PrintWriter} | ||
| import java.net.{InetAddress, InetSocketAddress} | ||
| import java.nio.charset.StandardCharsets | ||
| import java.util.{Collections, Properties, UUID} | ||
| import java.util.concurrent.TimeUnit | ||
| import javax.security.auth.login.Configuration | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
| import scala.io.Source | ||
| import scala.util.Random | ||
|
|
||
| import com.google.common.io.Files | ||
|
|
@@ -136,9 +137,33 @@ class KafkaTestUtils( | |
| kdcConf.setProperty(MiniKdc.DEBUG, "true") | ||
| kdc = new MiniKdc(kdcConf, kdcDir) | ||
| kdc.start() | ||
| rewriteKrb5Conf() | ||
| kdcReady = true | ||
| } | ||
|
|
||
| private def rewriteKrb5Conf(): Unit = { | ||
| val krb5Conf = Source.fromFile(kdc.getKrb5conf, "UTF-8").getLines() | ||
dongjoon-hyun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| val rewriteKrb5Conf = krb5Conf.map(s => | ||
| if (s.contains("libdefaults")) { | ||
| val addedConfig = | ||
| addedKrb5Config("default_tkt_enctypes", "aes128-cts-hmac-sha1-96") + | ||
| addedKrb5Config("default_tgs_enctypes", "aes128-cts-hmac-sha1-96") | ||
| s + addedConfig | ||
| } else { | ||
| s | ||
| }) | ||
| kdc.getKrb5conf.delete() | ||
| val writer = new PrintWriter(kdc.getKrb5conf) | ||
| // scalastyle:off println | ||
| rewriteKrb5Conf.foreach(writer.println) | ||
| // scalastyle:on println | ||
| writer.close() | ||
|
||
| } | ||
|
|
||
| private def addedKrb5Config(key: String, value: String): String = { | ||
| System.lineSeparator() + s" $key=$value" | ||
| } | ||
|
|
||
| private def createKeytabsAndJaasConfigFile(): String = { | ||
| assert(kdcReady, "KDC should be set up beforehand") | ||
| val baseDir = Utils.createTempDir() | ||
|
|
@@ -171,6 +196,7 @@ class KafkaTestUtils( | |
| | useKeyTab=true | ||
| | storeKey=true | ||
| | useTicketCache=false | ||
| | refreshKrb5Config=true | ||
AngersZhuuuu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | keyTab="${zkServerKeytabFile.getAbsolutePath()}" | ||
| | principal="$zkServerUser@$realm"; | ||
| |}; | ||
|
|
@@ -180,6 +206,7 @@ class KafkaTestUtils( | |
| | useKeyTab=true | ||
| | storeKey=true | ||
| | useTicketCache=false | ||
| | refreshKrb5Config=true | ||
| | keyTab="${zkClientKeytabFile.getAbsolutePath()}" | ||
| | principal="$zkClientUser@$realm"; | ||
| |}; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.