certflow.config.config_center_backend module¶
配置中心后端(T10):统一「基础层 + 覆盖层」读写。
见 docs/discussions/resource-paths-audit.md §11.3。供配置中心 UI(T13)与
settings_ui.yaml spec 驱动。基础实现复用现有 paths_override``(``paths.local.yaml
覆盖层)+ ``settings.merge_user_config``(userconfig 增量写),不重建配置模型。
- 分层落盘规则:
- class certflow.config.config_center_backend.ConfigCenterBackend[源代码]¶
基类:
object配置中心读写后端。
- LAYER_OVERRIDE = 'override'¶
- LAYER_USERCONFIG = 'userconfig'¶
- LAYER_BASE = 'base'¶
- read(key)[源代码]¶
读取某键的三层视图。
- 返回:
{base, override, user, effective}- base: 基础层(config.yaml经 loader,忽略所有覆盖) - override:paths.local.yaml覆盖层原始值,未覆盖为None- user:userconfig合并值(桶2 偏好/覆盖 + 桶3 易变状态),未配置为None- effective: 实际生效值 =user>override>base- 参数:
key (str)
- 返回类型:
关键点(修复 T10 缺陷):偏好类键(
preferences.*/print_layout.*/printer_offsets.*)的生效值来自userconfig,而非基础层;原实现只查paths.local.yaml+ 基础层,导致这类键始终读到None,配置中心「可编辑」tab 全部显示空白/0。此处补齐 userconfig 来源。