From c8f2cb7b98f69372e939d857ec2a3b6e6d443500 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sat, 13 Jun 2026 20:44:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Sentinel=20=E7=BC=96=E8=BE=91=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=97=B6=20api=5Fkey=20=E7=95=99=E7=A9=BA=20=E2=86=92?= =?UTF-8?q?=20=E4=BF=9D=E7=95=99=E6=97=A7=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/permissions/pending_requests.json | 22 ++++++++++++++++++++++ config/plugins/commands.yaml | 2 +- config/services/network_routes.yaml | 2 +- plugins/sentinel/__init__.py | 4 ++++ plugins/sentinel/config.yaml | 2 +- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/config/permissions/pending_requests.json b/config/permissions/pending_requests.json index 3c0e2da..2fa92ff 100644 --- a/config/permissions/pending_requests.json +++ b/config/permissions/pending_requests.json @@ -548,5 +548,27 @@ "framework.command.execute" ], "timestamp": 36350.46484983 + }, + "95c794bd": { + "plugin_name": "example_plugin", + "permissions": [ + "plugin.example.read", + "plugin.example.write", + "plugin.example.execute", + "framework.event.subscribe", + "framework.command.execute" + ], + "timestamp": 36524.104649607 + }, + "1d8c43c6": { + "plugin_name": "sentinel", + "permissions": [ + "plugin.sentinel.read", + "plugin.sentinel.write", + "plugin.network.access", + "framework.event.subscribe", + "framework.command.execute" + ], + "timestamp": 36524.109265649 } } \ No newline at end of file diff --git a/config/plugins/commands.yaml b/config/plugins/commands.yaml index e2a310b..052d2ec 100644 --- a/config/plugins/commands.yaml +++ b/config/plugins/commands.yaml @@ -101,7 +101,7 @@ commands: permissions: - framework.command.test source: internal -last_updated: 36350.43103134 +last_updated: 36524.082908878 plugin_commands: example_plugin: echo: *id001 diff --git a/config/services/network_routes.yaml b/config/services/network_routes.yaml index c0de703..2fb9d45 100644 --- a/config/services/network_routes.yaml +++ b/config/services/network_routes.yaml @@ -1,5 +1,5 @@ http_port: 4200 -last_updated: 36350.460163059 +last_updated: 36524.106284503 plugin_routes: example_plugin: - methods: diff --git a/plugins/sentinel/__init__.py b/plugins/sentinel/__init__.py index b4ed5bf..c458605 100644 --- a/plugins/sentinel/__init__.py +++ b/plugins/sentinel/__init__.py @@ -127,6 +127,10 @@ class Plugin(PluginWebMixin): return web.json_response({"ok": False, "error": "名称和 URL 不能为空"}, status=400) existing = [i for i, n in enumerate(nodes) if n.get("id") == node_id] if existing: + old = nodes[existing[0]] + # 保留未填写的敏感字段 + if not node["api_key"]: + node["api_key"] = old.get("api_key", "") nodes[existing[0]] = node else: nodes.append(node) diff --git a/plugins/sentinel/config.yaml b/plugins/sentinel/config.yaml index 4d3bd0a..bb1eb51 100644 --- a/plugins/sentinel/config.yaml +++ b/plugins/sentinel/config.yaml @@ -2,7 +2,7 @@ author: SenSu Team description: 🛡️ 多节点 SenSu 集群性能监控 — 实时仪表盘 + 节点管理 name: Sentinel nodes: -- api_key: '' +- api_key: sk-035259bb700b17ae51cfd50a717b27281b1a5347b2aa4723 enabled: true id: node-3733a070 name: PLK110