Baoyuantop commented on code in PR #11629:
URL: https://github.com/apache/apisix/pull/11629#discussion_r2844234135


##########
docs/zh/latest/plugins/opa.md:
##########
@@ -30,28 +28,28 @@ description: 本篇文档介绍了 Apache APISIX 通过 opa 插件与 Open Polic
 
 ## 描述
 
-`opa` 插件可用于与 [Open Policy Agent](https://www.openpolicyagent.org) 
进行集成,实现后端服务的认证授权与访问服务等功能解耦,减少系统复杂性。
+`opa` 插件可用于与 [Open Policy Agent (OPA)](https://www.openpolicyagent.org) 集成。OPA 
是一个策略引擎,帮助定义和执行授权策略,用以判断用户或应用程序是否拥有执行特定操作或访问特定资源的必要权限。将 OPA 与 APISIX 
配合使用可以将授权逻辑从 APISIX 中解耦。
 
 ## 属性
 
-| 名称              | 类型    | 必选项 | 默认值 | 有效值  | 描述                              
                                                                                
                                                                  |
-|-------------------|---------|----------|---------|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| 名称              | 类型    | 是否必需 | 默认值   | 有效值        | 描述                     
                                                                                
                                                                              |

Review Comment:
   ```suggestion
   | 名称              | 类型    | 必选项 | 默认值   | 有效值        | 描述                    
                                                                                
                                                                               |
   ```



##########
docs/zh/latest/plugins/opa.md:
##########
@@ -2,8 +2,6 @@
 title: opa
 keywords:
   - Apache APISIX
-  - API 网关
-  - Plugin

Review Comment:
   please keep it



##########
docs/zh/latest/plugins/opa.md:
##########
@@ -106,22 +106,22 @@ description: 本篇文档介绍了 Apache APISIX 通过 opa 插件与 Open Polic
 }
 ```
 
-上述响应中的代码释义如下:
+响应中的键说明:
 
-- `allow` 配置是必不可少的,它表示请求是否允许通过 APISIX 进行转发;
-- `reason`、`headers` 和 `status_code` 
是可选的,只有当你配置一个自定义响应时才会返回这些选项信息,具体使用方法可查看后续测试用例。
+- `allow` 是必需的,表示请求是否被允许通过 APISIX。
+- `reason`、`headers` 和 `status_code` 是可选的,仅在配置自定义响应时返回。请参见下一节用例。
 
-## 测试插件
+## 使用示例

Review Comment:
   ```suggestion
   ## 测试插件
   ```



##########
docs/zh/latest/plugins/opa.md:
##########
@@ -82,16 +81,17 @@ description: 本篇文档介绍了 Apache APISIX 通过 opa 插件与 Open Polic
 }
 ```
 
-上述代码具体释义如下:
+以下是各个键的说明:
 
-- `type` 代表请求类型(如 `http` 或 `stream`);
-- `request` 则需要在 `type` 为 `http` 时使用,包含基本的请求信息(如 URL、头信息等);
-- `var` 包含关于请求连接的基本信息(如 IP、端口、请求时间戳等);
-- `route`、`service` 和 `consumer` 包含的数据与 APISIX 中存储的数据相同,只有当这些对象上配置了 `opa` 
插件时才会发送。
+- `type` 表示请求类型(`http` 或 `stream`).
+- `request` 在 `type` 为 `http` 时使用,包含基本请求信息(URL、头信息等).
+- `var` 包含请求连接的基本信息(IP、端口、请求时间戳等)。
+- `body` 包含请求的 HTTP 主体。
+- `route`、`service` 和 `consumer` 包含 APISIX 中存储的相同数据,且仅在 `opa` 插件配置在这些对象上时发送。
 
-### OPA 向 APISIX 返回数据
+### OPA 服务到 APISIX

Review Comment:
   ```suggestion
   ### OPA 向 APISIX 返回数据
   ```



##########
docs/zh/latest/plugins/opa.md:
##########
@@ -241,9 +241,11 @@ test
 
 ### 发送 APISIX 数据
 
-如果你的 OPA 服务需要根据 APISIX 的某些数据(如 Route 和 Consumer 的详细信息)来进行后续操作时,则可以通过配置插件来实现。
+再看一个场景,当决策需要使用一些 APISIX 数据,比如 `route`、`consumer` 等时,如何操作?

Review Comment:
   ```suggestion
   如果你的 OPA 服务需要根据 APISIX 的某些数据(如 Route 和 Consumer 的详细信息)来进行后续操作时,则可以通过配置插件来实现。
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to