AlexStocks commented on code in PR #947:
URL: https://github.com/apache/dubbo-go-pixiu/pull/947#discussion_r3635086660


##########
admin/initialize/E2E_OPA.md:
##########
@@ -0,0 +1,71 @@
+# Admin OPA → Gateway OPA Full-Link E2E
+
+**English** | [中文](E2E_OPA_CN.md)
+
+## What the suite verifies
+
+The harness stands up:
+
+1. A **smart in-process OPA mock** (`regoMockOPA`) — uses the real
+   `github.com/open-policy-agent/opa/rego` library to compile and evaluate
+   modules, so policy semantics in tests match what a real OPA daemon would
+   do. No docker, no etcd, no real OPA binary required.
+2. **The real admin Gin router** via `initialize.Routers()` with
+   `adminconfig.Bootstrap.OPA.ServerURL` pointed at the mock.
+3. **The real gateway OPA filter** from `pkg/filter/opa` (via the public
+   `Plugin.CreateFilterFactory()` API) pointed at the same mock URL.
+
+Each test publishes a policy through the admin REST PUT, then drives one or
+more HTTP requests through the gateway filter and asserts the decision.
+
+| Test | Scenario | What it proves |
+|---|---|---|
+| `TestE2E_AllowedThroughFullChain` | PUT "allow if GET" → GET request | Admin 
→ OPA → gateway end-to-end allow returns `filter.Continue` with no local reply |
+| `TestE2E_DeniedThroughFullChain` | Same policy, POST request | Deny returns 
`filter.Stop` + 403, short-circuits before upstream |
+| `TestE2E_DefaultDenyForAllRequests` | `default allow := false` only | 
5-method matrix all denied (no rule shape can sneak past) |
+| `TestE2E_PolicyHotReload` | PUT v1, then PUT v2 (no restart) | Behaviour 
flips on the very next request — the headline OPA-server-mode value |
+| `TestE2E_DeleteCausesMissingResultFailClosed` | PUT then DELETE | Gateway 
returns 502 (matches `test_opa.md` §6.6) |
+| `TestE2E_HeaderBasedAllowDeny` | Policy on `input.headers["X-Role"]` | 
Title-cased header propagation works (admin/user/missing variants) |
+| `TestE2E_GatewayTimeoutFailClosed` | 200ms decision delay, 50ms gateway 
timeout | Returns 504, elapsed time bounded under 180ms |
+| `TestE2E_PolicyIDOverrideRoutesThroughGateway` | PUT with form-level 
`policy_id` override 

Review Comment:
   [P2] 补完整最后一个 E2E 用例的表格行
   
   这一行只有测试名和场景两列,缺少 `What it proves` 第三列以及结尾的 `|`,因此 Markdown 表格在最后一项处被截断;中文版 
`E2E_OPA_CN.md:30` 也有同样问题,并且下一节标题紧接在未闭合行之后。`git diff --check` 也会报告这两行的 trailing 
whitespace。请补齐该用例的验证说明和表格闭合符,并同步修正中英文文档。



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