qqeasonchen opened a new pull request, #5374:
URL: https://github.com/apache/eventmesh/pull/5374

   ## What this PR does
   
   Closes #5364 — Phase 3 of the production-HA plan (#5354): **admin security 
(fail-closed) + the chaos cases that don't need containers.** The 
Testcontainers chaos matrix and rolling-upgrade run are deferred with #5363 (no 
Docker in the current environment; deferral note on that issue lists the 
compensating coverage).
   
   ### 1. Admin security — fail-closed by default
   
   | Config | Behavior |
   |---|---|
   | `eventmesh.admin.token` set | Every endpoint (admin + `/metrics` scrape) 
except **`/admin/health`** (liveness probe) requires `Authorization: Bearer 
<token>` — constant-time compare. Missing/wrong → **401** with the remediation 
hint. |
   | **No token configured** | Everything except health → **503 
`admin_locked`** + a pointed WARN log. An operator who never set the property 
gets a **locked** admin plane, not a silently open one. |
   
   5 existing test classes updated to `withAdminToken(...)` + present the 
bearer — the breakage **was** the intended behavior change.
   
   ### 2. Chaos cases, in-process form
   
   - **`MetaStoreOutageTest`** (case 1): Meta down → every call fails 
observably (alertable) while held assignments + offsets survive; on recovery 
the CAS fencing still rejects a stale writer (`expected=null` cannot steal a 
held partition; the rightful `expected=current` takeover succeeds) — **offsets 
cannot regress through re-assignment**.
   - **`RocksDBCorruptionTest`** (case 4): a corrupted SST refuses startup with 
the documented error (`restore from backup or wipe deliberately`); the healthy 
control proves offsets survive a clean restart. The refusal beats silently 
re-creating an empty DB (which would reset every offset and replay everything).
   
   ### Verification (local, Temurin 21.0.11)
   
   ```
   :eventmesh-runtime:test (full suite, incl. the 3 new test classes)   BUILD 
SUCCESSFUL
   checkstyleMain/Test (maxWarnings=0)                                   BUILD 
SUCCESSFUL
   ```
   
   ### Relations
   
   - Closes #5364 (Phase 3, P1)
   - Parent: #5354 · Plan: `docs/architecture-review/production-ha-plan.md` (PR 
#5366)
   - Container-dependent remainder (broker/watch-loss chaos + rolling upgrade) 
rides with #5363's deferral
   - Unblocks #5365 (final evidence table)
   
   Co-authored-by: qqeasonchen <[email protected]>
   


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