This is an automated email from the ASF dual-hosted git repository.
monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 877368770 docs: add more details for consumer-restriction plugin
(#9971)
877368770 is described below
commit 877368770492faf9c0b2f4cc15b1f70cf7487df4
Author: fabriceli <[email protected]>
AuthorDate: Tue Aug 8 10:05:00 2023 +0800
docs: add more details for consumer-restriction plugin (#9971)
---
docs/en/latest/plugins/consumer-restriction.md | 18 ++++++++++--------
docs/zh/latest/plugins/consumer-restriction.md | 18 ++++++++++--------
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/docs/en/latest/plugins/consumer-restriction.md
b/docs/en/latest/plugins/consumer-restriction.md
index cffe6bb98..7df4d0634 100644
--- a/docs/en/latest/plugins/consumer-restriction.md
+++ b/docs/en/latest/plugins/consumer-restriction.md
@@ -32,14 +32,16 @@ The `consumer-restriction` Plugin allows users to configure
access restrictions
## Attributes
-| Name | Type | Required | Default | Valid values
| Description |
-|--------------------|---------------|----------|---------------|---------------|-------------|
-| type | string | False | consumer_name |
["consumer_name", "consumer_group_id", "service_id", "route_id"] | Type of
object to base the restriction on. |
-| whitelist | array[string] | True | |
| List of objects to whitelist. Has a higher
priority than `allowed_by_methods`. |
-| blacklist | array[string] | True | |
| List of objects to blacklist. Has a higher
priority than `whitelist`. |
-| rejected_code | integer | False | 403 | [200,...]
| HTTP status code returned when the request is
rejected. |
-| rejected_msg | string | False | |
| Message returned when the request is
rejected. |
-| allowed_by_methods | array[object] | False | | ["GET",
"POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE",
"PURGE"] | List of allowed HTTP methods for a Consumer. |
+| Name | Type | Required | Default |
Valid values | Description
|
+| -------------------------- | ------------- | -------- | ------------- |
------------------------------------------------------------ |
------------------------------------------------------------ |
+| type | string | False | consumer_name |
["consumer_name", "consumer_group_id", "service_id", "route_id"] | Type of
object to base the restriction on. |
+| whitelist | array[string] | True | |
| List of objects to
whitelist. Has a higher priority than `allowed_by_methods`. |
+| blacklist | array[string] | True | |
| List of objects to
blacklist. Has a higher priority than `whitelist`. |
+| rejected_code | integer | False | 403 |
[200,...] | HTTP status code
returned when the request is rejected. |
+| rejected_msg | string | False | |
| Message returned when
the request is rejected. |
+| allowed_by_methods | array[object] | False | |
| List of allowed
configurations for Consumer settings, including a username of the Consumer and
a list of allowed HTTP methods. |
+| allowed_by_methods.user | string | False | |
| A username for a
Consumer. |
+| allowed_by_methods.methods | array[string] | False | |
["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT",
"TRACE", "PURGE"] | List of allowed HTTP methods for a Consumer.
|
:::note
diff --git a/docs/zh/latest/plugins/consumer-restriction.md
b/docs/zh/latest/plugins/consumer-restriction.md
index 255981026..55a43234d 100644
--- a/docs/zh/latest/plugins/consumer-restriction.md
+++ b/docs/zh/latest/plugins/consumer-restriction.md
@@ -32,14 +32,16 @@ description: Consumer Restriction 插件允许用户根据 Route、Service 或 C
## 属性
-| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述
|
-| --------- | ------------- | ------ | -----------------|
-------------------------|------------------------|
-| type | string | 否 | consumer_name | ["consumer_name",
"consumer_group_id", "service_id", "route_id"] | 支持设置访问限制的对象类型。 |
-| whitelist | array[string] | 是 | |
| 加入白名单的对象,优先级高于 `allowed_by_methods`。 |
-| blacklist | array[string] | 是 | |
| 加入黑名单的对象,优先级高于 `whitelist`。 |
-| rejected_code | integer | 否 | 403 | [200,...] |
当请求被拒绝时,返回的 HTTP 状态码。 |
-| rejected_msg | string | 否 | | |
当请求被拒绝时,返回的错误信息。 |
-| allowed_by_methods | array[object] | 否 | | ["GET", "POST",
"PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE", "PURGE"] | 为
Consumer 设置的允许的 HTTP 方法列表。 |
+| 名称 | 类型 | 必选项 | 默认值 | 有效值
| 描述
|
+| -------------------------- | ------------- | ------ | ------------- |
------------------------------------------------------------ |
------------------------------------------------------------ |
+| type | string | 否 | consumer_name |
["consumer_name", "consumer_group_id", "service_id", "route_id"] |
支持设置访问限制的对象类型。 |
+| whitelist | array[string] | 是 | |
|
加入白名单的对象,优先级高于`allowed_by_methods`。 |
+| blacklist | array[string] | 是 | |
|
加入黑名单的对象,优先级高于`whitelist`。 |
+| rejected_code | integer | 否 | 403 |
[200,...] | 当请求被拒绝时,返回的 HTTP
状态码。 |
+| rejected_msg | string | 否 | |
| 当请求被拒绝时,返回的错误信息。
|
+| allowed_by_methods | array[object] | 否 | |
| 一组为 Consumer
设置允许的配置,包括用户名和允许的 HTTP 方法列表。 |
+| allowed_by_methods.user | string | 否 | |
| 为 Consumer 设置的用户名。
|
+| allowed_by_methods.methods | array[string] | 否 | | ["GET",
"POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE",
"PURGE"] | 为 Consumer 设置的允许的 HTTP 方法列表。 |
:::note