HeartSaVioR commented on a change in pull request #24170: [SPARK-26998][CORE]
Add secure alternatives of ssl password parameters
URL: https://github.com/apache/spark/pull/24170#discussion_r268030160
##########
File path: core/src/main/scala/org/apache/spark/SSLOptions.scala
##########
@@ -231,5 +230,45 @@ private[spark] object SSLOptions extends Logging {
enabledAlgorithms)
}
+ private def getPassword(
+ conf: SparkConf,
+ hadoopConf: Configuration,
+ ns: String,
+ parameter: String,
+ default: Option[String]): Option[String] = {
+ var parameterValue = conf.getWithSubstitution(s"$ns.$parameter")
+ .orElse(Option(hadoopConf.getPassword(s"$ns.$parameter")).map(new
String(_)))
+ .orElse(default)
+ if (parameterValue.isDefined && default.isDefined && parameterValue.get !=
default.get) {
Review comment:
I have no idea so I'm asking, Is there a case which default can be `None`?
If then I guess we also need to warn if `(parameterValue.isDefined &&
!default.isDefined)` is true.
One liner (but long) would be `if (parameterValue.isDefined &&
(!default.isDefined || (parameterValue.get != default.get)))`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]