Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/15971#discussion_r89365624 --- Diff: core/src/test/scala/org/apache/spark/util/UtilsSuite.scala --- @@ -974,4 +974,28 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { assert(pValue > threshold) } + + test("redact sensitive information") { + val sparkConf = new SparkConf + + // Set some secret keys + val secretKeys = Seq("" + + "spark.executorEnv.HADOOP_CREDSTORE_PASSWORD", + "spark.my.password", + "spark.my.sECreT") + secretKeys.foreach { key => + sparkConf.set(key, "secret_password") + } + // Set a non-secret key + sparkConf.set("spark.regular.property", "not_a_secret") + + // Redact sensitive information + val redactedConf = Utils.redact(sparkConf, sparkConf.getAll).toMap + + // Assert that secret information got redacted while the regular property remained the same + secretKeys.foreach { key => + assert(redactedConf.get(key).get == Utils.REDACTION_REPLACEMENT_TEXT) --- End diff -- `assert(conf(key) === ...)`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org