Alanxtl commented on code in PR #95:
URL: 
https://github.com/apache/dubbo-go-pixiu-samples/pull/95#discussion_r2327243558


##########
plugins/opa/README_CN.md:
##########
@@ -0,0 +1,112 @@
+# OPA 插件示例
+
+[English](README.md)

Review Comment:
   ```suggestion
   [English](README_CN.md) | 中文
   ```



##########
plugins/opa/README.md:
##########
@@ -0,0 +1,128 @@
+# This sample for OPA filter.
+
+[中文](README_CN.md)

Review Comment:
   ```suggestion
   English | [中文](README_CN.md)
   ```



##########
plugins/opa/README_CN.md:
##########
@@ -0,0 +1,112 @@
+# OPA 插件示例
+
+[English](README.md)
+
+OPA 过滤器可以提供开箱即用的授权能力,确保服务的安全性和稳定性。
+
+> 该过滤器基于 [Open Policy Agent](https://www.openpolicyagent.org/),更多内容请参阅 
[官方文档](https://www.openpolicyagent.org/docs/latest/)。
+
+### 创建 API:
+
+- 创建一个简单的 Http API,参考 [创建一个简单的Http 
API](../../dubbogo/http/README.md),然后我们获得了一个可访问的路径。
+
+- 测试命令: `curl http://localhost:8888/UserService`
+
+### 设置过滤器
+
+- 第一步,定义策略。OPA 过滤器需要在配置中内联 Rego 策略。例如:
+
+```yaml
+            policy: |
+              package http.authz
+
+              default allow = false
+
+              allow {
+                input.method == "GET"
+                input.path == "/status"
+              }
+            entrypoint: "data.http.authz.allow"
+```
+
+### 设置进入点
+
+- 第二步,设置进入点。进入点必须同包匹配

Review Comment:
   ```suggestion
   ### 设置 entrypoint
   
   - 第二步,设置 entrypoint。进入点必须同包匹配
   ```



##########
README_CN.md:
##########
@@ -38,7 +38,8 @@
 
 - plugins:此目录包含 pixiu 的一些插件
   - plugins/ratelimit:pixiu 的 ratelimit 插件
-
+  - plugins/opa: pixiu 的 opa插件

Review Comment:
   ```suggestion
     - plugins/opa: pixiu 的 Open Policy Agent 策略控制能力集成示例
   ```



##########
README.md:
##########
@@ -38,7 +38,8 @@ samples for 
[dubbo-go-pixiu](https://github.com/apache/dubbo-go-pixiu)
 
 - plugins: this directory contains some plugins for pixiu
   - plugins/ratelimit: rate limit plugin for pixiu
-
+  - plugins/opa: opa plugin for pixiu

Review Comment:
   ```suggestion
     - plugins/opa: Open Policy Agent policy control capabilities
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to