Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14409#discussion_r72908182
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala 
---
    @@ -26,11 +26,17 @@ import org.apache.spark.ui.{UIUtils, WebUIPage}
     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")) {
    +      return (kv._1, "******")
    +    }
    +    kv
    +  }
       def render(request: HttpServletRequest): Seq[Node] = {
         val runtimeInformationTable = UIUtils.listingTable(
           propertyHeader, jvmRow, listener.jvmInformation, fixedWidth = true)
         val sparkPropertiesTable = UIUtils.listingTable(
    -      propertyHeader, propertyRow, listener.sparkProperties, fixedWidth = 
true)
    +      propertyHeader, propertyRow, 
listener.sparkProperties.map(removePass), fixedWidth = true)
    --- End diff --
    
    This may be just taste, but isn't this easier inline?
    
    ```
    val redactedProperties = listener.sparkProperties.map { case (key, value) 
=> 
      (key, if (key.toLowerCase.contains("password")) "******" else value)
    }
    ```
    
    Are there any other instances where properties are displayed that need 
redacting?


---
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]

Reply via email to