membphis commented on a change in pull request #2265:
URL: https://github.com/apache/apisix/pull/2265#discussion_r492527705



##########
File path: doc/plugins/consumer-restriction.md
##########
@@ -20,31 +20,38 @@
 - [中文](../zh-cn/plugins/consumer-restriction.md)
 
 # Summary
-- [**Name**](#name)
-- [**Attributes**](#attributes)
-- [**How To Enable**](#how-to-enable)
-- [**Test Plugin**](#test-plugin)
-- [**Disable Plugin**](#disable-plugin)
+- [Summary](#summary)
+  - [Name](#name)
+  - [Attributes](#attributes)
+  - [How to enable `consumer_name`](#how-to-enable-consumer_name)
+    - [Test Plugin](#test-plugin)
+  - [How to restrict service ID](#how-to-restrict-service-id)
+    - [Route Test](#route-test)
+    - [Route Test](#route-test-1)
+  - [Disable Plugin](#disable-plugin)
 
 
 ## Name
 
-The `consumer-restriction` can restrict access to a Service or a Route by 
either
-whitelisting or blacklisting consumers. Support single or multiple consumers.
+The `consumer-restriction` makes corresponding access restrictions based on 
different objects selected, and supports two restriction types: consumer and 
service.

Review comment:
       `consumer` -> `consumer name`
   `service` -> `service id`

##########
File path: doc/zh-cn/plugins/consumer-restriction.md
##########
@@ -20,27 +20,36 @@
 - [English](../../plugins/consumer-restriction.md)
 
 # 目录
-- [**名字**](#名字)
-- [**属性**](#属性)
-- [**如何启用**](#如何启用)
-- [**测试插件**](#测试插件)
-- [**禁用插件**](#禁用插件)
+- [目录](#目录)
+  - [名字](#名字)
+  - [属性](#属性)
+  - [如何启用 `consumer_name`](#如何启用-consumer_name)
+    - [测试插件](#测试插件)
+  - [如何限制 service ID](#如何限制-service-id)
+    - [路由测试](#路由测试)
+    - [路由测试](#路由测试-1)
+  - [禁用插件](#禁用插件)
 
 ## 名字
 
-`consumer-restriction` 可以通过以下方式限制对服务或路线的访问,将 consumer 列入白名单或黑名单。 支持单个或多个 
consumer。
+`consumer-restriction` 根据选择的不同对象做相应的访问限制,支持consumer和service两种限制类型。

Review comment:
       ditto

##########
File path: doc/zh-cn/plugins/consumer-restriction.md
##########
@@ -85,31 +94,137 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f13
 }'
 ```
 
-## 测试插件
+### 测试插件
 
 jack1 访问:
 
 ```shell
-$ curl -u jack2019:123456 http://127.0.0.1:9080/index.html
+curl -u jack2019:123456 http://127.0.0.1:9080/index.html -i
 HTTP/1.1 200 OK
 ...
 ```
 
 jack2 访问:
 
 ```shell
-$ curl -u jack2020:123456 http://127.0.0.1:9080/index.html -i
+curl -u jack2020:123456 http://127.0.0.1:9080/index.html -i
 HTTP/1.1 403 Forbidden
 ...
-{"message":"You are not allowed"}
+{"message":"The consumer_name is forbidden."}
+```
+
+## 如何限制 service ID
+`service_id`方式需要与授权插件一起配合使用,这里以key-auth授权插件为例。
+
+1、创建两个service

Review comment:
       need one space between Chinese and English




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to