feat: added key pair auth for snowflake behind feature flag (#34399)

This commit is contained in:
Aman Agarwal 2024-06-25 13:30:46 +05:30 committed by GitHub
parent 3a8139e3be
commit 8a68347952
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 95 additions and 17 deletions

View File

@ -771,6 +771,7 @@ class DatasourceEditorRouter extends React.Component<Props, State> {
const {
datasource,
datasourceId,
featureFlags,
formConfig,
formData,
formName,
@ -817,6 +818,7 @@ class DatasourceEditorRouter extends React.Component<Props, State> {
applicationId={this.props.applicationId}
currentEnvironment={this.getEnvironmentId()}
datasourceId={datasourceId}
featureFlags={featureFlags}
formConfig={formConfig}
formData={formData}
formName={DATASOURCE_DB_FORM}

View File

@ -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})

View File

@ -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"
}
]
}
}
]
}
]
}
}