From 561cd58f20fd23ddda4e378858be34750e4b025d Mon Sep 17 00:00:00 2001 From: wklken Date: Tue, 19 Nov 2024 16:24:56 +0800 Subject: [PATCH] fix(fixtures/plugins.yaml): new plugins validation (#1113) --- .../apigateway/apis/web/plugin/views.py | 2 - .../apigateway/common/plugin/checker.py | 3 + .../apigateway/common/plugin/convertor.py | 5 + .../apigateway/common/plugin/normalizer.py | 40 + .../apigateway/common/plugin/validator.py | 10 +- .../apigateway/data/version_log/CHANGELOG.md | 84 ++ .../data/version_log/CHANGELOG_en.md | 84 ++ .../apigateway/fixtures/plugins.yaml | 51 +- .../locale/en/LC_MESSAGES/django.mo | Bin 39535 -> 36771 bytes .../locale/en/LC_MESSAGES/django.po | 820 ++++++++---------- .../tests/apis/web/metrics/test_views.py | 2 +- .../tests/apis/web/plugin/test_views.py | 3 +- .../tests/common/plugin/test_normalizer.py | 35 + 13 files changed, 654 insertions(+), 485 deletions(-) create mode 100644 src/dashboard/apigateway/apigateway/common/plugin/normalizer.py create mode 100644 src/dashboard/apigateway/apigateway/tests/common/plugin/test_normalizer.py diff --git a/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py b/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py index 8ec9685de..76b359d3f 100644 --- a/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py +++ b/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py @@ -329,7 +329,6 @@ class PluginConfigRetrieveUpdateDestroyApi( lookup_field = "id" def _check_if_changed(self, input_data: Dict[str, Any], instance: PluginConfig) -> bool: - try: input_yaml = yaml_loads(input_data["yaml"]) current_yaml = yaml_loads(instance.yaml) @@ -351,7 +350,6 @@ def perform_update(self, serializer): self.validate_code(type_id=serializer.validated_data["type_id"]) if self._check_if_changed(dict(serializer.validated_data), serializer.instance): - data_before = get_model_dict(serializer.instance) super().perform_update(serializer) diff --git a/src/dashboard/apigateway/apigateway/common/plugin/checker.py b/src/dashboard/apigateway/apigateway/common/plugin/checker.py index 52b70bd0b..bed6bb691 100644 --- a/src/dashboard/apigateway/apigateway/common/plugin/checker.py +++ b/src/dashboard/apigateway/apigateway/common/plugin/checker.py @@ -40,6 +40,8 @@ ) from apigateway.utils.yaml import yaml_loads +from .normalizer import format_fault_injection_config + VARS_ALLOWED_COMPARISON_SYMBOLS = {"==", "~=", ">", ">=", "<", "<=", "~~", "~*", "in", "has", "!", "ipmatch"} @@ -195,6 +197,7 @@ def check(self, payload: str): if not loaded_data: raise ValueError("YAML cannot be empty") + loaded_data = format_fault_injection_config(loaded_data) abort_data = loaded_data.get("abort") delay_data = loaded_data.get("delay") diff --git a/src/dashboard/apigateway/apigateway/common/plugin/convertor.py b/src/dashboard/apigateway/apigateway/common/plugin/convertor.py index 7bb8df69e..dd60d679e 100644 --- a/src/dashboard/apigateway/apigateway/common/plugin/convertor.py +++ b/src/dashboard/apigateway/apigateway/common/plugin/convertor.py @@ -26,6 +26,8 @@ from apigateway.apps.plugin.constants import PluginTypeCodeEnum from apigateway.utils.ip import parse_ip_content_to_list +from .normalizer import format_fault_injection_config + class PluginConvertor(ABC): plugin_type_code: ClassVar[PluginTypeCodeEnum] @@ -145,6 +147,9 @@ class FaultInjectionConvertor(PluginConvertor): plugin_type_code: ClassVar[PluginTypeCodeEnum] = PluginTypeCodeEnum.FAULT_INJECTION def convert(self, config: Dict[str, Any]) -> Dict[str, Any]: + # NOTE: while the dynamic form textarea would pass here, we should clean it up + config = format_fault_injection_config(config) + if config.get("abort"): abort = config["abort"] if abort.get("vars"): diff --git a/src/dashboard/apigateway/apigateway/common/plugin/normalizer.py b/src/dashboard/apigateway/apigateway/common/plugin/normalizer.py new file mode 100644 index 000000000..f7a9f140b --- /dev/null +++ b/src/dashboard/apigateway/apigateway/common/plugin/normalizer.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# +# TencentBlueKing is pleased to support the open source community by making +# 蓝鲸智云 - API 网关(BlueKing - APIGateway) available. +# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. +# Licensed under the MIT License (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://opensource.org/licenses/MIT +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language governing permissions and +# limitations under the License. +# +# We undertake not to change the open source license (MIT license) applicable +# to the current version of the project delivered to anyone in the future. +# +from typing import Any, Dict + + +def format_fault_injection_config(config: Dict[str, Any]) -> Dict[str, Any]: + """while the dynamic form input many empty values, should be normalized!""" + if config.get("abort"): + abort = config["abort"] + if abort.get("body") == "": + del abort["body"] + if abort.get("vars") == "": + del abort["vars"] + if not abort: + del config["abort"] + + if config.get("delay"): + delay = config["delay"] + if delay.get("vars") == "": + del delay["vars"] + if not delay: + del config["delay"] + + return config diff --git a/src/dashboard/apigateway/apigateway/common/plugin/validator.py b/src/dashboard/apigateway/apigateway/common/plugin/validator.py index a7850a8ea..b76d3d5fa 100644 --- a/src/dashboard/apigateway/apigateway/common/plugin/validator.py +++ b/src/dashboard/apigateway/apigateway/common/plugin/validator.py @@ -1,6 +1,6 @@ # # TencentBlueKing is pleased to support the open source community by making -# 蓝鲸智云 - API 网关(BlueKing - APIGateway) available. +# 蓝鲸智云 - API 网关 (BlueKing - APIGateway) available. # Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the MIT License (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -39,6 +39,10 @@ def validate(self, plugin_type_code: str, payload: str, schema: Optional[Dict] = :param payload: 插件 yaml 格式配置字符串 :param schema: 插件 schema 规则 """ + # 校验 apisix 额外规则,这个报错的可读性更好,有一些 json schema 中的报错信息不够直观可以重复在这里处理 + checker = PluginConfigYamlChecker(plugin_type_code) + checker.check(payload) + # 校验 schema 规则 if schema: convertor = PluginConvertorFactory.get_convertor(plugin_type_code) @@ -46,7 +50,3 @@ def validate(self, plugin_type_code: str, payload: str, schema: Optional[Dict] = validate(convertor.convert(yaml_loads(payload)), schema=schema) except JsonSchemaValidationError as err: raise ValueError(f"{err.message}, path {list(err.absolute_path)}") - - # 校验 apisix 额外规则 - checker = PluginConfigYamlChecker(plugin_type_code) - checker.check(payload) diff --git a/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG.md b/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG.md index dfc4f9d59..4e09b7161 100644 --- a/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG.md +++ b/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG.md @@ -1,3 +1,87 @@ + +# V1.15.0 版本更新日志 + +### 功能优化 + +- 运行数据-统计报表:整体页面重构 +- 权限管理-应用权限: 整体页面重构,合并了两种授权维度成一个列表页/导出 +- 网关/组件API 文档和 网关/组件SDK合并成一个页面: API 文档,需测试所有功能 +- 优化日志查询页面:搜索历史/图标选中缩小范围 +- 优化在线调试页面 +- 资源版本:支持生成java sdk +- 资源配置:支持启用 websocket +- 资源维度新增 4 个插件:mock/熔断/请求校验/故障注入,需要测试功能; +- 升级底层django以及所有依赖库到最新版本 + +--- + + +# V1.14.5 版本更新日志 + +### 缺陷修复 + +- 修复资源配置页 + - 搜索后页码错误的问题 + - 资源配置表格高度问题 +- 修复流水日志 + - 新增日志查询的搜索历史 + - 日志查询语法报错问题 + - 流水日志导出数据为空问题 +- 修复在线调试 headers 切换重置问题 +- 修复资源文档上传失败的问题 +- 修复发布环境校验的后端配置问题 +- 更新 bkui 以修复 xss 漏洞 +- 修复在线调试:响应状态码颜色细分 +- 修复网关基本信息:维护人员文本的 tooltips +- 优化资源版本对比展示 + +--- + + +# V1.14.4 版本更新日志 + +### 缺陷修复 + +- 修复在线调试错误的校验 + +--- + + +# V1.14.3 版本更新日志 + +### 缺陷修复 + +- 修复编辑插件时说明消失的问题 +- 文档导入 zip 上传失败提示 +- XSS 漏洞修复 + +--- + + +# V1.14.2 版本更新日志 + +### 缺陷修复 + +- 资源导入官网文档链接错误 +- open api 资源同步支持 delete + +--- + + +# V1.14.1 版本更新日志 + +### 缺陷修复 + +- 环境概览:资源插件列表合并耗时太长 +- 修复确认离开已编辑表单的页面后仍出现提示弹窗的问题 + +### 功能优化 + +- 禁止选中并发布 schema v1 资源版本 +- 规范化文档中心跳转链接 + +--- + # V1.14.0 版本更新日志 diff --git a/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG_en.md b/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG_en.md index 811165049..41895ed00 100644 --- a/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG_en.md +++ b/src/dashboard/apigateway/apigateway/data/version_log/CHANGELOG_en.md @@ -1,3 +1,87 @@ + +# V1.15.0 Release Log + +### Features + +- Data Operation - Statistical Report: Complete page redesign. +- Permission Management - Application Permissions: Full page redesign, merging two permission dimensions into a single list page/export. +- Gateway/Component API Documentation and Gateway/Component SDK: Merged into a single page, API Documentation, with all functions needing testing. +- Optimized Log Query Page: Search history/icon selection to narrow scope. +- Optimized Online Debugging Page. +- Resource Version: Support for generating Java SDK. +- Resource Configuration: Support for enabling WebSocket. +- Added 4 new plugins to Resource Dimension: Mock, Circuit Breaker, Request Validation, and Fault Injection, with functionality needing testing. +- Upgraded the underlying Django framework and all dependency libraries to the latest version. + +--- + + +# V1.14.5 Release Log + +### Bug Fixes + +- Fixed issues on the resource configuration page + - Incorrect page number after search + - Resource configuration table height issue +- Fixed issues in pipeline logs + - Added search history for log queries + - Syntax error in log queries + - Data export issue resulting in empty logs +- Fixed issue with header reset when switching in online debugging +- Fixed the issue with resource documentation upload failure +- Fixed backend configuration issues for environment validation during publishing +- Updated bkui to fix XSS vulnerabilities +- Fixed online debugging: refined response status code color differentiation +- Fixed gateway basic information: tooltips for maintenance personnel text +- Optimized resource version comparison display + +--- + + +# V1.14.4 Release Log + +### Bug Fixes + +- Fixed incorrect validation in online debugging + +--- + + +# V1.14.3 Release Log + +### Bug Fixes + +- Fixed the issue where the description disappears when editing a plugin +- Error notification for failed ZIP uploads during document import +- XSS vulnerability fix + +--- + + +# V1.14.2 Release Log + +### Bug Fixes + +- Fixed incorrect official documentation link for resource import +- Added support for delete operation in OpenAPI resource synchronization + +--- + + +# V1.14.1 Release Log + +### Bug Fixes + +- Environment Overview: Resource plugin list merge takes too long +- Fixed issue where a prompt dialog still appears after leaving a page with an edited form + +### Features + +- Prohibit selecting and publishing schema v1 resource versions +- Standardize documentation center redirect links + +--- + # V1.14.0 Release Log diff --git a/src/dashboard/apigateway/apigateway/fixtures/plugins.yaml b/src/dashboard/apigateway/apigateway/fixtures/plugins.yaml index f551f68fd..6d358a353 100644 --- a/src/dashboard/apigateway/apigateway/fixtures/plugins.yaml +++ b/src/dashboard/apigateway/apigateway/fixtures/plugins.yaml @@ -128,7 +128,10 @@ "type": "string", "pattern": "^(|\\*|\\*\\*|null|http(s)?://[-a-zA-Z0-9:\\[\\]\\.]+(,http(s)?://[-a-zA-Z0-9:\\[\\]\\.]+)*)$", "maxLength": 4096, - "default": "" + "default": "", + "ui:props": { + "labelWidth": 200 + } }, "allow_origins_by_regex": { "description": "使用正则表示的允许跨域访问的 Origin,示例如 '^https://.*\\.example\\.com:8081$',此正则允许 https://a.example.com:8081, https://b.example.com:8081。allow_origins、allow_origins_by_regex 只能一个有效。", @@ -142,6 +145,9 @@ }, "ui:component": { "name": "bfArray" + }, + "ui:props": { + "labelWidth": 200 } }, "allow_methods": { @@ -152,7 +158,10 @@ "maxLength": 100, "ui:rules": [ "required" - ] + ], + "ui:props": { + "labelWidth": 200 + } }, "allow_headers": { "description": "允许跨域访问时请求方携带哪些非 CORS 规范 以外的 Header。如果你有多个 Header,请使用 , 分割。当 allow_credential 为 false 时,可以使用 * 来表示允许所有 Header 通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Header 都通过,但请注意这样存在安全隐患。", @@ -162,14 +171,20 @@ "maxLength": 4096, "ui:rules": [ "required" - ] + ], + "ui:props": { + "labelWidth": 200 + } }, "expose_headers": { "description": "允许跨域访问时响应方携带哪些非 CORS 规范 以外的 Header。如果你有多个 Header,请使用 , 分割。当 allow_credential 为 false 时,可以使用 * 来表示允许任意 Header。你也可以在启用了 allow_credential 后使用 ** 强制允许任意 Header,但请注意这样存在安全隐患。", "type": "string", "pattern": "^(|\\*|\\*\\*|[-a-zA-Z0-9]+(,[-a-zA-Z0-9]+)*)$", "maxLength": 4096, - "default": "" + "default": "", + "ui:props": { + "labelWidth": 200 + } }, "max_age": { "description": "浏览器缓存 CORS 结果的最大时间,单位为秒。在这个时间范围内,浏览器会复用上一次的检查结果,-1 表示不缓存。请注意各个浏览器允许的最大时间不同。", @@ -182,12 +197,18 @@ "name": "bfInput", "min": -1, "unit": "秒" + }, + "ui:props": { + "labelWidth": 200 } }, "allow_credential": { "description": "是否允许跨域访问的请求方携带凭据(如 Cookie 等)。根据 CORS 规范,如果设置该选项为 true,那么将不能在其他属性中使用 *。", "type": "boolean", - "default": true + "default": true, + "ui:props": { + "labelWidth": 200 + } } } }, @@ -1267,7 +1288,7 @@ - model: plugin.plugintype fields: code: bk-status-rewrite - name: 网关错误使用HTTP状态码200(不推荐) + name: 网关错误使用 HTTP 状态码 200(不推荐) name_en: Gateway error using HTTP status code 200 (not recommended) is_public: false schema: null @@ -1354,7 +1375,7 @@ - model: plugin.plugintype fields: code: bk-verified-user-exempted-apps - name: 免用户认证应用白名单(不推荐) + name: 免用户认证应用白名单 (不推荐) name_en: Exempted user auth apps white list (not recommended) is_public: false scope: stage @@ -1987,8 +2008,8 @@ language: '' type: - request-validation - notes: 用于提前验证向上游服务转发的请求。该插件使用 JSON Schema 机制进行数据验证,可以验证请求的 Body 以及 Header 的数据。 - example: '作用:当请求体中没有包含 boolean_payload 时,则返回 400 拒绝状态码和拒绝信息\n\n"header_schema": {}\n"body_schema": {"type": "object","required": ["bool_payload"],"properties": {"bool_payload": {"type": "boolean"}}}\n"rejected_code": 400\n"rejected_msg": "not valid request body"' + notes: 用于提前验证向上游服务转发的请求。该插件使用 JSON Schema 机制进行数据验证,可以验证请求的 Body 以及 Header 的数据。至少需要配置 body_schema 或 header_schema 中的一个,两者也可以同时使用。 + example: '作用:当请求体中没有包含 boolean_payload 时,则返回 400 拒绝状态码和拒绝信息\n\n"body_schema": {"type": "object","required": ["bool_payload"],"properties": {"bool_payload": {"type": "boolean"}}}\n"header_schema": {}\n"rejected_code": 400\n"rejected_msg": "not valid request body"' style: dynamic default_value: '' config: |- @@ -2041,8 +2062,8 @@ language: 'en' type: - request-validation - notes: Used to validate requests forwarded to upstream services in advance. The plug-in uses the JSON Schema mechanism for data validation, which validates the requested Body and Header data. - example: 'Purpose: When the boolean_payload argument is not filled, 400 reject status code and reject information are returned \n\n"header_schema": {}\n"body_schema": {"type": "object","required": ["bool_payload"],"properties": {"bool_payload": {"type": "boolean"}}}\n"rejected_code": 400\n"rejected_msg": "not valid request body"' + notes: Used to validate requests forwarded to upstream services in advance. The plug-in uses the JSON Schema mechanism for data validation, which validates the requested Body and Header data. At least one of the body_schema or header_schema needs to be configured, and both can be used at the same time. + example: 'Purpose: When the boolean_payload argument is not filled, 400 reject status code and reject information are returned \n\n"body_schema": {"type": "object","required": ["bool_payload"],"properties": {"bool_payload": {"type": "boolean"}}}\n"header_schema": {}\n"rejected_code": 400\n"rejected_msg": "not valid request body"' style: dynamic default_value: '' config: |- @@ -2170,8 +2191,8 @@ language: '' type: - fault-injection - notes: fault-injection 插件是故障注入插件,该插件可以和其他插件一起使用,并在其他插件执行前被执行。 - example: '作用:当请求参数 name 等于 jack 的时候,则返回 400 拒绝状态码和响应内容\n\n"abort": {\n "http_status": 400,\n "body": "not valid request params",\n "vars": [["arg_name", "==", "jack"]]\n}\n' + notes: fault-injection 插件是故障注入插件,该插件可以和其他插件一起使用,并在其他插件执行前被执行,至少要配置中断和延迟中的任意一个,两者也可以同时使用。 + example: '作用:当请求参数 name 等于 jack,并且 age 等于 18 的时候,则返回 400 拒绝状态码和响应内容\n\n"abort": {\n "http_status": 400,\n "body": "not valid request params",\n "vars": [[["arg_name", "==", "jack"], ["arg_age", "==", 18]]]\n}\n' style: dynamic default_value: '' config: |- @@ -2255,8 +2276,8 @@ language: en type: - fault-injection - notes: The fault-injection plug-in is a fault injection plug-in that can be used with other plug-ins and executed before the other plug-ins are executed. - example: 'Purpose: When the request parameter name is equal to jack, return 400 reject status code and response body \n\n"abort": {\n "http_status": 400,\n "body": "not valid request params",\n "vars": [["arg_name", "==", "jack"]]\n}\n' + notes: The fault-injection plug-in is a fault injection plug-in that can be used with other plug-ins and executed before the other plug-ins are executed. abort and delay must be configured at least one, and both can be used at the same time. + example: 'Purpose: When the request parameter name is equal to jack and age is 18, return 400 reject status code and response body \n\n"abort": {\n "http_status": 400,\n "body": "not valid request params",\n "vars": [[["arg_name", "==", "jack"], ["arg_age", "==", 18]]]\n}\n' style: dynamic default_value: '' config: |- diff --git a/src/dashboard/apigateway/apigateway/locale/en/LC_MESSAGES/django.mo b/src/dashboard/apigateway/apigateway/locale/en/LC_MESSAGES/django.mo index acdb0a5807cd55bef63a7313ada23e4d8efdc388..c410b7efa1cb56241b6b18895876200d48c6d183 100644 GIT binary patch delta 9900 zcmcK9cUV+c-oWuQAY#Fe*!9}5f`Yw^#sc}5^VRAXW`o9e4E2{XXDmW@d^F`M{)f867)yZi3*KJOpzeV!km^E>z6bIv{I+>7Pj zv7p^A26=8)FSAi`%(W<0AOBoYsb49dt0lEc9ciRgIXsG?cm^BeMXZ2@*bwhwGpuYV zm4F?v5-!9sn1@yH7DnKGtfQ1ih00hN$sLF};C>`(C`5`pOFJKtn(%wNQ`9qW^ ze}-1e;%b!Z3Q(SOyUq{l^JlOX^>66<+amp|pD6GUDx|sDPz$V198A4$SeATh3+BH(g(O{(fj!CHIzNgsuv1tU-^8VO3uVTV zTbgUX0!Na6f*mlDc|M7gu{&08ZQef&*{3R1yQ($wFCFZoLZ0|IO8$ZNICbU(mANfg?_8y|_iO?uBucd9~(S;aoZ-i zjWTstQD)$eI{y*rL;Z>};MUQqbY_R63}B+xhHN*L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-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: apigateway/apis/controller/permissions.py:37 -msgid "当前微网关实例无权限调用" -msgstr "No permission to access the microgateway instance" - -#: apigateway/apis/open/gateway/serializers.py:131 +#: apigateway/apis/open/gateway/serializers.py:133 #, python-brace-format msgid "api_type 为 {api_type} 时,网关名 name 需以 {prefix} 开头。" msgstr "" @@ -34,17 +30,45 @@ msgid "申请权限类型为 {grant_dimension} 时,参数 resource_ids 不能 msgstr "" "When grant_dimension is {grant_dimension}, resource_ids cannot be empty." -#: apigateway/apis/open/permission/serializers.py:150 +#: apigateway/apis/open/permission/serializers.py:186 #, python-brace-format msgid "应用【{app_code}】不能为其它应用【{value}】申请访问网关API的权限。" msgstr "App [{app_code}] cannot apply permission for other app [{value}]." -#: apigateway/apis/open/permission/serializers.py:304 +#: apigateway/apis/open/permission/serializers.py:340 #, python-brace-format msgid "资源【{resource_id}】已删除。" msgstr "Resource [{resource_id}] has been deleted." -#: apigateway/apis/open/resource_doc/views.py:59 +#: apigateway/apis/open/permissions.py:34 apigateway/apis/v2/permissions.py:33 +msgid "只能通过网关访问该接口" +msgstr "the api can be only accessed through the gateway" + +#: apigateway/apis/open/permissions.py:49 +msgid "只能通过网关访问该接口,并且 gateway_id 对应网关必须存在" +msgstr "the api can be only accessed through the gateway, additionally, the corresponding gateway_id must exist for the gateway" + +#: apigateway/apis/open/permissions.py:85 apigateway/apis/v2/permissions.py:48 +msgid "只能通过网关访问该接口,并且 gateway_name 对应网关必须存在" +msgstr "the api can be only accessed through the gateway, additionally, the corresponding gateway_name must exist for the gateway" + +#: apigateway/apis/open/permissions.py:120 apigateway/apis/v2/permissions.py:83 +msgid "应用无操作网关权限" +msgstr "App has no permission to access the gateway" + +#: apigateway/apis/open/resource/views.py:69 +#: apigateway/apis/web/resource/views.py:437 +#, python-brace-format +msgid "导入内容为无效的 json/yaml 数据,{err}。" +msgstr "Importing invalid json/yaml data, {err}." + +#: apigateway/apis/open/resource/views.py:77 +#: apigateway/apis/web/resource/views.py:496 +#, python-brace-format +msgid "validate err {err}。" +msgstr "" + +#: apigateway/apis/open/resource_doc/views.py:61 #: apigateway/apis/web/resource_doc/views.py:65 #: apigateway/apis/web/resource_doc/views.py:90 msgid "" @@ -53,18 +77,18 @@ msgstr "" "There is no qualified resource document. Please refer to the guide to check " "whether the resource documents in the archive are correct" -#: apigateway/apis/open/resource_doc/views.py:62 +#: apigateway/apis/open/resource_doc/views.py:64 #: apigateway/apis/web/resource_doc/views.py:93 #, python-brace-format msgid "导入资源文档失败,{err}。" msgstr "Import resource document failed: {err}." -#: apigateway/apis/open/resource_doc/views.py:91 +#: apigateway/apis/open/resource_doc/views.py:93 #: apigateway/apis/web/resource_doc/views.py:124 msgid "swagger 描述内容不符合规范。" msgstr "The content does not conform to swagger specification." -#: apigateway/apis/open/resource_doc/views.py:93 +#: apigateway/apis/open/resource_doc/views.py:95 #: apigateway/apis/web/resource_doc/views.py:126 msgid "根据 swagger 描述生成 markdown 格式文档出现错误。" msgstr "" @@ -92,120 +116,124 @@ msgstr "" "Header key must be less than 100 characters and only contain letters, " "numbers, and hyphens (-)." -#: apigateway/apis/open/stage/serializers.py:200 -#: apigateway/apis/web/stage/serializers.py:120 +#: apigateway/apis/open/stage/serializers.py:218 +#: apigateway/apis/web/stage/serializers.py:170 msgid "网关下环境名称已经存在。" msgstr "The stage name already exists." -#: apigateway/apis/open/stage/serializers.py:205 -#: apigateway/apis/web/stage/serializers.py:125 +#: apigateway/apis/open/stage/serializers.py:223 +#: apigateway/apis/web/stage/serializers.py:175 #, python-brace-format msgid "每个网关最多创建 {max_count} 个环境。" msgstr "Up to {max_count} stages per gateway." -#: apigateway/apis/open/stage/serializers.py:339 -#, python-brace-format -msgid "微网关实例不存在,id={value}。" -msgstr "Microgateway instance does not exist, id={value}." +#: apigateway/apis/open/stage/serializers.py:234 +msgid "proxy_http or backends 必须要选择一种方式配置后端服务" +msgstr "either proxy_http or backends must be selected to configure the backend service" -#: apigateway/apis/open/stage/serializers.py:353 +#: apigateway/apis/open/stage/serializers.py:416 msgid "微网关实例已绑定到其它环境。" msgstr "The microgateway instance is bound to other stage." -#: apigateway/apis/open/stage/serializers.py:369 +#: apigateway/apis/open/stage/serializers.py:432 #, python-brace-format msgid "插件类型重复:{plugin_type}。" msgstr "Duplicate plugin type: {plugin_type}" -#: apigateway/apis/open/stage/serializers.py:378 -#: apigateway/biz/resource/importer/importers.py:338 +#: apigateway/apis/open/stage/serializers.py:441 +#: apigateway/biz/resource/importer/validate.py:232 #, python-brace-format msgid "插件类型 {not_exist_types} 不存在。" msgstr "Plugin type {not_exist_types} does not exist." -#: apigateway/apis/open/stage/serializers.py:394 +#: apigateway/apis/open/stage/serializers.py:457 #, python-brace-format msgid "插件配置校验失败,插件类型:{plugin_type_code},错误信息:{err}。" msgstr "" "Plugin configuration verification failed, plugin type: {plugin_type_code}, " "error message: {err}." -#: apigateway/apis/open/support/views.py:111 +#: apigateway/apis/open/support/views.py:74 msgid "网关下无资源,无法生成 SDK。" msgstr "No resources to generate SDK." -#: apigateway/apis/open/support/views.py:113 +#: apigateway/apis/open/support/views.py:76 msgid "网关 SDK 生成失败,请联系管理员。" msgstr "Generate SDK failed, please contact administrator." -#: apigateway/apis/open/support/views.py:115 +#: apigateway/apis/open/support/views.py:78 msgid "网关 SDK 打包失败,请联系管理员。" msgstr "Pack SDK failed, please contact administrator." -#: apigateway/apis/open/support/views.py:117 +#: apigateway/apis/open/support/views.py:80 msgid "网关 SDK 发布失败,请联系管理员。" msgstr "Distribute SDK failed, please contact administrator." -#: apigateway/apis/open/support/views.py:120 -#: apigateway/apis/web/sdk/views.py:113 +#: apigateway/apis/open/support/views.py:83 +#: apigateway/apis/web/sdk/views.py:117 #, python-brace-format msgid "同一资源版本,最多只能生成 {count} 个 SDK。" msgstr "" "Only up to {count} SDKs can be generated for the same resource version." -#: apigateway/apis/open/support/views.py:126 +#: apigateway/apis/open/support/views.py:89 msgid "网关 SDK 创建失败,请联系管理员。" msgstr "Create SDK failed, please contact administrator." -#: apigateway/apis/web/access_log/serializers.py:34 -#: apigateway/apis/web/metrics/serializers.py:38 +#: apigateway/apis/web/access_log/serializers.py:39 +#: apigateway/apis/web/metrics/serializers.py:35 +#: apigateway/apis/web/metrics/serializers.py:49 msgid "参数 time_start+time_end, time_range 必须一组有效。" msgstr "One of time_start+time_end, time_range must be valid." -#: apigateway/apis/web/access_log/views.py:82 +#: apigateway/apis/web/access_log/views.py:87 msgid "网关未请求或请求后端接口异常,响应内容由网关提供。" msgstr "" "The response content is provided by the gateway, and the gateway reports an " "error directly or the request backend interface is abnormal." -#: apigateway/apis/web/access_log/views.py:84 +#: apigateway/apis/web/access_log/views.py:89 msgid "网关已请求后端接口,并将其响应原样返回。" msgstr "" "The gateway has requested the backend interface and returned its response as " "is." +#: apigateway/apis/web/access_log/views.py:92 +msgid "当状态码为 200 时,不记录响应正文" +msgstr "when the status code was 200, the response body was not logged" + #: apigateway/apis/web/api_test/prepared_request.py:74 msgid "Header X-Bkapi-Authorization 不是一个有效的 Json 格式字符串。" msgstr "Header X-Bkapi-Authorization is not a valid Json format string." -#: apigateway/apis/web/api_test/views.py:103 +#: apigateway/apis/web/api_test/views.py:157 #, python-brace-format msgid "请求网关资源失败,错误消息:{err}。" msgstr "Request for gateway resource failed, error message: {err}." -#: apigateway/apis/web/backend/serializers.py:52 +#: apigateway/apis/web/backend/serializers.py:53 msgid "网关下后端服务名称已经存在。" msgstr "Backend service name already exists under the gateway." -#: apigateway/apis/web/backend/serializers.py:64 +#: apigateway/apis/web/backend/serializers.py:65 #, python-brace-format msgid "网关【{gateway}】下不存在id为【{stage_id}】的环境。" msgstr "" "There is no stage with the ID [{stage_id}] under the gateway [{gateway}]" -#: apigateway/apis/web/backend/serializers.py:73 +#: apigateway/apis/web/backend/serializers.py:74 #, python-brace-format msgid "后端服务缺少网关【{gateway}】下【{stage_name}】环境配置。" msgstr "" "The backend service lacks the [{stage_name}] stage configuration under the " "gateway [{gateway}]" -#: apigateway/apis/web/backend/serializers.py:83 +#: apigateway/apis/web/backend/serializers.py:84 #, python-brace-format msgid "环境【{stage_name}】的配置Scheme【{scheme}】不合法。" msgstr "The Scheme [{scheme}] of Stage [{stage_name}] is invalid." -#: apigateway/apis/web/backend/views.py:172 +#: apigateway/apis/web/backend/views.py:176 msgid "请先下线后端服务,然后再删除。" msgstr "Please deactivate the backend service first, and then delete." @@ -218,7 +246,7 @@ msgstr "Gateway name already exists." msgid "网关名不能以【{prefix}】开头,其为官方保留字。" msgstr "The gateway name cannot start with [{prefix}], it is reserved." -#: apigateway/apis/web/gateway/views.py:231 +#: apigateway/apis/web/gateway/views.py:236 msgid "请先停用网关,然后再删除。" msgstr "Please deactivate the gateway first, and then delete." @@ -227,7 +255,7 @@ msgid "网关下标签名称已存在。" msgstr "Label name already exists." #: apigateway/apis/web/label/serializers.py:62 -#: apigateway/biz/resource/importer/importers.py:306 +#: apigateway/biz/resource/importer/validate.py:198 #, python-brace-format msgid "每个网关最多创建 {max_count} 个标签。" msgstr "Up to {max_count} labels per gateway." @@ -237,77 +265,77 @@ msgid "通知对象、其他通知对象不能同时为空。" msgstr "Notification and other notification receivers cannot both be empty" #: apigateway/apis/web/monitor/serializers.py:97 -#: apigateway/apis/web/resource/serializers.py:321 -#: apigateway/apis/web/resource/serializers.py:430 +#: apigateway/apis/web/resource/serializers.py:327 +#: apigateway/apis/web/resource/serializers.py:459 #, python-brace-format msgid "标签不存在,id={ids}" msgstr "label does not exist, id={ids}" -#: apigateway/apis/web/permission/serializers.py:78 -#: apigateway/apis/web/permission/serializers.py:186 -msgid "永久有效" -msgstr "permanent" - -#: apigateway/apis/web/permission/serializers.py:124 +#: apigateway/apis/web/permission/serializers.py:172 msgid "导出已选中权限时,已选中权限不能为空。" msgstr "" "When exporting selected permissions, the selected permissions cannot be " "empty." -#: apigateway/apis/web/permission/serializers.py:226 +#: apigateway/apis/web/permission/serializers.py:188 +msgid "永久有效" +msgstr "permanent" + +#: apigateway/apis/web/permission/serializers.py:269 #, python-brace-format msgid "资源【{resource_id}】已删除" msgstr "Resource [{resource_id}] has been deleted." -#: apigateway/apis/web/permission/views.py:178 -#: apigateway/apis/web/permission/views.py:368 +#: apigateway/apis/web/permission/views.py:295 msgid "蓝鲸应用ID" msgstr "App ID" -#: apigateway/apis/web/permission/views.py:179 -#: apigateway/biz/access_log/constants.py:54 +#: apigateway/apis/web/permission/views.py:296 +#: apigateway/biz/access_log/constants.py:59 msgid "资源名称" msgstr "Resource Name" -#: apigateway/apis/web/permission/views.py:180 +#: apigateway/apis/web/permission/views.py:297 #: apigateway/apps/esb/bkcore/models.py:98 -#: apigateway/biz/access_log/constants.py:69 +#: apigateway/biz/access_log/constants.py:74 #: apigateway/editions/ee/apps/esb/bkcore/models.py:98 msgid "请求路径" msgstr "Request Path" -#: apigateway/apis/web/permission/views.py:181 +#: apigateway/apis/web/permission/views.py:298 #: apigateway/apps/esb/bkcore/models.py:97 -#: apigateway/biz/access_log/constants.py:59 +#: apigateway/biz/access_log/constants.py:64 #: apigateway/editions/ee/apps/esb/bkcore/models.py:97 msgid "请求方法" msgstr "Request Method" -#: apigateway/apis/web/permission/views.py:182 -#: apigateway/apis/web/permission/views.py:369 apigateway/core/models.py:811 +#: apigateway/apis/web/permission/views.py:299 msgid "过期时间" msgstr "Expire Time" -#: apigateway/apis/web/permission/views.py:183 -#: apigateway/apis/web/permission/views.py:370 +#: apigateway/apis/web/permission/views.py:300 msgid "授权类型" msgstr "Grant Type" +#: apigateway/apis/web/permission/views.py:301 +msgid "授权维度" +msgstr "Grant Dimension" + #: apigateway/apis/web/plugin/convertor.py:81 #, python-brace-format msgid "蓝鲸应用ID重复: {bk_app_code}" msgstr "Duplicate app ID: {bk_app_code}" -#: apigateway/apis/web/plugin/serializers.py:148 +#: apigateway/apis/web/plugin/serializers.py:149 msgid "插件类型不允许更改。" msgstr "The plugin type is not allowed to change." -#: apigateway/apis/web/plugin/serializers.py:157 +#: apigateway/apis/web/plugin/serializers.py:158 msgid "此插件类型未公开,不能用于绑定插件。" msgstr "The plugin type is not public, cannot be used to create new plugin." -#: apigateway/apis/web/release/views.py:68 -#: apigateway/apis/web/release/views.py:90 +#: apigateway/apis/web/release/views.py:75 +#: apigateway/apis/web/release/views.py:114 msgid "当前选择环境未发布版本,请先发布版本到该环境。" msgstr "The stage has not released, please release first." @@ -320,33 +348,33 @@ msgstr "Document in {value} language for this resource already exists." msgid "hosts 存在时,需要指定 loadbalance 类型。" msgstr "When hosts exists, the loadbalance type needs to be specified." -#: apigateway/apis/web/resource/serializers.py:71 +#: apigateway/apis/web/resource/serializers.py:69 msgid "标签 ID 请用逗号分割" msgstr "Please separate label IDs with commas." -#: apigateway/apis/web/resource/serializers.py:243 +#: apigateway/apis/web/resource/serializers.py:249 #, python-brace-format msgid "每个网关最多创建 {max_count} 个资源。" msgstr "Up to {max_count} resources per gateway." -#: apigateway/apis/web/resource/serializers.py:248 +#: apigateway/apis/web/resource/serializers.py:254 msgid "网关下资源名称已经存在。" msgstr "Resource name already exists under the gateway." -#: apigateway/apis/web/resource/serializers.py:253 +#: apigateway/apis/web/resource/serializers.py:259 msgid "网关前端配置中,请求方法+请求路径已经存在。" msgstr "" "The combination of request method and path already exists in the gateway " "configuration." -#: apigateway/apis/web/resource/serializers.py:289 +#: apigateway/apis/web/resource/serializers.py:295 #, python-brace-format msgid "当前请求方法为 {method},但相同请求路径下,其它请求方法已存在。" msgstr "" "The current request method is {method}, but other request methods already " "exist under the same request path." -#: apigateway/apis/web/resource/serializers.py:294 +#: apigateway/apis/web/resource/serializers.py:300 #, python-brace-format msgid "" "当前请求方法为 {method},但相同请求路径下,请求方法 {method_any} 已存在。" @@ -354,7 +382,7 @@ msgstr "" "The current request method is {method}, but request method {method_any} " "already exists under the same request path." -#: apigateway/apis/web/resource/serializers.py:303 +#: apigateway/apis/web/resource/serializers.py:309 msgid "" "资源前端配置中的【匹配所有子路径】与后端配置中的【追加匹配的子路径】值必需相" "同。" @@ -362,29 +390,23 @@ msgstr "" "The value of [Match all subpaths] must be the same as the value of [Append " "matched subpaths]." -#: apigateway/apis/web/resource/serializers.py:315 +#: apigateway/apis/web/resource/serializers.py:321 #, python-brace-format msgid "后端服务 (id={id}) 不存在。" msgstr "Backend service (id={id}) does not exist" -#: apigateway/apis/web/resource/serializers.py:401 -#: apigateway/apis/web/resource/serializers.py:413 +#: apigateway/apis/web/resource/serializers.py:430 +#: apigateway/apis/web/resource/serializers.py:442 #, python-brace-format msgid "资源不存在,id={ids}" msgstr "The resource does not exist, id={ids}" -#: apigateway/apis/web/resource/serializers.py:556 -#, python-brace-format -msgid "导入内容为无效的 json/yaml 数据,{err}。" -msgstr "Importing invalid json/yaml data, {err}." +#: apigateway/apis/web/resource/serializers.py:589 +msgid "ANY的资源不支持文档预览" +msgstr "resources of type ANY do not support document preview" -#: apigateway/apis/web/resource/serializers.py:563 -#, python-brace-format -msgid "导入内容不符合 swagger 2.0 协议,{err}。" -msgstr "Imported content does not conform to the swagger 2.0 protocol, {err}." - -#: apigateway/apis/web/resource/serializers.py:666 -#: apigateway/apis/web/resource/serializers.py:675 +#: apigateway/apis/web/resource/serializers.py:725 +#: apigateway/apis/web/resource/serializers.py:734 msgid "斜线(/)开头的合法URL路径,不包含http(s)开头的域名。" msgstr "" "URL path beginning with a slash (/) that do not contain a domain beginning " @@ -429,7 +451,7 @@ msgstr "" "The stage variable [{var_name}] in the backend path [{backend_path}] does " "not exist in the stage [{stage_name}]." -#: apigateway/apis/web/resource/views.py:547 +#: apigateway/apis/web/resource/views.py:673 #, python-brace-format msgid "" "网关环境 {stage_name} 下,后端服务 {backend_name} 的服务地址为空,请在 后端服" @@ -443,17 +465,17 @@ msgstr "" msgid "选中的资源未创建文档。" msgstr "No document for selected resources." -#: apigateway/apis/web/resource_version/views.py:182 +#: apigateway/apis/web/resource_version/views.py:196 msgid "请先创建资源,然后再发布版本。" msgstr "Please create a resource first and then release version." -#: apigateway/apis/web/resource_version/views.py:186 +#: apigateway/apis/web/resource_version/views.py:200 msgid "资源有更新,需生成新版本并发布到指定环境,才能生效。" msgstr "" "The resources have been updated, and a new version needs to be generated and " "released to the specified stage to take effect." -#: apigateway/apis/web/resource_version/views.py:191 +#: apigateway/apis/web/resource_version/views.py:205 msgid "资源文档有更新,需生成新版本并发布到任一环境,才能生效。" msgstr "" "The resource document has been updated, and a new version needs to be " @@ -467,36 +489,44 @@ msgstr "Version already exists." msgid "生成SDK操作过于频繁,请间隔 10 秒再试。" msgstr "Generate SDK too often, please try again after 10 seconds." -#: apigateway/apis/web/sdk/views.py:104 +#: apigateway/apis/web/sdk/views.py:105 msgid "网关下无符合条件(请求方法为非ANY)的资源,无法生成 SDK。" -msgstr "No resources matching the condition (request method is not ANY) were found under the gateway, unable to generate SDK." +msgstr "" +"No resources matching the condition (request method is not ANY) were found " +"under the gateway, unable to generate SDK." + +#: apigateway/apis/web/sdk/views.py:108 +#, fuzzy +#| msgid "网关 SDK 打包失败。" +msgid "网关 SDK 仓库配置异常。" +msgstr "Package SDK failed." -#: apigateway/apis/web/sdk/views.py:106 +#: apigateway/apis/web/sdk/views.py:110 msgid "网关 SDK 生成失败。" msgstr "SDK generation failed." -#: apigateway/apis/web/sdk/views.py:108 +#: apigateway/apis/web/sdk/views.py:112 msgid "网关 SDK 打包失败。" msgstr "Package SDK failed." -#: apigateway/apis/web/sdk/views.py:110 +#: apigateway/apis/web/sdk/views.py:114 msgid "网关 SDK 发布失败。" msgstr "Distribute SDK failed." -#: apigateway/apis/web/stage/serializers.py:138 +#: apigateway/apis/web/stage/serializers.py:187 #, python-brace-format msgid "网关下不存在id为【{backend_id}】的后端服务。" msgstr "" "There is no backend service with the ID [{backend_id}] under the gateway." -#: apigateway/apis/web/stage/serializers.py:145 +#: apigateway/apis/web/stage/serializers.py:194 #, python-brace-format msgid "请求参数中,缺少后端服务【{backend_id}】的配置。" msgstr "" "In the request parameters, the configuration of the backend service " "[{backend_id}] is missing." -#: apigateway/apis/web/stage/serializers.py:161 +#: apigateway/apis/web/stage/serializers.py:212 #, python-brace-format msgid "后端服务【{backend_name}】的配置Scheme【{scheme}】不合法。" msgstr "" @@ -516,21 +546,6 @@ msgstr "" msgid "请先下线环境,然后再删除。" msgstr "Please take the stage offline before deletion." -#: apigateway/apps/access_strategy/models.py:56 -#: apigateway/apps/access_strategy/models.py:57 -msgid "IP分组" -msgstr "IP group" - -#: apigateway/apps/access_strategy/models.py:94 -#: apigateway/apps/access_strategy/models.py:95 -msgid "访问策略" -msgstr "Access Strategy" - -#: apigateway/apps/access_strategy/models.py:151 -#: apigateway/apps/access_strategy/models.py:152 -msgid "访问策略绑定" -msgstr "Access Strategy Binding" - #: apigateway/apps/audit/constants.py:25 msgid "创建" msgstr "Create" @@ -559,14 +574,13 @@ msgstr "Fail" msgid "未知" msgstr "Unknown" -#: apigateway/apps/audit/constants.py:38 apigateway/core/constants.py:221 +#: apigateway/apps/audit/constants.py:38 apigateway/core/constants.py:191 msgid "网关" msgstr "Gateway" -#: apigateway/apps/audit/constants.py:39 apigateway/apps/plugin/constants.py:44 -#: apigateway/apps/plugin/constants.py:51 -#: apigateway/biz/access_log/constants.py:44 apigateway/core/constants.py:89 -#: apigateway/core/constants.py:222 +#: apigateway/apps/audit/constants.py:39 apigateway/apps/plugin/constants.py:40 +#: apigateway/apps/plugin/constants.py:47 +#: apigateway/biz/access_log/constants.py:49 apigateway/core/constants.py:192 msgid "环境" msgstr "Stage" @@ -578,8 +592,8 @@ msgstr "Backend Service" msgid "环境后端配置" msgstr "Stage Backend Config" -#: apigateway/apps/audit/constants.py:42 apigateway/apps/plugin/constants.py:45 -#: apigateway/apps/plugin/constants.py:52 apigateway/core/constants.py:223 +#: apigateway/apps/audit/constants.py:42 apigateway/apps/plugin/constants.py:41 +#: apigateway/apps/plugin/constants.py:48 apigateway/core/constants.py:193 msgid "资源" msgstr "Resource" @@ -595,149 +609,144 @@ msgstr "Release" msgid "网关标签" msgstr "Create Gateway Label" -#: apigateway/apps/audit/constants.py:46 apigateway/core/constants.py:36 -msgid "微网关" -msgstr "Micro Gateway" - -#: apigateway/apps/audit/constants.py:47 apigateway/apps/plugin/models.py:181 -#: apigateway/apps/plugin/models.py:182 +#: apigateway/apps/audit/constants.py:46 msgid "插件" msgstr "Plugin" -#: apigateway/apps/audit/constants.py:48 apigateway/apps/support/models.py:57 +#: apigateway/apps/audit/constants.py:47 apigateway/apps/support/models.py:57 #: apigateway/apps/support/models.py:58 msgid "资源文档" msgstr "Resource Doc" -#: apigateway/apps/audit/constants.py:53 +#: apigateway/apps/audit/constants.py:52 msgid "创建网关" msgstr "Create gateway" -#: apigateway/apps/audit/constants.py:54 +#: apigateway/apps/audit/constants.py:53 msgid "更新网关" msgstr "Update gateway" -#: apigateway/apps/audit/constants.py:55 +#: apigateway/apps/audit/constants.py:54 msgid "删除网关" msgstr "Delete gateway" -#: apigateway/apps/audit/constants.py:56 +#: apigateway/apps/audit/constants.py:55 msgid "创建网关标签" msgstr "Create Gateway Label" -#: apigateway/apps/audit/constants.py:57 +#: apigateway/apps/audit/constants.py:56 msgid "更新网关标签" msgstr "Update Gateway Label" -#: apigateway/apps/audit/constants.py:58 +#: apigateway/apps/audit/constants.py:57 msgid "删除网关标签" msgstr "Delete Gateway Label" -#: apigateway/apps/audit/constants.py:59 +#: apigateway/apps/audit/constants.py:58 msgid "创建资源文档" msgstr "Create resource doc" -#: apigateway/apps/audit/constants.py:60 +#: apigateway/apps/audit/constants.py:59 msgid "更新资源文档" msgstr "Update resource doc" -#: apigateway/apps/audit/constants.py:61 +#: apigateway/apps/audit/constants.py:60 msgid "删除资源文档" msgstr "Delete resource doc" -#: apigateway/apps/audit/constants.py:62 +#: apigateway/apps/audit/constants.py:61 msgid "创建资源" msgstr "Create resource" -#: apigateway/apps/audit/constants.py:63 +#: apigateway/apps/audit/constants.py:62 msgid "更新资源" msgstr "Update resource" -#: apigateway/apps/audit/constants.py:64 +#: apigateway/apps/audit/constants.py:63 msgid "删除资源" msgstr "Delete resource" -#: apigateway/apps/audit/constants.py:65 +#: apigateway/apps/audit/constants.py:64 msgid "创建后端服务" msgstr "Create backend service" -#: apigateway/apps/audit/constants.py:66 +#: apigateway/apps/audit/constants.py:65 msgid "更新后端服务" msgstr "Update backend service" -#: apigateway/apps/audit/constants.py:67 +#: apigateway/apps/audit/constants.py:66 msgid "删除后端服务" msgstr "Delete backend service" -#: apigateway/apps/audit/constants.py:68 +#: apigateway/apps/audit/constants.py:67 msgid "创建微网关实例" msgstr "Create microgateway instance" -#: apigateway/apps/audit/constants.py:69 +#: apigateway/apps/audit/constants.py:68 msgid "更新微网关实例" msgstr "Update microgateway instance" -#: apigateway/apps/audit/constants.py:70 +#: apigateway/apps/audit/constants.py:69 msgid "删除微网关实例" msgstr "Delete microgateway instance" -#: apigateway/apps/audit/constants.py:71 +#: apigateway/apps/audit/constants.py:70 msgid "创建插件" msgstr "Create plugin" -#: apigateway/apps/audit/constants.py:72 +#: apigateway/apps/audit/constants.py:71 msgid "更新插件" msgstr "Update plugin" -#: apigateway/apps/audit/constants.py:73 +#: apigateway/apps/audit/constants.py:72 msgid "删除插件" msgstr "Delete plugin" -#: apigateway/apps/audit/constants.py:74 +#: apigateway/apps/audit/constants.py:73 msgid "创建环境" msgstr "Create stage" -#: apigateway/apps/audit/constants.py:75 +#: apigateway/apps/audit/constants.py:74 msgid "更新环境" msgstr "Update stage" -#: apigateway/apps/audit/constants.py:76 +#: apigateway/apps/audit/constants.py:75 msgid "删除环境" msgstr "Delete stage" -#: apigateway/apps/audit/constants.py:77 +#: apigateway/apps/audit/constants.py:76 msgid "版本发布" msgstr "Release" -#: apigateway/apps/audit/constants.py:78 +#: apigateway/apps/audit/constants.py:77 msgid "生成版本" msgstr "Create Resource Version" -#: apigateway/apps/audit/constants.py:80 +#: apigateway/apps/audit/constants.py:79 msgid "环境状态变更" msgstr "Stage state changes" -#: apigateway/apps/audit/constants.py:81 +#: apigateway/apps/audit/constants.py:80 msgid "更新环境变量" msgstr "Update Stage Variables" -#: apigateway/apps/audit/constants.py:82 +#: apigateway/apps/audit/constants.py:81 msgid "批量更新资源" msgstr "Batch update resources" -#: apigateway/apps/audit/constants.py:83 +#: apigateway/apps/audit/constants.py:82 msgid "批量删除资源" msgstr "Batch delete resources" -#: apigateway/apps/audit/constants.py:84 +#: apigateway/apps/audit/constants.py:83 msgid "创建环境后端配置" msgstr "Create stage backend config" -#: apigateway/apps/audit/constants.py:85 +#: apigateway/apps/audit/constants.py:84 msgid "更新环境后端配置" msgstr "Update stage backend config" -#: apigateway/apps/audit/constants.py:86 +#: apigateway/apps/audit/constants.py:85 msgid "删除环境后端配置" msgstr "Delete stage backend config" @@ -836,8 +845,8 @@ msgstr "Component API Doc" msgid "资源版本ID" msgstr "Resource Version ID" -#: apigateway/apps/esb/bkcore/models.py:324 apigateway/core/models.py:585 -#: apigateway/core/models.py:758 +#: apigateway/apps/esb/bkcore/models.py:324 apigateway/core/models.py:558 +#: apigateway/core/models.py:759 #: apigateway/editions/ee/apps/esb/bkcore/models.py:324 msgid "发布状态" msgstr "Release Status" @@ -989,12 +998,12 @@ msgstr "" "The request method is {method}, but request method GET/POST already exists " "under the same request path." -#: apigateway/apps/esb/component/views.py:209 -#: apigateway/editions/ee/apps/esb/component/views.py:209 +#: apigateway/apps/esb/component/views.py:210 +#: apigateway/editions/ee/apps/esb/component/views.py:210 msgid "当前已有同步任务正在执行,请稍后重试。" -msgstr "" +msgstr "a synchronization task is currently in progress. Please try again later." -#: apigateway/apps/esb/constants.py:32 apigateway/conf/default.py:918 +#: apigateway/apps/esb/constants.py:32 apigateway/conf/default.py:888 #: apigateway/editions/ee/apps/esb/constants.py:32 msgid "蓝鲸智云" msgstr "BlueKing" @@ -1069,12 +1078,6 @@ msgstr "Gateway request statistics (by day)" msgid "应用请求统计(按天)" msgstr "App request statistics (by day)" -#: apigateway/apps/micro_gateway/serializers.py:88 -#: apigateway/apps/micro_gateway/serializers.py:149 -msgid "该网关下,同名微网关实例已存在。" -msgstr "" -"Under this gateway, a microgateway instance of the same name already exists." - #: apigateway/apps/monitor/constants.py:24 #: apigateway/apps/monitor/constants.py:49 msgid "请求资源后端错误" @@ -1225,7 +1228,7 @@ msgid "按资源" msgstr "By Resource" #: apigateway/apps/permission/models.py:55 -#: apigateway/apps/permission/models.py:109 +#: apigateway/apps/permission/models.py:102 msgid "默认过期时间为180天" msgstr "Default expiration time is 180 days" @@ -1234,76 +1237,83 @@ msgstr "Default expiration time is 180 days" msgid "蓝鲸应用访问网关权限" msgstr "App gateway permissions" -#: apigateway/apps/permission/models.py:119 -#: apigateway/apps/permission/models.py:120 +#: apigateway/apps/permission/models.py:112 +#: apigateway/apps/permission/models.py:113 msgid "蓝鲸应用访问资源权限" msgstr "App resource permissions" -#: apigateway/apps/permission/models.py:176 -#: apigateway/apps/permission/models.py:177 +#: apigateway/apps/permission/models.py:169 +#: apigateway/apps/permission/models.py:170 msgid "蓝鲸应用访问资源权限待审批申请单" msgstr "App pending permission approvals for resources" -#: apigateway/apps/permission/models.py:221 -#: apigateway/apps/permission/models.py:222 +#: apigateway/apps/permission/models.py:214 +#: apigateway/apps/permission/models.py:215 msgid "蓝鲸应用访问资源权限申请单" msgstr "App permission approvals for resources" -#: apigateway/apps/permission/models.py:270 -#: apigateway/apps/permission/models.py:271 +#: apigateway/apps/permission/models.py:263 +#: apigateway/apps/permission/models.py:264 msgid "蓝鲸应用访问资源权限申请状态" msgstr "App permission approval status for resources" #: apigateway/apps/plugin/constants.py:25 -msgid "IP访问控制" -msgstr "IP Access Control" - -#: apigateway/apps/plugin/constants.py:26 -#: apigateway/apps/plugin/constants.py:33 msgid "频率控制" msgstr "Rate Limit" -#: apigateway/apps/plugin/constants.py:29 -msgid "免用户认证应用白名单" -msgstr "Applications allowlist without user authentication" - -#: apigateway/apps/plugin/constants.py:35 +#: apigateway/apps/plugin/constants.py:27 msgid "Header 转换" msgstr "Header rewrite" -#: apigateway/apps/plugin/constants.py:37 +#: apigateway/apps/plugin/constants.py:29 msgid "网关错误使用HTTP状态码200(不推荐)" msgstr "Gateway error using HTTP status code 200 (Not Recommended)" -#: apigateway/apps/plugin/constants.py:39 +#: apigateway/apps/plugin/constants.py:31 msgid "免用户认证应用白名单(不推荐)" msgstr "Applications allowlist without user authentication (Not recommended)" -#: apigateway/apps/plugin/constants.py:46 +#: apigateway/apps/plugin/constants.py:33 +msgid "mocking 插件" +msgstr "mocking" + +#: apigateway/apps/plugin/constants.py:34 +msgid "API 熔断" +msgstr "api-breaker" + +#: apigateway/apps/plugin/constants.py:35 +msgid "请求校验" +msgstr "request-validation" + +#: apigateway/apps/plugin/constants.py:36 +msgid "故障注入" +msgstr "fault-injection" + +#: apigateway/apps/plugin/constants.py:42 msgid "环境和资源" msgstr "stage and backend" -#: apigateway/apps/plugin/constants.py:56 +#: apigateway/apps/plugin/constants.py:52 msgid "原生" msgstr "Native" -#: apigateway/apps/plugin/constants.py:57 +#: apigateway/apps/plugin/constants.py:53 msgid "动态" msgstr "Dynamic" -#: apigateway/apps/plugin/constants.py:58 +#: apigateway/apps/plugin/constants.py:54 msgid "固定" msgstr "Fixed" -#: apigateway/apps/plugin/constants.py:62 +#: apigateway/apps/plugin/constants.py:58 msgid "yaml导入" msgstr "yaml import" -#: apigateway/apps/plugin/constants.py:63 +#: apigateway/apps/plugin/constants.py:59 msgid "用户创建" msgstr "user create" -#: apigateway/apps/plugin/models.py:83 apigateway/apps/plugin/models.py:84 +#: apigateway/apps/plugin/models.py:82 apigateway/apps/plugin/models.py:83 msgid "插件类型" msgstr "Plugin type" @@ -1315,31 +1325,31 @@ msgstr "Plugin form" msgid "插件配置" msgstr "Plugin Configuration" -#: apigateway/apps/plugin/models.py:216 apigateway/apps/plugin/models.py:217 +#: apigateway/apps/plugin/models.py:182 apigateway/apps/plugin/models.py:183 msgid "插件绑定" msgstr "Plugin Binding" -#: apigateway/apps/support/constants.py:34 +#: apigateway/apps/support/constants.py:35 msgid "英文" msgstr "English" -#: apigateway/apps/support/constants.py:35 +#: apigateway/apps/support/constants.py:36 msgid "中文" msgstr "Chinese" -#: apigateway/apps/support/constants.py:39 +#: apigateway/apps/support/constants.py:40 msgid "导入" msgstr "Import" -#: apigateway/apps/support/constants.py:40 +#: apigateway/apps/support/constants.py:41 msgid "自定义" msgstr "Custom" -#: apigateway/apps/support/constants.py:44 +#: apigateway/apps/support/constants.py:45 msgid "tgz 归档文件" msgstr "tgz archive file" -#: apigateway/apps/support/constants.py:45 +#: apigateway/apps/support/constants.py:46 msgid "zip 归档文件" msgstr "zip archive file" @@ -1380,54 +1390,62 @@ msgid "蓝鲸应用" msgstr "App" #: apigateway/biz/access_log/constants.py:39 +msgid "蓝鲸用户" +msgstr "bk user" + +#: apigateway/biz/access_log/constants.py:44 msgid "客户端IP" msgstr "Client IP" -#: apigateway/biz/access_log/constants.py:49 +#: apigateway/biz/access_log/constants.py:54 msgid "资源ID" msgstr "Resource ID" -#: apigateway/biz/access_log/constants.py:64 +#: apigateway/biz/access_log/constants.py:69 msgid "请求域名" msgstr "Request Host" -#: apigateway/biz/access_log/constants.py:84 +#: apigateway/biz/access_log/constants.py:89 msgid "后端请求方法" msgstr "Backend Method" -#: apigateway/biz/access_log/constants.py:89 +#: apigateway/biz/access_log/constants.py:94 msgid "后端Scheme" msgstr "Backend Scheme" -#: apigateway/biz/access_log/constants.py:94 +#: apigateway/biz/access_log/constants.py:99 msgid "后端域名" msgstr "Backend Host" -#: apigateway/biz/access_log/constants.py:99 +#: apigateway/biz/access_log/constants.py:104 msgid "后端路径" msgstr "Backend Path" -#: apigateway/biz/access_log/constants.py:104 +#: apigateway/biz/access_log/constants.py:109 msgid "响应正文" msgstr "Response Body" -#: apigateway/biz/access_log/constants.py:109 +#: apigateway/biz/access_log/constants.py:114 +msgid "响应体大小" +msgstr "Response Size" + +#: apigateway/biz/access_log/constants.py:119 msgid "状态码" msgstr "Status Code" -#: apigateway/biz/access_log/constants.py:119 +#: apigateway/biz/access_log/constants.py:129 msgid "请求总耗时" msgstr "Request Duration" -#: apigateway/biz/access_log/constants.py:124 +#: apigateway/biz/access_log/constants.py:134 msgid "请求后端耗时" msgstr "Backend Duration" -#: apigateway/biz/access_log/constants.py:129 +#: apigateway/biz/access_log/constants.py:139 msgid "错误编码名称" msgstr "Code Name" -#: apigateway/biz/access_log/constants.py:139 +#: apigateway/biz/access_log/constants.py:149 msgid "响应说明" msgstr "Response Desc" @@ -1454,55 +1472,16 @@ msgstr "" msgid "授权维度 grant_dimension 暂不支持 {grant_dimension}。" msgstr "Grant dimension {grant_dimension} is currently unsupported." -#: apigateway/biz/releaser.py:184 -#, python-brace-format -msgid "" -"网关环境【{stage_name}】中的配置【后端服务地址】不合法。请在网关 `后端服务` " -"中进行配置。" -msgstr "" -"The config Hosts of stage [{stage_name}] is not configured, please configure " -"it in the `Backend Service`." - -#: apigateway/biz/releaser.py:206 -#, python-brace-format -msgid "网关环境【{stage_name}】存在绑定多个相同类型[{plugin_code}]的插件。" -msgstr "" -"Multiple plugins of the same type [{plugin_code}] are bound in the gateway " -"environment [{stage_name}]." - -#: apigateway/biz/releaser.py:222 -#, python-brace-format -msgid "" -"网关环境【{stage_name}】中代理配置 Hosts 未配置,请在网关 `基本设置 -> 环境管" -"理` 中进行配置。" -msgstr "" -"The config Hosts of stage [{stage_name}] is not configured, please configure " -"it in the `Settings -> Stages`." - -#: apigateway/biz/releaser.py:244 -#, python-brace-format -msgid "网关【{gateway_name}】没有启用,不允许发布" -msgstr "Gateway [{gateway_name}] is not enabled, publishing is not allowed." - -#: apigateway/biz/releaser.py:279 +#: apigateway/biz/releaser.py:171 msgid "共享微网关实例不存在。" msgstr "The shared micro-gateway instance does not exist." -#: apigateway/biz/resource/importer/importers.py:103 +#: apigateway/biz/resource/importer/parser.py:408 #, python-brace-format msgid "后端服务 (name={name}) 不存在。" msgstr "The backend service (name={name}) does not exist." -#: apigateway/biz/resource/importer/importers.py:206 -#, python-brace-format -msgid "" -"资源重复,id={resource_id}, method={method}, path={path} 在当前配置数据中被多" -"次使用,请检查。" -msgstr "" -"Duplicate resource, id={resource_id}, method={method}, path={path} are used " -"multiple times in the current configuration data, please check." - -#: apigateway/biz/resource/importer/importers.py:227 +#: apigateway/biz/resource/importer/validate.py:99 #, python-brace-format msgid "" "资源请求方法+请求路径重复,method={method}, path={path} 已被现有资源占用,请" @@ -1511,7 +1490,7 @@ msgstr "" "The resource request method + request path are duplicated. method={method}, " "path={path} are already occupied by existing resources, please check." -#: apigateway/biz/resource/importer/importers.py:235 +#: apigateway/biz/resource/importer/validate.py:109 #, python-brace-format msgid "" "资源请求方法+请求路径重复,method={method}, path={path} 在当前配置数据中被多" @@ -1521,7 +1500,7 @@ msgstr "" "path={path} are used multiple times in the current configuration data, " "please check." -#: apigateway/biz/resource/importer/importers.py:256 +#: apigateway/biz/resource/importer/validate.py:133 #, python-brace-format msgid "" "当前配置数据及已有资源数据中,请求路径 {path} 下,同时存在 {method_any} 及其" @@ -1530,21 +1509,21 @@ msgstr "" "Under request path [{path}], there exists [{method_any}] and other request " "methods." -#: apigateway/biz/resource/importer/importers.py:268 +#: apigateway/biz/resource/importer/validate.py:148 #, python-brace-format msgid "资源名称重复,operationId={name} 已被现有资源占用,请检查。" msgstr "" "The resource name is duplicated, operationId={name} is already occupied by " "an existing resource, please check." -#: apigateway/biz/resource/importer/importers.py:273 +#: apigateway/biz/resource/importer/validate.py:156 #, python-brace-format msgid "资源名称重复,operationId={name} 在当前配置数据中被多次使用,请检查。" msgstr "" "The resource name \"{name}\" is duplicated, it was used more than once in " "the current configuration data." -#: apigateway/biz/resource/importer/importers.py:285 +#: apigateway/biz/resource/importer/validate.py:171 #, python-brace-format msgid "" "当前配置数据中,资源 method={method}, path={path},前端配置中的 " @@ -1553,12 +1532,12 @@ msgstr "" "The matchSubpath of resource [method={method}, path={path}] value in " "frontend config must be the same as the matchSubpath value in backend config." -#: apigateway/biz/resource/importer/importers.py:293 +#: apigateway/biz/resource/importer/validate.py:183 #, python-brace-format msgid "每个网关最多创建 {count} 个资源。" msgstr "Up to {count} resources per gateway." -#: apigateway/biz/resource/importer/importers.py:324 +#: apigateway/biz/resource/importer/validate.py:219 #, python-brace-format msgid "" "资源绑定的插件类型重复,资源名称:{resource_name},重复的插件类型:" @@ -1567,7 +1546,7 @@ msgstr "" "The plugin type bound to the resource is duplicated, resource name: " "{resource_name}, duplicate plugin type: {duplicate_types}" -#: apigateway/biz/resource/importer/importers.py:364 +#: apigateway/biz/resource/importer/validate.py:261 #, python-brace-format msgid "" "资源的插件配置校验失败,资源名称:{resource_name},插件类型:" @@ -1576,12 +1555,16 @@ msgstr "" "The plugin configuration verification of the resource failed. Resource name: " "{resource_name}, plugin type: {plugin_type_code}, error message: {err}." +#: apigateway/biz/resource/importer/validate.py:285 +#, python-brace-format msgid "" -"资源的后端服务校验失败,资源名称:{resource_name},后端服务:{backend_name} 不存在" +"资源的后端服务校验失败,资源名称:{resource_name},后端服务:{backend_name} " +"不存在" msgstr "" -"Backend service validation failed for resource, resource name: {resource_name}, backend service: {backend_name} " -"does not exist" -#: apigateway/biz/resource/savers.py:115 +"Backend service validation failed for resource, resource name: " +"{resource_name}, backend service: {backend_name} does not exist" + +#: apigateway/biz/resource/savers.py:117 #, python-brace-format msgid "" "根据资源名称匹配资源时,匹配资源的 method + path 和用户输入的不一致,请检查资" @@ -1591,7 +1574,7 @@ msgstr "" "matching resource is inconsistent with the one entered by the user. Please " "check whether the resource (name={name}) already exists." -#: apigateway/biz/resource/savers.py:133 +#: apigateway/biz/resource/savers.py:135 #, python-brace-format msgid "网关资源 (id={resource_ids}) 存在多个后端配置,请联系网关管理员检查。" msgstr "" @@ -1610,44 +1593,44 @@ msgstr "Jinja2 template not found" msgid "Jinja2 模板语法错误" msgstr "Jinja2 template syntax error" -#: apigateway/biz/resource_doc/importer/parsers.py:116 +#: apigateway/biz/resource_doc/importer/parsers.py:117 msgid "无有效的资源文档。" msgstr "No valid resource document." -#: apigateway/biz/resource_version.py:146 apigateway/biz/validators.py:182 +#: apigateway/biz/resource_version.py:151 apigateway/biz/validators.py:294 msgid "请先创建资源,然后再生成版本。" msgstr "Please create a resource first and then generate resource version." -#: apigateway/biz/resource_version.py:154 apigateway/biz/validators.py:186 +#: apigateway/biz/resource_version.py:159 apigateway/biz/validators.py:298 msgid "存在资源未绑定后端服务. " msgstr "There is a resource that is not bound to the backend service." -#: apigateway/biz/resource_version.py:158 apigateway/biz/validators.py:200 +#: apigateway/biz/resource_version.py:163 apigateway/biz/validators.py:312 #, python-brace-format msgid "版本 {version} 已存在。" msgstr "Resource version {version} already exists." -#: apigateway/biz/stage.py:189 +#: apigateway/biz/stage.py:168 #, python-brace-format msgid "环境【{stage_name}】不存在。" msgstr "Stage [{stage_name}] does not exist." -#: apigateway/biz/validators.py:75 +#: apigateway/biz/validators.py:84 #, python-brace-format msgid "网关【id={gateway_id}】下指定的部分资源ID不存在。" msgstr "Some resource IDs do not exist under gateway [id={gateway_id}]." -#: apigateway/biz/validators.py:89 +#: apigateway/biz/validators.py:98 #, python-brace-format msgid "蓝鲸应用【{app_codes}】不匹配要求的模式。" msgstr "App [{app_codes}] does not match the required pattern." -#: apigateway/biz/validators.py:101 +#: apigateway/biz/validators.py:110 #, python-brace-format msgid "蓝鲸应用【{value}】不匹配要求的模式。" msgstr "App [{value}] does not match the required pattern." -#: apigateway/biz/validators.py:133 +#: apigateway/biz/validators.py:142 #, python-brace-format msgid "" "环境【{stage_name}】中,环境变量【{key}】在发布版本的资源配置中被用作路径变" @@ -1656,7 +1639,7 @@ msgstr "" "In stage [{stage_name}], the variable [{key}] is used as a path variable in " "some resources, and must exist." -#: apigateway/biz/validators.py:140 +#: apigateway/biz/validators.py:149 #, python-brace-format msgid "" "环境【{stage_name}】中,环境变量【{key}】在发布版本的资源配置中被用作路径变" @@ -1665,7 +1648,7 @@ msgstr "" "In stage [{stage_name}], the variable [{key}] is used as a path variable in " "some resources, but it's value is not a valid URL fragment." -#: apigateway/biz/validators.py:155 +#: apigateway/biz/validators.py:164 #, python-brace-format msgid "" "环境【{stage_name}】中,环境变量【{key}】在发布版本的资源配置中被用作 Host 变" @@ -1674,7 +1657,7 @@ msgstr "" "In stage [{stage_name}], the variable [{key}] is used as a Host variable in " "some resources, and cannot be empty." -#: apigateway/biz/validators.py:162 +#: apigateway/biz/validators.py:171 #, python-brace-format msgid "" "环境【{stage_name}】中,环境变量【{key}】在发布版本的资源配置中被用作 Host 变" @@ -1684,10 +1667,61 @@ msgstr "" "some resources, but it's value is not a valid Host (not including " "\"http(s)://\")." -#: apigateway/biz/validators.py:196 +#: apigateway/biz/validators.py:210 +#, fuzzy, python-brace-format +#| msgid "" +#| "网关环境【{stage_name}】中的配置【后端服务地址】不合法。请在网关 `后端服务" +#| "` 中进行配置。" +msgid "" +"网关环境【{stage_name}】中的配置【后端服务 {backend_name} 地址】不合法。请在" +"网关 `后端服务` 中进行配置。" +msgstr "" +"The config Hosts of stage [{stage_name}] is not configured, please configure " +"it in the `Backend Service`." + +#: apigateway/biz/validators.py:233 +#, python-brace-format +msgid "网关环境【{stage_name}】存在绑定多个相同类型[{plugin_code}]的插件。" +msgstr "" +"Multiple plugins of the same type [{plugin_code}] are bound in the gateway " +"environment [{stage_name}]." + +#: apigateway/biz/validators.py:255 +#, python-brace-format +msgid "" +"版本【{resource_version}】数据结构已经不兼容,不允许发布,请在【资源配置】中" +"新建版本再发布" +msgstr "" + +#: apigateway/biz/validators.py:263 +#, python-brace-format +msgid "网关【{gateway_name}】没有启用,不允许发布" +msgstr "Gateway [{gateway_name}] is not enabled, publishing is not allowed." + +#: apigateway/biz/validators.py:308 msgid "存在同一资源绑定多个后端服务. " msgstr "There is a resource that is bound to the multiple backend service." +#: apigateway/biz/validators.py:324 +#, fuzzy, python-brace-format +#| msgid "后端服务【{backend_name}】的配置Scheme【{scheme}】不合法。" +msgid "" +"后端服务【{backend_name}】的配置 scheme 同时存在 http 和 https, 需要保持一" +"致。" +msgstr "" +"The configuration Scheme [{scheme}] of the backend service [{backend_name}] " +"is illegal." + +#: apigateway/biz/validators.py:330 +#, fuzzy, python-brace-format +#| msgid "后端服务【{backend_name}】的配置Scheme【{scheme}】不合法。" +msgid "" +"后端服务【{backend_name}】的配置 scheme 同时存在 grpc 和 grpcs, 需要保持一" +"致。" +msgstr "" +"The configuration Scheme [{scheme}] of the backend service [{backend_name}] " +"is illegal." + #: apigateway/common/django/validators.py:35 msgid "名称不能以【-】结尾。" msgstr "Name should not endswith `-`" @@ -1709,30 +1743,26 @@ msgid "用户未登录或登录态失效,请使用登录链接重新登录" msgstr "User is not logged in or login status is invalid, please log in again" #: apigateway/common/error_codes.py:127 -msgid "没有访问权限" -msgstr "Forbidden" - -#: apigateway/common/error_codes.py:128 msgid "没有相关权限" msgstr "No Permission" -#: apigateway/common/error_codes.py:129 +#: apigateway/common/error_codes.py:128 msgid "数据不存在" msgstr "Not Found" -#: apigateway/common/error_codes.py:131 +#: apigateway/common/error_codes.py:130 msgid "不支持当前的请求方法" msgstr "The request method is not allowed" -#: apigateway/common/error_codes.py:133 +#: apigateway/common/error_codes.py:132 msgid "处理请求时发生内部错误" msgstr "An internal error occurred while processing the request" -#: apigateway/common/error_codes.py:134 +#: apigateway/common/error_codes.py:133 msgid "请求失败" msgstr "Reuqest Failed" -#: apigateway/common/es/clients.py:59 +#: apigateway/common/es/clients.py:70 msgid "项目配置 ELASTICSEARCH_HOSTS 不能为空。" msgstr "setting ELASTICSEARCH_HOSTS cannot be empty." @@ -1740,47 +1770,44 @@ msgstr "setting ELASTICSEARCH_HOSTS cannot be empty." msgid "Schema 不存在。" msgstr "Schema does not exist." -#: apigateway/common/permissions/permissions.py:34 +#: apigateway/common/permissions/permissions.py:33 msgid "当前用户无访问网关权限" msgstr "The user has no permission to access the gateway" -#: apigateway/common/permissions/permissions.py:71 -msgid "应用无操作网关权限" -msgstr "App has no permission to access the gateway" - -#: apigateway/common/permissions/permissions.py:112 +#: apigateway/common/permissions/permissions.py:73 msgid "网关不存在" msgstr "The gateway does not exist." -#: apigateway/common/plugin/plugin_checkers.py:57 -#, python-brace-format -msgid "当 'allow_credential' 为 True 时, {key} 不能为 '*'。" +#: apigateway/common/plugin/checker.py:67 +#, fuzzy, python-brace-format +#| msgid "当 'allow_credential' 为 True 时, {key} 不能为 '*'。" +msgid "当 'allow_credential' 为 True 时,{key} 不能为 '*'。" msgstr "{key} cannot be '*' when 'allow_credential' is True." -#: apigateway/common/plugin/plugin_checkers.py:61 +#: apigateway/common/plugin/checker.py:71 msgid "allow_origins, allow_origins_by_regex 不能同时为空。" msgstr "" "allow_origins, allow_origins_by_regex cannot be empty at the same time." -#: apigateway/common/plugin/plugin_checkers.py:64 +#: apigateway/common/plugin/checker.py:74 msgid "allow_origins, allow_origins_by_regex 只能一个有效。" msgstr "allow_origins, allow_origins_by_regex can only be one valid at a time." -#: apigateway/common/plugin/plugin_checkers.py:87 +#: apigateway/common/plugin/checker.py:97 #, python-brace-format msgid "allow_origins_by_regex 中数据 '{re_rule}' 不是合法的正则表达式。" msgstr "" "The '{re_rule}' in allow_origins_by_regex is not a legal regex expression." -#: apigateway/common/plugin/plugin_checkers.py:93 +#: apigateway/common/plugin/checker.py:103 msgid "{} 存在重复的元素:{}。" msgstr "Duplicate element in {}: {}." -#: apigateway/common/plugin/plugin_checkers.py:103 +#: apigateway/common/plugin/checker.py:113 msgid "set 存在重复的元素:{}。" msgstr "Duplicate element in set: {}." -#: apigateway/common/plugin/plugin_checkers.py:108 +#: apigateway/common/plugin/checker.py:118 msgid "remove 存在重复的元素:{}。" msgstr "Duplicate element in remove: {}." @@ -1801,26 +1828,30 @@ msgstr "No response content" msgid "接口响应数据非 JSON 格式" msgstr "Response data is not in JSON format" -#: apigateway/conf/default.py:923 +#: apigateway/conf/default.py:893 msgid "正式环境" msgstr "Prod" -#: apigateway/conf/default.py:925 +#: apigateway/conf/default.py:895 msgid "访问后端正式环境" msgstr "request third-party API Prod environment" -#: apigateway/conf/default.py:929 +#: apigateway/conf/default.py:899 msgid "测试环境" msgstr "Test" -#: apigateway/conf/default.py:931 +#: apigateway/conf/default.py:901 msgid "访问后端测试环境" msgstr "request third-party API Test environment" -#: apigateway/conf/default.py:941 +#: apigateway/conf/default.py:911 msgid "访问蓝鲸智云组件 API" msgstr "request BlueKing component API" +#: apigateway/core/constants.py:36 +msgid "微网关" +msgstr "Micro Gateway" + #: apigateway/core/constants.py:42 msgid "待安装" msgstr "Pending" @@ -1841,173 +1872,42 @@ msgstr "Updated" msgid "安装异常" msgstr "Installation Error" -#: apigateway/core/constants.py:54 -msgid "节点" -msgstr "Node" - -#: apigateway/core/constants.py:55 -msgid "服务发现" -msgstr "Service Discovery" - -#: apigateway/core/constants.py:61 -msgid "默认后端服务" -msgstr "Default Backend Service" - -#: apigateway/core/constants.py:62 -msgid "自定义后端服务" -msgstr "Custom Backend Service" - -#: apigateway/core/constants.py:63 -msgid "已存在的后端服务" -msgstr "Existing Backend Service" - -#: apigateway/core/constants.py:82 -msgid "客户端证书" -msgstr "Client Certificate" - -#: apigateway/core/constants.py:83 -msgid "服务端证书" -msgstr "Server Certificate" - -#: apigateway/core/constants.py:84 -msgid "客户端引用证书" -msgstr "Client Reference Certificate" - -#: apigateway/core/constants.py:85 -msgid "服务端引用证书" -msgstr "Server Reference Certificate" - -#: apigateway/core/constants.py:90 -msgid "环境配置" -msgstr "Stage item config" - #: apigateway/core/constants.py:91 -msgid "后端服务发现配置" -msgstr "Backend service discovery config" - -#: apigateway/core/constants.py:121 msgid "配置校验" msgstr "Configuration verification" -#: apigateway/core/constants.py:122 +#: apigateway/core/constants.py:92 msgid "生成发布任务" msgstr "Generate publishing tasks" -#: apigateway/core/constants.py:123 +#: apigateway/core/constants.py:93 msgid "下发配置" msgstr "Deliver configuration" -#: apigateway/core/constants.py:125 +#: apigateway/core/constants.py:95 msgid "解析配置" msgstr "Parse configuration" -#: apigateway/core/constants.py:126 +#: apigateway/core/constants.py:96 msgid "应用配置" msgstr "Apply configuration" -#: apigateway/core/constants.py:128 +#: apigateway/core/constants.py:98 msgid "加载配置" msgstr "Load configuration" -#: apigateway/core/models.py:463 +#: apigateway/core/models.py:436 msgid "符合 semver 规范" msgstr "Conform to semver specification" -#: apigateway/core/models.py:465 +#: apigateway/core/models.py:438 msgid "[Deprecated] 版本名" msgstr "[Deprecated] Name" -#: apigateway/core/models.py:713 +#: apigateway/core/models.py:721 msgid "是否共享实例" msgstr "Is shared instance" -#: apigateway/core/models.py:715 +#: apigateway/core/models.py:723 msgid "是否托管实例" msgstr "Is managed instance" - -#: apigateway/core/models.py:806 -msgid "引用类证书,名称表示引用名称" -msgstr "Reference certificate, the name indicates the reference name" - -#: apigateway/iam/constants.py:32 -msgid "管理员" -msgstr "Administrator" - -#: apigateway/iam/constants.py:33 -msgid "开发者" -msgstr "Developer" - -#: apigateway/iam/constants.py:34 -msgid "运营者" -msgstr "Operator" - -#: apigateway/iam/exceptions.py:28 -#, python-brace-format -msgid "网关 (id={gateway_id}) 的 IAM 分级管理员已存在,请不要重复创建。" -msgstr "" -"The IAM grade manager for the gateway (id={gateway_id}) already exists, " -"please do not create it again." - -#: apigateway/iam/exceptions.py:38 -#, python-brace-format -msgid "" -"网关 (id={gateway_id}) 的 IAM 分级管理员不存在,请联系系统负责人初始化数据。" -msgstr "" -"The IAM grade manager for the gateway (id={gateway_id}) does not exist. " -"Please contact the system admin to initialize the data." - -#: apigateway/iam/exceptions.py:50 -#, python-brace-format -msgid "" -"网关 (id={gateway_id}) {role_label}的 IAM 用户组不存在,请联系系统负责人初始" -"化数据。" -msgstr "" -"The IAM user group of gateway (id={gateway_id}) {role_label} does not exist. " -"Please contact the system admin to initialize the data." - -#: apigateway/iam/handlers/user_group.py:63 -#, python-brace-format -msgid "API网关-{gateway_name}-管理员" -msgstr "API Gateway-{gateway_name}-Admin" - -#: apigateway/iam/handlers/user_group.py:65 -#, python-brace-format -msgid "API网关-{gateway_name}-开发者" -msgstr "API Gateway-{gateway_name}-Developer" - -#: apigateway/iam/handlers/user_group.py:67 -#, python-brace-format -msgid "API网关-{gateway_name}-运营者" -msgstr "API Gateway-{gateway_name}-Operator" - -#: apigateway/iam/handlers/user_group.py:73 -#, python-brace-format -msgid "API网关 ({gateway_name}) 管理员,拥有网关的全部权限。" -msgstr "" -"API gateway ({gateway_name}) administrator has all the permissions of the " -"gateway." - -#: apigateway/iam/handlers/user_group.py:75 -#, python-brace-format -msgid "" -"API网关 ({gateway_name}) 开发者,拥有网关的开发权限,如管理资源,查看日志,在" -"线测试等。" -msgstr "" -"API gateway ({gateway_name}) developer has the development rights of the " -"gateway, such as managing resources, viewing logs, online testing, etc." - -#: apigateway/iam/handlers/user_group.py:79 -#, python-brace-format -msgid "" -"API网关 ({gateway_name}) 运营者,拥有网关的运营权限,如管理权限,查看日志等。" -msgstr "" -"API gateway ({gateway_name}) operator has the operational permissions of the " -"gateway, such as management permissions, viewing logs, etc." - -#: apigateway/iam/models.py:37 apigateway/iam/models.py:38 -msgid "IAM 分级管理员" -msgstr "IAM grade manager" - -#: apigateway/iam/models.py:54 apigateway/iam/models.py:55 -msgid "IAM 用户组" -msgstr "IAM user group" diff --git a/src/dashboard/apigateway/apigateway/tests/apis/web/metrics/test_views.py b/src/dashboard/apigateway/apigateway/tests/apis/web/metrics/test_views.py index d9d70c795..f54c13cc3 100644 --- a/src/dashboard/apigateway/apigateway/tests/apis/web/metrics/test_views.py +++ b/src/dashboard/apigateway/apigateway/tests/apis/web/metrics/test_views.py @@ -50,7 +50,7 @@ def test_get(self, mocker, fake_stage, request_view): "unit": "", "target": "", "dimensions": {}, - "datapoints": [] + "datapoints": [], }, ], } diff --git a/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py b/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py index 4a88c937c..40e53c620 100644 --- a/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py +++ b/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py @@ -224,7 +224,6 @@ def test_check_if_changed( fake_plugin_bk_header_rewrite, fake_plugin_check_changed_binding, ): - yaml = yaml_dumps( { "set": [{"key": "foo", "value": "bar"}], @@ -238,7 +237,7 @@ def test_check_if_changed( fake_input_data1 = { "name": fake_plugin_bk_header_rewrite.name, "type_id": fake_plugin_check_changed_binding[0], - "yaml": '', + "yaml": "", } assert view._check_if_changed(fake_input_data1, fake_plugin_bk_header_rewrite) diff --git a/src/dashboard/apigateway/apigateway/tests/common/plugin/test_normalizer.py b/src/dashboard/apigateway/apigateway/tests/common/plugin/test_normalizer.py new file mode 100644 index 000000000..ad05af367 --- /dev/null +++ b/src/dashboard/apigateway/apigateway/tests/common/plugin/test_normalizer.py @@ -0,0 +1,35 @@ +# +# TencentBlueKing is pleased to support the open source community by making +# 蓝鲸智云 - API 网关(BlueKing - APIGateway) available. +# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. +# Licensed under the MIT License (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://opensource.org/licenses/MIT +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific language governing permissions and +# limitations under the License. +# +# We undertake not to change the open source license (MIT license) applicable +# to the current version of the project delivered to anyone in the future. +# + +import pytest + +from apigateway.common.plugin.normalizer import format_fault_injection_config + + +@pytest.mark.parametrize( + "config, expected", + [ + ({"abort": {"body": "", "vars": ""}, "delay": {"vars": ""}}, {}), + ( + {"abort": {"body": "some body", "vars": ""}, "delay": {"vars": "some vars"}}, + {"abort": {"body": "some body"}, "delay": {"vars": "some vars"}}, + ), + ], +) +def test_format_fault_injection_config(config, expected): + assert format_fault_injection_config(config) == expected