Files
tdc-rs/Cargo.toml
T
admin e13768edd5 feat(p5): 业务库操作改走 sspf Db,与平台共用同一把锁
- Cargo.toml 升到 sspf v0.5.0;platform/db.rs 注入进程级 Arc<Db>
- query_json_params→query_json_raw(不归一)/ exec_params / query_scalar_text+column_types→query_rows
- 函数签名仍 db: &PGlite,service/* 与 controller/* 零改动;ensure_schema 启动期豁免
- main.rs 在任何业务 DB 操作前注入,失败即退出(不接受静默双锁)
- 新增 tests/sspf_db_lock.rs:真库验不归一 + 平台持锁时业务写排队
- 双契约尺子 17→18 断言(启动日志自证锁已接入)
- sspf_platform_package 的版本断言改为从 Cargo.toml 读 tag 对账,升级不再手改
- cargo test 296 passed / 0 failed / 1 ignored;七把尺子全绿
2026-11-04 23:08:08 +08:00

69 lines
2.8 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[package]
name = "tdc-connector"
version = "0.1.0"
edition = "2021"
description = "TDC (数据接入连接器) MVP — Rust + 静态 HTML + PGlite 本地优先实现"
[[bin]]
name = "tdc-connector"
path = "src/main.rs"
[dependencies]
# 🔴 sspf 标准平台包(JNPF 兼容底座)—— 业务仓唯一的平台依赖,按 tag 锁版本。
# 开发期调试可临时换 path = "../ssw-platform/crates/sspf";交付一律用 git tag。
# 🔴 v0.5.0 起业务库操作与平台共用同一把 `Db.lock`(`query_json_raw` / `query_rows` /
# `exec_params`),见 `src/platform/db.rs`。
sspf = { git = "http://127.0.0.1:13300/ssw/ssw-platform.git", tag = "v0.5.0" }
# Web 框架 / 运行时
axum = "0.8"
tokio = { version = "1", features = ["full"] }
tower-http = { version = "0.6", features = ["fs", "cors", "trace"] }
# 序列化
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# TDS 跨方 HTTP 契约客户端(红线:TDC 与 TDS 只走 HTTP,不编译期耦合)
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
rand = "0.8"
hex = "0.4"
# 登录口令加解密(与上游前端 cipher.ts 对齐):AES-256-ECB + MD5
# 🔴 版本组合自洽,别混用:aes 0.8 / ecb 0.1 都依赖 cipher 0.4 家族;
# aes 0.9 / ecb 0.2 是 cipher 0.5 家族,两套泛型不通用。
# 🔴 md-5 钉 0.10(crate 名 `md5`,`use md5::{Digest, Md5};`);0.11 的 API 不同。
aes = "0.8"
ecb = "0.1"
md-5 = "0.10"
# 登录表单解析(application/x-www-form-urlencoded)。
# ⚠️ axum 0.8.9 的 `Form<T>` 只实现 `FromRequest`、不实现 `OptionalFromRequest`
# ⇒ `Option<Form<T>>` 编译不过 ⇒ 改为「取原始 body + serde_urlencoded 自己解析」。
# `serde_urlencoded 0.7.1` 已在 `Cargo.lock` 里(axum 的传递依赖)⇒ 不引入新下载。
serde_urlencoded = "0.7"
# 内嵌 PostgreSQL(进程内原生编译,非 WASM):承载全部 tdc_* 业务数据
# 包名 pglite-rs,import 为 pglite。无需扩展时不用 build.rs/export_dynamic。
pglite-rs = "0.2"
# 真实 UTC 时间戳(last_heartbeat / 同步日志用,避免手写日历换算)
chrono = { version = "0.4", default-features = false, features = ["clock"] }
[dev-dependencies]
# 路由级中间件测试(Task 5 fix round 1):`tower::ServiceExt::oneshot` 打请求
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
[profile.release]
opt-level = 2
lto = "thin"
strip = "symbols" # 发布包剥离符号表,体积减半以上
# 🔴 不要设 `panic = "abort"`:单进程链接 sspf 后,平台契约 §6.5 要求
# panic ⇒ HTTP 200 + code=400,catch-all 中间件依赖默认的 `panic = "unwind"`。
# abort 下 `catch_unwind` 抓不到 ⇒ 进程直接死、客户端连接重置。
codegen-units = 16
[profile.dev]
incremental = false