Skip to content

api definition: data masking#575

Open
winfredLIN wants to merge 2 commits intomainfrom
commit/data-masking
Open

api definition: data masking#575
winfredLIN wants to merge 2 commits intomainfrom
commit/data-masking

Conversation

@winfredLIN
Copy link
Collaborator

@winfredLIN winfredLIN commented Mar 2, 2026

关联的 issue

https://github.com/actiontech/dms-ee/issues/736

描述你的变更

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

@LordofAvernus LordofAvernus requested review from iwanghc and removed request for iwanghc March 2, 2026 09:05
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Swagger 枚举格式

在新增的 Swagger 定义中,部分枚举字段的格式存在疑问,例如枚举值写为 "[IMMEDIATE" 与 " PERIODIC]",这种括号包含的格式可能并非预期格式,建议仔细检查并确认各枚举字段的定义符合预期,从而确保生成的 API 文档正确无误。

execution_plan:
    description: |-
        execution plan
        IMMEDIATE SensitiveDataDiscoveryExecutionPlanImmediate
        PERIODIC SensitiveDataDiscoveryExecutionPlanPeriodic
    enum:
        - '[IMMEDIATE'
        - ' PERIODIC]'
    example: '"IMMEDIATE"'
    type: string
    x-go-enum-desc: |-
        IMMEDIATE SensitiveDataDiscoveryExecutionPlanImmediate
        PERIODIC SensitiveDataDiscoveryExecutionPlanPeriodic
    x-go-name: ExecutionPlan
identification_method:
    description: |-
        sensitive data identification method
        BY_FIELD_NAME SensitiveDataIdentificationMethodByFieldName
        BY_SAMPLE_DATA SensitiveDataIdentificationMethodBySampleData
    enum:
        - '[BY_FIELD_NAME'
        - ' BY_SAMPLE_DATA]'
    example: '"BY_FIELD_NAME"'
    type: string
    x-go-enum-desc: |-
        BY_FIELD_NAME SensitiveDataIdentificationMethodByFieldName
        BY_SAMPLE_DATA SensitiveDataIdentificationMethodBySampleData
    x-go-name: IdentificationMethod
masking_template_id:
    description: masking template id
    example: 1

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
替换错误数组关键字

建议将数组类型的验证关键字minLength更换为minItems,以符合JSON Schema中数组验证的标准要求。此修改能确保数组最少包含一个元素,防止验证错误。

api/swagger.yaml [168-178]

 rule_ids:
             description: masking rule id list
             example:
                 - 1
                 - 2
                 - 3
             items:
                 format: int64
                 type: integer
-            minLength: 1
+            minItems: 1
             type: array
Suggestion importance[1-10]: 9

__

Why: The suggestion replaces the incorrect minLength with minItems for the array in rule_ids, ensuring adherence to JSON Schema standards and preventing potential validation errors.

High
修正枚举值格式

建议去除枚举值中的多余字符和空格,将枚举值修正为合法的字符串(例如 "IMMEDIATE" 和
"PERIODIC")。类似问题在其他枚举字段中也可能存在,需逐一修复以防数据校验错误。

api/swagger.yaml [380-393]

 execution_plan:
             description: |-
                 execution plan
                 IMMEDIATE SensitiveDataDiscoveryExecutionPlanImmediate
                 PERIODIC SensitiveDataDiscoveryExecutionPlanPeriodic
             enum:
-                - '[IMMEDIATE'
-                - ' PERIODIC]'
+                - "IMMEDIATE"
+                - "PERIODIC"
             example: '"IMMEDIATE"'
             type: string
             x-go-enum-desc: |-
                 IMMEDIATE SensitiveDataDiscoveryExecutionPlanImmediate
                 PERIODIC SensitiveDataDiscoveryExecutionPlanPeriodic
             x-go-name: ExecutionPlan
Suggestion importance[1-10]: 8

__

Why: The suggestion removes extraneous characters and spaces from the enum values in execution_plan, ensuring that only valid strings ("IMMEDIATE" and "PERIODIC") are used, which improves schema validation.

Medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant