feat: 系统内部变更(定时发布等非 HTTP 触发的变更,执行者记 system)
经 ReactiveExtensionClient.watch(Watcher) 全局通道观测扩展模型更新/删除事件 (v2.26.1 源码级验证:仅 status 变化或无变化不派发、GC 走存储层无事件), 按用户可写面 diff 降噪后落库,执行者记 system,路径为资源规范 API 路径。 归属区分:过滤器为所有写方法请求登记 HttpWriteMarker 目标标记与活动宽限窗, HTTP 触发的变更不重复记录;插件自身配置 ConfigMap 直接排除。 新增设置项 recordSystemChanges(默认开);UI 操作者 system 展示为「系统」。 服务端 156 个用例、UI 47 个用例全绿。
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
package run.halo.operationaudit.audit;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import run.halo.app.extension.ReactiveExtensionClient;
|
||||
import run.halo.app.extension.SchemeManager;
|
||||
import run.halo.app.plugin.PluginContext;
|
||||
|
||||
/**
|
||||
* 系统内部变更监听装配:以插件自身的配置 ConfigMap 名构建 {@link InternalChangeWatcher}
|
||||
* (保存插件设置走 json-config 端点时实际写的是该 ConfigMap,监听需排除避免误归属)。
|
||||
*/
|
||||
@Configuration
|
||||
class AuditWatchConfiguration {
|
||||
|
||||
@Bean
|
||||
InternalChangeWatcher internalChangeWatcher(ReactiveExtensionClient client,
|
||||
SchemeManager schemeManager, HttpWriteMarker writeMarker, AuditRecorder recorder,
|
||||
PluginContext pluginContext) {
|
||||
return new InternalChangeWatcher(client, schemeManager, writeMarker, recorder,
|
||||
pluginContext.getConfigMapName());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user