Skip to content

Commit

Permalink
Hide useSSL Field from UI and fix unit test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipinofficial11 committed Oct 10, 2024
1 parent 87175f1 commit 8d62fb9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public OracleConnectorConfig(String host, int port, String user, String password

public OracleConnectorConfig(String host, int port, String user, String password, String jdbcPluginName,
String connectionArguments, String connectionType, String database,
String role, String useSSL) {
String role, Boolean useSSL) {

this.host = host;
this.port = port;
Expand Down Expand Up @@ -90,7 +90,7 @@ public String getConnectionString() {
@Name(OracleConstants.USE_SSL)
@Description("Turns on SSL encryption. Connection will fail if SSL is not available")
@Nullable
public String useSSL;
public Boolean useSSL;

@Override
protected int getDefaultPort() {
Expand All @@ -109,7 +109,7 @@ public String getDatabase() {
return database;
}

public String getSSlMode() {
public Boolean getSSlMode() {
return useSSL;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public static String getConnectionString(String connectionType,
@Nullable String host,
@Nullable int port,
String database,
@Nullable String useSSL) {
@Nullable Boolean useSSL) {
// Use protocol as "tcps" when SSL is requested or else use "tcp".
String connectionProtocol;
if (useSSL != null && useSSL.equalsIgnoreCase("yes")) {
if (useSSL != null && useSSL) {
connectionProtocol = "tcps";
} else {
connectionProtocol = "tcp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public OracleSourceConfig(String host, int port, String user, String password, S
String connectionArguments, String connectionType, String database, String role,
int defaultBatchValue, int defaultRowPrefetch,
String importQuery, Integer numSplits, int fetchSize,
String boundingQuery, String splitBy, String useSSL) {
String boundingQuery, String splitBy, Boolean useSSL) {
this.connection = new OracleConnectorConfig(host, port, user, password, jdbcPluginName, connectionArguments,
connectionType, database, role, useSSL);
this.defaultBatchValue = defaultBatchValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class OracleFailedConnectionTest extends DBSpecificFailedConnectionTest {
public void test() throws ClassNotFoundException, IOException {

OracleConnector connector = new OracleConnector(
new OracleConnectorConfig("localhost", 1521, "username", "password", "jdbc", "", "database"));
new OracleConnectorConfig("localhost", 1521, "username", "password", "jdbc", "",
"SID", "database"));

super.test(JDBC_DRIVER_CLASS_NAME, connector, "Failed to create connection to database via connection string:" +
" jdbc:oracle:thin:@tcp:localhost:1521/database and arguments: " +
Expand Down
20 changes: 20 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsink.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@
"default": "TRANSACTION_SERIALIZABLE"
}
},
{
"widget-type": "hidden",
"label": "TLS Encryption",
"name": "useSSL",
"description": "Enable TLS encryption (true/false)",
"widget-attributes": {
"layout": "inline",
"default": "false",
"options": [
{
"id": "true",
"label": "true"
},
{
"id": "false",
"label": "false"
}
]
}
},
{
"name": "connectionType",
"label": "Connection Type",
Expand Down
20 changes: 20 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsource.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@
"default": "TRANSACTION_SERIALIZABLE"
}
},
{
"widget-type": "hidden",
"label": "TLS Encryption",
"name": "useSSL",
"description": "Enable TLS encryption (true/false)",
"widget-attributes": {
"layout": "inline",
"default": "false",
"options": [
{
"id": "true",
"label": "true"
},
{
"id": "false",
"label": "false"
}
]
}
},
{
"name": "connectionType",
"label": "Connection Type",
Expand Down

0 comments on commit 8d62fb9

Please sign in to comment.