Skip to content

Commit

Permalink
[SW-1353] Expose jks_alias in Sparkling Water (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubhava authored Jun 19, 2019
1 parent 8a24ab7 commit 7ec9439
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ trait SharedBackendConf {
def isFailOnUnsupportedSparkParamEnabled = sparkConf.getBoolean(PROP_FAIL_ON_UNSUPPORTED_SPARK_PARAM._1, PROP_FAIL_ON_UNSUPPORTED_SPARK_PARAM._2)
def jks = sparkConf.getOption(PROP_JKS._1)
def jksPass = sparkConf.getOption(PROP_JKS_PASS._1)
def jksAlias = sparkConf.getOption(PROP_JKS_ALIAS._1)
def hashLogin = sparkConf.getBoolean(PROP_HASH_LOGIN._1, PROP_HASH_LOGIN._2)
def ldapLogin = sparkConf.getBoolean(PROP_LDAP_LOGIN._1, PROP_LDAP_LOGIN._2)
def kerberosLogin = sparkConf.getBoolean(PROP_KERBEROS_LOGIN._1, PROP_KERBEROS_LOGIN._2)
Expand Down Expand Up @@ -116,6 +117,7 @@ trait SharedBackendConf {

def setJks(path: String) = set(PROP_JKS._1, path)
def setJksPass(password: String) = set(PROP_JKS_PASS._1, password)
def setJksAlias(alias: String) = set(PROP_JKS_ALIAS._1, alias)

def setHashLoginEnabled() = set(PROP_HASH_LOGIN._1, true)
def setHashLoginDisabled() = set(PROP_HASH_LOGIN._1, false)
Expand Down Expand Up @@ -222,6 +224,9 @@ object SharedBackendConf {
/** Password for Java KeyStore file. */
val PROP_JKS_PASS = ("spark.ext.h2o.jks.pass", None)

/** Alias for certificate in keystore to secure Flow */
val PROP_JKS_ALIAS = ("spark.ext.h2o.jks.alias", None)

/** Enable hash login. */
val PROP_HASH_LOGIN = ("spark.ext.h2o.hash.login", false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private[backends] trait SharedBackendUtils extends Logging with Serializable {
.add("-port", Some(conf.clientWebPort).filter(_ > 0))
.add("-jks", conf.jks)
.add("-jks_pass", conf.jksPass)
.add("-jks_alias", conf.jksAlias)
.add("-network", conf.clientNetworkMask)
.addIf("-ip", conf.clientIp, conf.clientNetworkMask.isEmpty)
.buildArgs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Configuration properties independent of selected backend
+----------------------------------------------------+----------------+----------------------------------------+
| ``spark.ext.h2o.jks.pass`` | ``None`` | Password for Java KeyStore file. |
+----------------------------------------------------+----------------+----------------------------------------+
| ``spark.ext.h2o.jks.alias`` | ``None`` | Alias to certificate in keystore to |
| | | secure H2O Flow. |
+----------------------------------------------------+----------------+----------------------------------------+
| ``spark.ext.h2o.hash.login`` | ``false`` | Enable hash login. |
+----------------------------------------------------+----------------+----------------------------------------+
| ``spark.ext.h2o.ldap.login`` | ``false`` | Enable LDAP login. |
Expand Down
7 changes: 7 additions & 0 deletions py/pysparkling/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def set_jks_pass(self, password):
self._jconf.setJksPass(password)
return self

def set_jks_alias(self, alias):
self._jconf.setJksAlias(alias)
return self

def set_hash_login_enabled(self):
self._jconf.setHashLoginEnabled()
return self
Expand Down Expand Up @@ -448,6 +452,9 @@ def jks(self):
def jks_pass(self):
return self._get_option(self._jconf.jksPass())

def jks_alias(self):
return self._get_option(self._jconf.jksAlias())

def hash_login(self):
return self._jconf.hashLogin()

Expand Down

0 comments on commit 7ec9439

Please sign in to comment.