{ "schema_version": 1, "diagram_type": "architecture", "meta": { "title": "恪澜通 · 运营支撑系统(klt-bos)架构总览", "output": ".archify/architecture-klt-bos-20261116-135235/klt-bos-architecture.html", "locale": "zh-CN", "quality_profile": "showcase", "repository": { "url": "http://112.124.19.38:8080/klt-bos/klt-bos-service.git", "revision": "8013f40416d3200056a828edb6846287bb4a9838", "link_mode": "local-only" } }, "components": [ { "id": "browser", "type": "external", "label": "浏览器 / 前端", "sublabel": "10 类角色 · 47 条路由", "pos": [ 30, 300 ], "size": [ 101, 66 ], "sources": [ { "path": "README.md", "line": 53, "end_line": 59 } ] }, { "id": "idp", "type": "security", "label": "身份提供方 / 令牌", "sublabel": "identity-provider · JWKS", "pos": [ 194, 90 ], "size": [ 117, 60 ], "sources": [ { "path": "src/bin/klt-bos/src/main.rs", "line": 273, "end_line": 289 }, { "path": "src/config/prod.toml", "line": 80, "end_line": 83 } ] }, { "id": "gateway", "type": "cloud", "label": "SEOH API 网关", "sublabel": "/api/klt/bos/**@v1", "pos": [ 194, 300 ], "size": [ 117, 66 ], "sources": [ { "path": "src/README.md", "line": 18, "end_line": 18 }, { "path": "src/config/default.toml", "line": 32, "end_line": 49 } ] }, { "id": "ac", "type": "security", "label": "访问控制 AC", "sublabel": "权限键判权 · 上界注入", "pos": [ 194, 190 ], "size": [ 117, 60 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 46, "end_line": 50 } ] }, { "id": "bootstrap", "type": "backend", "label": "服务装配 klt-bos", "sublabel": "注册 · 心跳 · TLS · 配置", "pos": [ 358, 500 ], "size": [ 117, 70 ], "sources": [ { "path": "src/bin/klt-bos/src/main.rs", "line": 26, "end_line": 31 }, { "path": "src/bin/klt-bos/src/main.rs", "line": 444, "end_line": 479 } ] }, { "id": "api", "type": "frontend", "label": "bos-api 路由", "sublabel": "Axum · AuthContext", "pos": [ 358, 300 ], "size": [ 117, 66 ], "sources": [ { "path": "src/crates/bos-api/src/lib.rs", "line": 1, "end_line": 14 }, { "path": "src/bin/klt-bos/src/main.rs", "line": 330, "end_line": 360 } ] }, { "id": "modules", "type": "backend", "label": "业务模块", "sublabel": "account · ops · billing", "pos": [ 529, 240 ], "size": [ 133, 84 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 23, "end_line": 27 }, { "path": "src/modules/account/src/router.rs", "line": 13, "end_line": 20 } ] }, { "id": "support", "type": "backend", "label": "支撑库", "sublabel": "scope · invariant · io · jobs", "pos": [ 529, 420 ], "size": [ 133, 84 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 18, "end_line": 22 } ] }, { "id": "core", "type": "backend", "label": "bos-core 基础库", "sublabel": "ID · 金额 · 日期 · 错误码", "pos": [ 529, 560 ], "size": [ 133, 60 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 7, "end_line": 8 } ] }, { "id": "platform_client", "type": "backend", "label": "bos-platform 客户端", "sublabel": "UDS · IAM · 调度 · OSS", "pos": [ 701, 330 ], "size": [ 140, 84 ], "sources": [ { "path": "src/crates/bos-platform/src/lib.rs", "line": 1, "end_line": 10 }, { "path": "src/crates/bos-platform/src/clients/mod.rs", "line": 1, "end_line": 9 } ] }, { "id": "uds", "type": "database", "label": "UDS 数据网关", "sublabel": "数据面 · query/dml", "pos": [ 880, 260 ], "size": [ 125, 70 ], "sources": [ { "path": "src/crates/bos-api/src/state.rs", "line": 5, "end_line": 10 }, { "path": "src/crates/bos-platform/src/clients/uds.rs", "line": 212, "end_line": 231 } ] }, { "id": "envdb", "type": "database", "label": "项目环境库", "sublabel": "project_{id}_{env}", "pos": [ 1067, 120 ], "size": [ 125, 70 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md", "line": 31, "end_line": 33 } ] }, { "id": "iam_tree", "type": "security", "label": "IAM + 资源树", "sublabel": "身份 · 组树 · region/customer", "pos": [ 880, 120 ], "size": [ 125, 70 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 8, "end_line": 17 } ] }, { "id": "sched_ets", "type": "messagebus", "label": "SJC + ETS", "sublabel": "调度 · 事件 · 延时任务", "pos": [ 1067, 300 ], "size": [ 125, 76 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 33, "end_line": 34 } ] }, { "id": "oss_imp", "type": "cloud", "label": "导入导出 / OSS", "sublabel": "异步通道 · 对象存储", "pos": [ 1067, 480 ], "size": [ 125, 76 ], "sources": [ { "path": "docs/详细设计说明书/00-总则与全局约定/03-系统边界与职责切分.md", "line": 35, "end_line": 38 }, { "path": "src/crates/bos-io/src/lib.rs", "line": 1, "end_line": 9 } ] }, { "id": "reg_cfg", "type": "cloud", "label": "注册 / 配置中心", "sublabel": "G1 注册 · 心跳 · 连接键", "pos": [ 880, 500 ], "size": [ 125, 70 ], "sources": [ { "path": "src/config/default.toml", "line": 44, "end_line": 49 }, { "path": "src/config/default.toml", "line": 57, "end_line": 65 } ] }, { "id": "operator", "type": "external", "label": "运营商 / 网管侧", "sublabel": "开通执行 · 结果回填", "pos": [ 1223, 600 ], "size": [ 117, 66 ], "sources": [ { "path": "README.md", "line": 7, "end_line": 13 } ] } ], "boundaries": [ { "kind": "region", "label": "SEOH 身份与接入判权", "wraps": [ "idp", "gateway", "ac" ], "pad": 16 }, { "kind": "region", "label": "klt-bos 扩展微服务 · Rust / Axum 单进程", "wraps": [ "bootstrap", "api", "modules", "support", "core", "platform_client" ], "pad": 18 }, { "kind": "region", "label": "SEOH 数智能力中台", "wraps": [ "uds", "envdb", "iam_tree", "sched_ets", "oss_imp", "reg_cfg" ], "pad": 16 } ], "connections": [ { "id": "browser-gateway", "from": "browser", "to": "gateway", "label": "HTTPS · 用户 JWT", "variant": "emphasis" }, { "id": "browser-idp", "from": "browser", "to": "idp", "label": "登录 · 签发 JWT", "variant": "security" }, { "id": "gateway-ac", "from": "gateway", "to": "ac", "label": "权限键判权 · 回注上界", "variant": "security" }, { "id": "gateway-api", "from": "gateway", "to": "api", "label": "转发(判权通过)", "variant": "emphasis" }, { "id": "bootstrap-api", "from": "bootstrap", "to": "api", "label": "装配路由 · 注册心跳", "variant": "dashed" }, { "id": "api-modules", "from": "api", "to": "modules", "label": "路由分发 · AuthContext" }, { "id": "modules-support", "from": "modules", "to": "support", "label": "范围 · 不变量 · 激活 · 作业" }, { "id": "support-core", "from": "support", "to": "core", "label": "基础能力" }, { "id": "modules-platform", "from": "modules", "to": "platform_client", "label": "平台调用" }, { "id": "support-platform", "from": "support", "to": "platform_client", "label": "导入导出 · 作业", "variant": "dashed" }, { "id": "platform-uds", "from": "platform_client", "to": "uds", "label": "数据面 · SQL/DML", "variant": "emphasis" }, { "id": "platform-iam", "from": "platform_client", "to": "iam_tree", "label": "IAM · 资源树读写" }, { "id": "platform-sched", "from": "platform_client", "to": "sched_ets", "label": "作业 / 事件登记", "variant": "dashed" }, { "id": "platform-oss", "from": "platform_client", "to": "oss_imp", "label": "异步通道 · OSS", "variant": "dashed" }, { "id": "bootstrap-registry", "from": "bootstrap", "to": "reg_cfg", "label": "注册 · 心跳 · 读连接键", "variant": "dashed" }, { "id": "uds-envdb", "from": "uds", "to": "envdb", "label": "读写(经 UDS)" }, { "id": "operator-sched", "from": "operator", "to": "sched_ets", "label": "开通结果 · 回填事件", "variant": "dashed" } ], "cards": [ { "dot": "cyan", "title": "判权与请求链路", "items": [ "网关按 OpenAPI x-resource-type / x-action / x-version 拼权限键判权并回注实例上界", "klt-bos 作为 HTTP 宿主只做服务侧角色判定,原样转发最终用户 JWT 写资源树", "平台审计与业务审计双写,两份数据不可互替" ] }, { "dot": "violet", "title": "模块与依赖方向", "items": [ "编译期强制 modules/* → scope / invariant / activation → platform → core", "六个支撑模块不得反向 import 任何业务模块,否则范围收口与不变量可被绕过", "account、ops 已交付主体;billing 主体在详细设计第 6 册" ] }, { "dot": "emerald", "title": "数据面与平台边界", "items": [ "无自有数据库连接池,全部读写经 UDS 网关落到 project_{id}_{env}", "不自建继承、判权中间层、调度流水与审计通道等第二真源", "签名模式用 JCS 字节 + keypair 六头,⛔ 与 Bearer 同现" ] }, { "dot": "slate", "title": "系统与外部边界", "items": [ "不算支付、不开发票、不记录真实资金到账", "开停由网络管理侧执行,BOS 只生成待执行记录与对账依据并接收开通结果", "店铺运营与 AI 业务不在本系统范围内" ] } ] }