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: add i18n for disallow procedure (#10692)
boojack88fd8cfb7762
diff --git a/backend/plugin/advisor/code.go b/backend/plugin/advisor/code.goindex 248173283e..71874404fc 100644--- a/backend/plugin/advisor/code.go+++ b/backend/plugin/advisor/code.go@@ -140,7 +140,7 @@ const (// 1301 ~ 1399 comment error code.CommentTooLong Code = 1301- // 1401 ~ 1499 other common error code.+ // 1401 ~ 1499 procedure error code.DisallowProcedure Code = 1401)diff --git a/backend/plugin/advisor/config/sql-review.dev.yaml b/backend/plugin/advisor/config/sql-review.dev.yamlindex cb76f57ccd..8d21b4d3ad 100644--- a/backend/plugin/advisor/config/sql-review.dev.yaml+++ b/backend/plugin/advisor/config/sql-review.dev.yaml@@ -207,3 +207,5 @@ ruleList:level: WARNINGpayload:number: 64+ - type: system.procedure.disallow+ level: ERRORdiff --git a/backend/plugin/advisor/config/sql-review.prod.yaml b/backend/plugin/advisor/config/sql-review.prod.yamlindex dac0b3bd42..a94e6c3093 100644--- a/backend/plugin/advisor/config/sql-review.prod.yaml+++ b/backend/plugin/advisor/config/sql-review.prod.yaml@@ -207,3 +207,5 @@ ruleList:level: WARNINGpayload:number: 64+ - type: system.procedure.disallow+ level: ERRORdiff --git a/backend/plugin/advisor/mysql/test/procedure_disallow.yaml b/backend/plugin/advisor/mysql/test/system_procedure_disallow.yamlsimilarity index 92%rename from backend/plugin/advisor/mysql/test/procedure_disallow.yamlrename to backend/plugin/advisor/mysql/test/system_procedure_disallow.yamlindex 00d0db5c57..f5c34649b6 100644--- a/backend/plugin/advisor/mysql/test/procedure_disallow.yaml+++ b/backend/plugin/advisor/mysql/test/system_procedure_disallow.yaml@@ -14,7 +14,7 @@want:- status: WARNcode: 1401- title: procedure.disallow+ title: system.procedure.disallowcontent: |-Procedure is forbidden, but "CREATE PROCEDURE simpleProcedure()BEGINdiff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.goindex c497e65321..3fb1b68a34 100644--- a/backend/plugin/advisor/sql_review.go+++ b/backend/plugin/advisor/sql_review.go@@ -177,7 +177,7 @@ const (SchemaRuleCommentLength SQLReviewRuleType = "system.comment.length"// SchemaRuleDisallowProcedure disallow procedure.- SchemaRuleDisallowProcedure SQLReviewRuleType = "procedure.disallow"+ SchemaRuleDisallowProcedure SQLReviewRuleType = "system.procedure.disallow"// TableNameTemplateToken is the token for table name.TableNameTemplateToken = "{{table}}"diff --git a/frontend/src/components/Issue/const.ts b/frontend/src/components/Issue/const.tsindex bb92d91237..330068b7b3 100644--- a/frontend/src/components/Issue/const.ts+++ b/frontend/src/components/Issue/const.ts@@ -84,6 +84,7 @@ export const LocalizedSQLRuleErrorCodes = new Set<number>([SQLReviewPolicyErrorCode.INSERT_USE_ORDER_BY_RAND,SQLReviewPolicyErrorCode.DISABLED_COLLATION,SQLReviewPolicyErrorCode.COMMENT_TOO_LONG,+ SQLReviewPolicyErrorCode.CREATE_PROCEDURE,CompatibilityErrorCode.COMPATIBILITY_DROP_DATABASE,CompatibilityErrorCode.COMPATIBILITY_RENAME_TABLE,CompatibilityErrorCode.COMPATIBILITY_DROP_TABLE,diff --git a/frontend/src/locales/sql-review/en-US.json b/frontend/src/locales/sql-review/en-US.jsonindex c6e7da73ed..6e8a84f3b4 100644--- a/frontend/src/locales/sql-review/en-US.json+++ b/frontend/src/locales/sql-review/en-US.json@@ -443,6 +443,10 @@"title": "Maximum comment length"}}+ },+ "system-procedure-disallow": {+ "title": "Disallow to create procedures",+ "description": "This rule prohibits the execution of procedures within the database. System procedures often perform critical operations that could impact the stability and security of the database environment. By disallowing their execution, it helps prevent unintended changes and potential vulnerabilities. Suggested error level: Error"}},"level": {diff --git a/frontend/src/locales/sql-review/es-ES.json b/frontend/src/locales/sql-review/es-ES.jsonindex 5f3c1e621a..13c7610279 100644--- a/frontend/src/locales/sql-review/es-ES.json+++ b/frontend/src/locales/sql-review/es-ES.json@@ -444,11 +444,9 @@}}},- "level": {- "name": "Nivel de error",- "error": "Error",- "warning": "Advertencia",- "disabled": "Desactivado"+ "system-procedure-disallow": {+ "title": "Prohibir la ejecución de procedimientos del sistema",+ "description": "Los procedimientos del sistema pueden realizar operaciones de alto riesgo, como la eliminación de datos, la modificación de la estructura de la base de datos, etc. Nivel de error sugerido: Error"}},"level": {diff --git a/frontend/src/locales/sql-review/ja-JP.json b/frontend/src/locales/sql-review/ja-JP.jsonindex b945de0a56..a632330d14 100644--- a/frontend/src/locales/sql-review/ja-JP.json+++ b/frontend/src/locales/sql-review/ja-JP.json@@ -443,6 +443,10 @@"title": "最大コメント長"}}+ },+ "system-procedure-disallow": {+ "title": "システムプロシージャの実行を禁止する",+ "description": "システムプロシージャは、データベースのメタデータを変更するために使用されるため、誤って実行するとデータベースの整合性が失われる可能性があります。提案エラーレベル:エラー"}},"level": {diff --git a/frontend/src/locales/sql-review/vi-VN.json b/frontend/src/locales/sql-review/vi-VN.jsonindex 5eabae3fe9..52437880f2 100644--- a/frontend/src/locales/sql-review/vi-VN.json+++ b/frontend/src/locales/sql-review/vi-VN.json@@ -443,6 +443,10 @@"title": "Độ dài bình luận tối đa"}}+ },+ "system-procedure-disallow": {+ "title": "Cấm thực thi các thủ tục hệ thống",+ "description": "Cấm thực thi các thủ tục hệ thống. Mức độ lỗi đề xuất: Lỗi"}},"level": {diff --git a/frontend/src/locales/sql-review/zh-CN.json b/frontend/src/locales/sql-review/zh-CN.jsonindex 8950e094b5..8d275d27eb 100644--- a/frontend/src/locales/sql-review/zh-CN.json+++ b/frontend/src/locales/sql-review/zh-CN.json@@ -444,6 +444,10 @@"title": "注释长度上限"}}+ },+ "system-procedure-disallow": {+ "title": "禁止创建存储过程",+ "description": "存储过程通常会执行可能影响数据库环境稳定性和安全性的关键操作。禁止创建存储过程有助于防止意外更改和潜在漏洞。建议错误等级:错误"}},"level": {diff --git a/frontend/src/types/error.ts b/frontend/src/types/error.tsindex 4124fc2d6a..e8f1803b1a 100644--- a/frontend/src/types/error.ts+++ b/frontend/src/types/error.ts@@ -106,6 +106,7 @@ export enum SQLReviewPolicyErrorCode {INSERT_USE_ORDER_BY_RAND = 1108,DISABLED_COLLATION = 1201,COMMENT_TOO_LONG = 1301,+ CREATE_PROCEDURE = 1401,}export enum CompatibilityErrorCode {diff --git a/frontend/src/types/sql-review-schema.yaml b/frontend/src/types/sql-review-schema.yamlindex 90d71f0e46..984418898e 100644--- a/frontend/src/types/sql-review-schema.yaml+++ b/frontend/src/types/sql-review-schema.yaml@@ -723,3 +723,8 @@ ruleList:payload:type: NUMBERdefault: 64+ - type: system.procedure.disallow+ category: SYSTEM+ engineList:+ - MYSQL+ componentList: []diff --git a/frontend/src/types/sqlAdviceCode.ts b/frontend/src/types/sqlAdviceCode.tsindex ee4b40803d..3a8903ccef 100644--- a/frontend/src/types/sqlAdviceCode.ts+++ b/frontend/src/types/sqlAdviceCode.ts@@ -152,6 +152,10 @@ export enum SQLAdviceCodeComment {CommentTooLong = 1301,}+export enum SQLAdviceCodeProcedure {+ CreateProcedure = 1401,+}+export type SQLAdviceCode =| SQLAdviceCodeGeneral| SQLAdviceCodeCompatibilitydiff --git a/frontend/src/types/sqlReview.ts b/frontend/src/types/sqlReview.tsindex edd4b67877..1dd2029dbb 100644--- a/frontend/src/types/sqlReview.ts+++ b/frontend/src/types/sqlReview.ts@@ -152,6 +152,7 @@ export type RuleType =| "system.charset.allowlist"| "system.collation.allowlist"| "system.comment.length"+ | "system.procedure.disallow"| "index.no-duplicate-column"| "index.type-no-blob"| "index.key-number-limit"