From 14dba45208d8a5511be2cf8ddf22e688ef141e88 Mon Sep 17 00:00:00 2001 From: Artur Sukhenko Date: Sat, 6 Aug 2016 04:41:47 +0100 Subject: [SPARK-16796][WEB UI] Mask spark.authenticate.secret on Spark environ… MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What changes were proposed in this pull request? Mask `spark.authenticate.secret` on Spark environment page (Web UI). This is addition to https://github.com/apache/spark/pull/14409 ## How was this patch tested? `./dev/run-tests` [info] ScalaTest [info] Run completed in 1 hour, 8 minutes, 38 seconds. [info] Total number of tests run: 2166 [info] Suites: completed 65, aborted 0 [info] Tests: succeeded 2166, failed 0, canceled 0, ignored 590, pending 0 [info] All tests passed. Author: Artur Sukhenko Closes #14484 from Devian-ua/SPARK-16796. --- core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala index 22136a6f10..9f6e9a6c90 100644 --- a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala @@ -27,7 +27,9 @@ private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("") private val listener = parent.listener private def removePass(kv: (String, String)): (String, String) = { - if (kv._1.toLowerCase.contains("password")) (kv._1, "******") else kv + if (kv._1.toLowerCase.contains("password") || kv._1.toLowerCase.contains("secret")) { + (kv._1, "******") + } else kv } def render(request: HttpServletRequest): Seq[Node] = { -- cgit v1.2.3