Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15971#discussion_r89408959
--- Diff: core/src/test/scala/org/apache/spark/util/UtilsSuite.scala ---
@@ -974,4 +974,24 @@ 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(key) ==
Utils.REDACTION_REPLACEMENT_TEXT) }
+ assert(redactedConf("spark.regular.property") == "not_a_secret")
--- End diff --
`===`
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]