-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-45408][CORE] Add RPC SSL settings to TransportConf
### What changes were proposed in this pull request? This change adds new settings to `TransportConf` which are needed for the RPC SSL functionality to work. Additionally, add some sample configurations which are used by tests in follow up PRs (see #42685 for the full context) ### Why are the changes needed? These changes are needed so that other modules can easily access configurations, and that the sample configurations are easily accessible for tests. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added a test, then ran: ``` ./build/sbt > project network-common > testOnly org.apache.spark.network.TransportConfSuite ``` There are more follow up tests coming (see #42685) ### Was this patch authored or co-authored using generative AI tooling? No Closes #43220 from hasnain-db/spark-tls-configs-low. Authored-by: Hasnain Lakhani <hasnain.lakhani@databricks.com> Signed-off-by: Mridul Muralidharan <mridul<at>gmail.com>
- Loading branch information
1 parent
e8eb245
commit f1e9dc2
Showing
3 changed files
with
475 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
common/network-common/src/test/java/TransportConfSuite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.spark.network; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import org.apache.spark.network.util.TransportConf; | ||
import org.apache.spark.network.ssl.SslSampleConfigs; | ||
|
||
public class TransportConfSuite { | ||
|
||
private TransportConf transportConf = | ||
new TransportConf( | ||
"shuffle", SslSampleConfigs.createDefaultConfigProviderForRpcNamespace()); | ||
|
||
@Test | ||
public void testKeyStorePath() { | ||
assertEquals(new File(SslSampleConfigs.keyStorePath), transportConf.sslRpcKeyStore()); | ||
} | ||
|
||
@Test | ||
public void testPrivateKeyPath() { | ||
assertEquals(new File(SslSampleConfigs.privateKeyPath), transportConf.sslRpcPrivateKey()); | ||
} | ||
|
||
@Test | ||
public void testCertChainPath() { | ||
assertEquals(new File(SslSampleConfigs.certChainPath), transportConf.sslRpcCertChain()); | ||
} | ||
|
||
@Test | ||
public void testTrustStorePath() { | ||
assertEquals(new File(SslSampleConfigs.trustStorePath), transportConf.sslRpcTrustStore()); | ||
} | ||
|
||
@Test | ||
public void testTrustStoreReloadingEnabled() { | ||
assertFalse(transportConf.sslRpcTrustStoreReloadingEnabled()); | ||
} | ||
|
||
@Test | ||
public void testOpenSslEnabled() { | ||
assertFalse(transportConf.sslRpcOpenSslEnabled()); | ||
} | ||
|
||
@Test | ||
public void testSslRpcEnabled() { | ||
assertTrue(transportConf.sslRpcEnabled()); | ||
} | ||
|
||
|
||
@Test | ||
public void testSslKeyStorePassword() { | ||
assertEquals("password", transportConf.sslRpcKeyStorePassword()); | ||
} | ||
|
||
@Test | ||
public void testSslKeyPassword() { | ||
assertEquals("password", transportConf.sslRpcKeyPassword()); | ||
} | ||
|
||
@Test | ||
public void testSslTrustStorePassword() { | ||
assertEquals("password", transportConf.sslRpcTrustStorePassword()); | ||
} | ||
|
||
@Test | ||
public void testSsltrustStoreReloadIntervalMs() { | ||
assertEquals(10000, transportConf.sslRpctrustStoreReloadIntervalMs()); | ||
} | ||
} |
Oops, something went wrong.