Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update
d-bytebase5f86ca3f6773
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.goindex 7e9aef565f..d50a3e1aae 100644--- a/backend/api/v1/instance_service.go+++ b/backend/api/v1/instance_service.go@@ -871,6 +871,9 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Upcase "warehouse_id":dataSource.WarehouseID = request.DataSource.WarehouseIdpatch.WarehouseID = &request.DataSource.WarehouseId+ case "use_ssl":+ dataSource.UseSSL = request.DataSource.UseSsl+ patch.UseSSL = &request.DataSource.UseSsldefault:return nil, status.Errorf(codes.InvalidArgument, `unsupport update_mask "%s"`, path)}@@ -1180,6 +1183,7 @@ func convertToV1DataSources(dataSources []*store.DataSourceMessage) ([]*v1pb.DatDirectConnection: ds.DirectConnection,Region: ds.Region,WarehouseId: ds.WarehouseID,+ UseSsl: ds.UseSSL,})}diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.goindex 17e5d5d5db..aeaf052c8c 100644--- a/backend/component/dbfactory/dbfactory.go+++ b/backend/component/dbfactory/dbfactory.go@@ -206,6 +206,7 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.InsUsername: dataSource.Username,Password: password,TLSConfig: db.TLSConfig{+ UseSSL: dataSource.UseSSL,SslCA: sslCA,SslCert: sslCert,SslKey: sslKey,diff --git a/backend/plugin/db/ssl.go b/backend/plugin/db/ssl.goindex 4d7824395a..3d4b083885 100644--- a/backend/plugin/db/ssl.go+++ b/backend/plugin/db/ssl.go@@ -9,6 +9,7 @@ import (// TLSConfig is the configuration for SSL connection.type TLSConfig struct {+ UseSSL boolSslCA stringSslCert stringSslKey stringdiff --git a/backend/store/data_source.go b/backend/store/data_source.goindex 114fe4f92b..986da77bcb 100644--- a/backend/store/data_source.go+++ b/backend/store/data_source.go@@ -53,6 +53,7 @@ type DataSourceMessage struct {Region stringAccountID stringWarehouseID string+ UseSSL bool}// Copy returns a copy of the data source message.@@ -86,6 +87,7 @@ func (m *DataSourceMessage) Copy() *DataSourceMessage {ReplicaSet: m.ReplicaSet,DirectConnection: m.DirectConnection,Region: m.Region,+ UseSSL: m.UseSSL,}}@@ -130,6 +132,7 @@ type UpdateDataSourceMessage struct {Region *stringAccountID *stringWarehouseID *string+ UseSSL *bool}func (*Store) listDataSourceV2(ctx context.Context, tx *Tx, instanceID string) ([]*DataSourceMessage, error) {@@ -199,6 +202,7 @@ func (*Store) listDataSourceV2(ctx context.Context, tx *Tx, instanceID string) (dataSourceMessage.Region = dataSourceOptions.RegiondataSourceMessage.AccountID = dataSourceOptions.AccountIddataSourceMessage.WarehouseID = dataSourceOptions.WarehouseId+ dataSourceMessage.UseSSL = dataSourceOptions.UseSsldataSourceMessages = append(dataSourceMessages, &dataSourceMessage)}if err := rows.Err(); err != nil {@@ -369,6 +373,9 @@ func (s *Store) UpdateDataSourceV2(ctx context.Context, patch *UpdateDataSourceMif v := patch.WarehouseID; v != nil {optionSet, args = append(optionSet, fmt.Sprintf("jsonb_build_object('warehouseId', $%d::TEXT)", len(args)+1)), append(args, *v)}+ if v := patch.UseSSL; v != nil {+ optionSet, args = append(optionSet, fmt.Sprintf("jsonb_build_object('useSsl', $%d::TEXT)", len(args)+1)), append(args, *v)+ }if len(optionSet) != 0 {set = append(set, fmt.Sprintf(`options = options || %s`, strings.Join(optionSet, "||")))}@@ -427,6 +434,7 @@ func (*Store) addDataSourceToInstanceImplV2(ctx context.Context, tx *Tx, instancRegion: dataSource.Region,WarehouseId: dataSource.WarehouseID,AccountId: dataSource.AccountID,+ UseSsl: dataSource.UseSSL,}protoBytes, err := protojson.Marshal(&dataSourceOptions)if err != nil {