Files
tdc-rs/src/lib.rs
T
adminandClaude Code e475137366 feat(auth): 本地账号层 + JNPF 兼容登录,上游完整控制台可登录
- cipher.rs:MD5 + AES-256-ECB,与上游前端 cipher.ts 逐字对齐(含上游自检向量)
- account.rs:本地账号库存 data/accounts.json(不建 tdc_* 表,30 表口径不变),首启引导 admin
- 新增 POST /api/oauth/Login(grant_type=password)与 /api/permission/Users*(仅管理员)
- AppState 增 accounts 字段与 with_accounts 构造器
- 账号登录走 SessionKind::Account,Auth/Me 返 accessAllowed + account
- README:订正「/api/oauth/Login 尚未实现」并补新端点表

Co-Authored-By: Claude Code <[email protected]>
2026-10-25 11:23:12 +08:00

25 lines
750 B
Rust
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.
//! TDC 连接器(数据接入连接器)—— 本地优先 Rust 重实现。
//!
//! 红线(详见 `CLAUDE.md` 与设计文档 §3.3):
//! - TDC↔TDS 只走 HTTP 契约,绝不编译期耦合。
//! - 前端不直接持有数据库;全部数据访问经 `/api/ssw/tdc/*`。
//! - 业务错误读 body 的 `code`,不只看 HTTP 状态。
//! - 所有 DB 访问持 `state.db_lock`(PGlite 单 in-process backend)。
//! - 任意 SELECT 走 `db::query_json()`(row_to_json 包裹)。
pub mod account;
pub mod auth;
pub mod cipher;
pub mod codec;
pub mod config;
pub mod crud;
pub mod db;
pub mod domain;
pub mod envelope;
pub mod ids;
pub mod protocol;
pub mod registry;
pub mod routes;
pub mod session;
pub mod state;