diff --git a/app/client/src/pages/Editor/DataSourceEditor/index.tsx b/app/client/src/pages/Editor/DataSourceEditor/index.tsx index 8115be6413..1857103ed5 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/index.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/index.tsx @@ -771,6 +771,7 @@ class DatasourceEditorRouter extends React.Component { const { datasource, datasourceId, + featureFlags, formConfig, formData, formName, @@ -817,6 +818,7 @@ class DatasourceEditorRouter extends React.Component { applicationId={this.props.applicationId} currentEnvironment={this.getEnvironmentId()} datasourceId={datasourceId} + featureFlags={featureFlags} formConfig={formConfig} formData={formData} formName={DATASOURCE_DB_FORM} diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DBAuth.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DBAuth.java index 8b0c7dac8b..57bbaa86de 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DBAuth.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DBAuth.java @@ -26,7 +26,8 @@ public class DBAuth extends AuthenticationDTO { SCRAM_SHA_1, SCRAM_SHA_256, MONGODB_CR, - USERNAME_PASSWORD + USERNAME_PASSWORD, + KEY_PAIR } @JsonView({Views.Public.class, FromRequest.class}) diff --git a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/form.json b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/form.json index 22d35af3b4..ed57c461bb 100644 --- a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/form.json +++ b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/form.json @@ -49,27 +49,102 @@ "id": 2, "children": [ { - "sectionName": null, - "children": [ + "label": "Authentication type", + "configProperty": "datasourceConfiguration.authentication.authType", + "controlType": "DROP_DOWN", + "isRequired": true, + "initialValue": "USERNAME_PASSWORD", + "options": [ { - "label": "Username", - "configProperty": "datasourceConfiguration.authentication.username", - "controlType": "INPUT_TEXT", - "placeholderText": "Username", - "isRequired": true + "label": "USERNAME_PASSWORD", + "value": "USERNAME_PASSWORD" }, { - "label": "Password", - "configProperty": "datasourceConfiguration.authentication.password", - "dataType": "PASSWORD", - "controlType": "INPUT_TEXT", - "placeholderText": "Password", - "isRequired": true, - "encrypted": true + "label": "KEY_PAIR", + "value": "KEY_PAIR" } - ] + ], + "hidden": { + "flagValue": "release_snowflake_key_pair_auth_enabled", + "comparison": "FEATURE_FLAG", + "value": false + } + }, + { + "label": "Username", + "configProperty": "datasourceConfiguration.authentication.username", + "controlType": "INPUT_TEXT", + "placeholderText": "Username", + "isRequired": true + }, + { + "label": "Password", + "configProperty": "datasourceConfiguration.authentication.password", + "dataType": "PASSWORD", + "controlType": "INPUT_TEXT", + "placeholderText": "Password", + "isRequired": true, + "encrypted": true, + "hidden": { + "conditionType": "OR", + "conditions": [ + { + "flagValue": "release_snowflake_key_pair_auth_enabled", + "comparison": "FEATURE_FLAG", + "value": true + }, + { + "path": "datasourceConfiguration.authentication.authType", + "comparison": "NOT_EQUALS", + "value": "USERNAME_PASSWORD" + } + ] + } + }, + { + "label": "Private key", + "configProperty": "datasourceConfiguration.authentication.privateKey", + "controlType": "FILE_PICKER", + "isRequired": true, + "encrypted": true, + "hidden": { + "conditionType": "OR", + "conditions": [ + { + "flagValue": "release_snowflake_key_pair_auth_enabled", + "comparison": "FEATURE_FLAG", + "value": false + }, + { + "path": "datasourceConfiguration.authentication.authType", + "comparison": "NOT_EQUALS", + "value": "KEY_PAIR" + } + ] + } + }, + { + "label": "Private key passphrase", + "configProperty": "datasourceConfiguration.authentication.passphrase", + "controlType": "INPUT_TEXT", + "placeholderText": "private key passphrase", + "hidden": { + "conditionType": "OR", + "conditions": [ + { + "flagValue": "release_snowflake_key_pair_auth_enabled", + "comparison": "FEATURE_FLAG", + "value": false + }, + { + "path": "datasourceConfiguration.authentication.authType", + "comparison": "NOT_EQUALS", + "value": "KEY_PAIR" + } + ] + } } ] } ] -} +} \ No newline at end of file