feat(server/ops): 运维动作真实下发内核、审计持久化与幂等去重

OpsController 由「假成功队列」改为经投影反射 API 真实下发 SimpleLite,按 appsettings
的 Ops:Dispatch 映射 opCode→kind:Method,并做白名单 + JWT ops claim 双重校验;
审计改用 OpsAuditStore 原子落盘(取代进程内队列,重启不丢),新增 IdempotencyKey 幂等去重;
ExtractNumericId 取首段数字避免 AGV-12-3 误合并。appsettings 同步加 Ops:Dispatch 说明与 sl-route 鉴权策略。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zhaowei.huang
2026-06-08 16:09:29 +08:00
co-authored by Cursor
parent e77ee818f1
commit bc1d4b8b5c
3 changed files with 287 additions and 23 deletions
+6
View File
@@ -39,10 +39,16 @@
"ops": { "Password": "ops" }
}
},
"_comment_Ops": "运维操作真实下发映射(M4)。opCode → 'kind:Method'Method 必须是 SimpleLite 反射 [MethodMember] 的真实方法名(车辆 kind=car,见 Car.csOnlineCar/OfflineCar/DisableCar/EnableCar/Repair/Blown/Reset 等;任务 kind=mission)。运营白名单的 pause/resume/gohome/manualCharge 内核暂无一一对应方法——留空则仅记审计并向前端如实返回『未下发』,按现场内核能力填写后即真实生效。示例: 'ops.car.gohome': 'car:Reset'",
"Ops": {
"Dispatch": {
}
},
"ReverseProxy": {
"Routes": {
"sl-route": {
"ClusterId": "sl-cluster",
"AuthorizationPolicy": "AnyAuthed",
"Match": { "Path": "/api/sl/{**catch-all}" },
"Transforms": [
{ "PathRemovePrefix": "/api/sl" }