Skip to content

Commit 1fcedc6

Browse files
Merge pull request #589 from actiontech/commit/data-masking
feat: refactor data masking module
2 parents 471a36b + fd8f0c8 commit 1fcedc6

37 files changed

Lines changed: 5927 additions & 497 deletions

.github/workflows/check-pr-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ jobs:
1212
name: Prevent file change
1313
with:
1414
githubToken: ${{ secrets.GITHUB_TOKEN }}
15-
pattern: ^(?!.*_ee\.go$)(?!.*_ee_test\.go$)(?!.*_ee\.yml$)(?!.*_rel\.go$)(?!.*_rel_test\.go$)(?!go\.mod$)(?!go\.sum$)(?!\.github\/workflows\/check-pr-files\.yml$)(?!vendor\/.*)(?!.*_qa\.go$).*
15+
pattern: ^(?!.*_ee\.go$)(?!.*_ee_test\.go$)(?!.*_ee\.md$)(?!.*_ee\.yml$)(?!.*_rel\.go$)(?!.*_rel_test\.go$)(?!go\.mod$)(?!go\.sum$)(?!\.github\/workflows\/check-pr-files\.yml$)(?!vendor\/.*)(?!.*_qa\.go$).*
1616
trustedAuthors: xalvarez

api/dms/service/v1/db_service.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ type DBService struct {
4545
Desc string `json:"desc"`
4646
// SQLE config
4747
SQLEConfig *dmsCommonV1.SQLEConfig `json:"sqle_config"`
48-
// data masking switch
49-
// Required: false
50-
IsEnableMasking bool `json:"is_enable_masking"`
5148
// backup switch
5249
// Required: false
5350
EnableBackup bool `json:"enable_backup"`
@@ -202,9 +199,6 @@ type UpdateDBService struct {
202199
Desc *string `json:"desc"`
203200
// SQLE config
204201
SQLEConfig *dmsCommonV1.SQLEConfig `json:"sqle_config"`
205-
// data masking switch
206-
// Required: false
207-
IsEnableMasking bool `json:"is_enable_masking"`
208202
// backup switch
209203
// Required: false
210204
EnableBackup bool `json:"enable_backup"`
@@ -328,8 +322,6 @@ type ImportDBService struct {
328322
SQLEConfig *dmsCommonV1.SQLEConfig `json:"sqle_config"`
329323
// DB Service Custom connection parameters
330324
AdditionalParams []*dmsCommonV1.AdditionalParam `json:"additional_params"`
331-
// is enable masking
332-
IsEnableMasking bool `json:"is_enable_masking"`
333325
}
334326

335327
// swagger:model
@@ -450,6 +442,23 @@ type ListGlobalDBService struct {
450442
LastConnectionTestErrorMessage string `json:"last_connection_test_error_message,omitempty"`
451443
}
452444

445+
// swagger:enum FunctionSupportType
446+
type FunctionSupportType string
447+
448+
const (
449+
// FunctionSupportTypeDataMasking 数据脱敏功能
450+
FunctionSupportTypeDataMasking FunctionSupportType = "data_masking"
451+
)
452+
453+
// swagger:parameters ListGlobalDBServicesTips
454+
type ListGlobalDBServicesTipsReq struct {
455+
// function support filter, when specified, returns the db types supported by the function
456+
// in: query
457+
// enum: data_masking
458+
// Example: data_masking
459+
FunctionSupport FunctionSupportType `query:"function_support" json:"function_support" validate:"omitempty,oneof=data_masking"`
460+
}
461+
453462
// swagger:model ListGlobalDBServicesTipsReply
454463
type ListGlobalDBServicesTipsReply struct {
455464
// List global db service tips reply
@@ -460,5 +469,8 @@ type ListGlobalDBServicesTipsReply struct {
460469
}
461470

462471
type ListGlobalDBServiceTips struct {
472+
// DBType 数据库类型列表
473+
// 当请求参数 function_support 为空时,返回所有数据库类型
474+
// 当请求参数 function_support 有效时,仅返回支持该功能的数据库类型
463475
DBType []string `json:"db_type"`
464476
}

0 commit comments

Comments
 (0)