You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/25 10:21:58 UTC

[GitHub] [apisix] juzhiyuan commented on a diff in pull request #6895: docs: update "Authentication" Plugins

juzhiyuan commented on code in PR #6895:
URL: https://github.com/apache/apisix/pull/6895#discussion_r857474278


##########
docs/zh/latest/plugins/authz-casbin.md:
##########
@@ -194,33 +214,39 @@ p, admin, *, *
 g, alice, admin
 ```
 
-以上授权策略规定了任何人都可以使用 `GET` 请求方法访问主页(`/`),而只有具有管理权限的用户可以访问其他页面和使用其他请求方法。
+如果想要了解更多关于 `policy` 和 `model` 的配置,请参考 [examples](https://github.com/casbin/lua-casbin/tree/master/examples)。
+
+上述配置将允许所有人使用 `GET` 请求访问主页(`/`),而只有具有管理员权限的用户才可以访问其他页面并使用其他请求方法。
 
-例如,在这里,任何人都可以用 `GET` 请求方法访问主页,返回正常。
+简单举例来说,假设我们向主页发出 `GET` 请求,通常都可以返回正常结果。
 
 ```shell
 curl -i http://127.0.0.1:9080/ -X GET
 ```
 
-未经授权的用户如 `bob` 访问除 `/` 以外的任何其他页面将得到一个 403 错误:
+但如果是一个未经授权的普通用户(例如:`bob` )访问除 `/` 以外的其他页面,将得到一个 403 错误:

Review Comment:
   ```suggestion
   但如果是一个未经授权的普通用户(例如:`bob`)访问除 `/` 以外的其他页面,将得到一个 403 错误:
   ```



##########
docs/zh/latest/plugins/basic-auth.md:
##########
@@ -23,33 +29,32 @@ title: basic-auth
 
 ## 描述
 
-`basic-auth` 是一个认证插件,它需要与 `consumer` 一起配合才能工作。
+使用 `basic-auth` 插件可以将 [Basic_access_authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) 添加到 Route 或 Service 中。
 
-添加 Basic Authentication 到一个 `service` 或 `route`。 然后 `consumer` 将其用户名和密码添加到请求头中以验证其请求。
-
-有关 Basic Authentication 的更多信息,可参考 [维基百科](https://zh.wikipedia.org/wiki/HTTP%E5%9F%BA%E6%9C%AC%E8%AE%A4%E8%AF%81) 查看更多信息。
+该插件需要与 [Consumer](../architecture-design/consumer.md) 一起使用。API 的消费者可以将它们的密钥添加到请求头中以验证其请求。
 
 ## 属性
 
-consumer 端配置:
+Consumer 端:
 
-| 名称     | 类型   | 必选项 | 默认值 | 有效值 | 描述                                                                                                               |
-| -------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------------------------------------------------------------ |
-| username | string | 必须   |        |        | 不同的 `consumer` 对象应有不同的值,它应当是唯一的。不同 consumer 使用了相同的 `username` ,将会出现请求匹配异常。 |
-| password | string | 必须   |        |        | 用户的密码                                                                                                         |
+| 名称     | 类型   | 必选项 | 描述                                                                                           |
+| -------- | ------ | -----| ----------------------------------------------------------------------------------------------- |
+| username | string | 是   | Consumer 的用户名并且该用户名是唯一,如果多个 Consumer 使用了相同的 `username`,将会出现请求匹配异常。|
+| password | string | 是   | 用户的密码。                                                                                      |
 
-router 端配置:
+Route 端:
 
-| 名称     | 类型   | 必选项 | 默认值 | 有效值 | 描述                                                                                                               |
-| -------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------------------------------------------------------------ |
-| hide_credentials | boolean | 可选    | false   |       | 是否将 Authorization 请求头传递给 upstream。                                                                                             |
+| 名称             | 类型     | 必选项 | 默认值  | 描述                                                            |
+| ---------------- | ------- | ------ | ------ | --------------------------------------------------------------- |
+| hide_credentials | boolean | 否     | false  | 该参数设置为 `ture` 时,则会将 Authorization 请求头传递给 Upstream。|

Review Comment:
   ```suggestion
   | hide_credentials | boolean | 否     | false  | 该参数设置为 `true` 时,则会将 Authorization 请求头传递给 Upstream。|
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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