- 新增 git submodule deps/ipass(指向 ipass/ipass,pin 9c46e27),内核与通用能力插件统一收归子模块 - 删除仓库内 crates/ipass-core、vendor/ngx-rust、crates/plugin-domain - source/rust/Cargo.toml 改为 members=[plugin-sso, gateway] + exclude=[../../deps/ipass],ngx/nginx-sys/ipass-core 改为 ../../deps/ipass/... 的 path 依赖 - gateway 移除 plugin-domain 装配:PLUGINS=[SsoPlugin, CorePlugin],去除 ipass_proxy 指令 / domain 开关 / set_flag_domain - plugin-sso 新增 compat.rs 兼容层,重建被主线内核移除的 4 个 http 辅助函数(body_object/json_body/send_ct/redirect),scim/cas/portal/reset.rs 改走 crate::compat - 删除 tests/domain-e2e.sh,run-local-e2e.sh 的域名测试调用一并移除(e2e 由 7 套降为 6 套) - 更新 README/CLAUDE/docs 反映子模块结构;构建已验证:cargo build --release 通过,产出 libsso_gateway.dylib
64 lines
3.1 KiB
TOML
64 lines
3.1 KiB
TOML
# iPass SSO 网关 —— Cargo workspace
|
||
#
|
||
# 结构(参考 ipass/cache 的插件化拆分思路):
|
||
# 本仓库只持有「SSO 身份网关」自身:
|
||
# crates/plugin-sso —— 身份插件:OAuth2/OIDC 签发与校验、IAP 身份注入
|
||
# gateway —— 装配层:module 壳 + 插件注册表 → 产出单个 .so
|
||
#
|
||
# 通用框架(内核 ipass-core / 唯一 cdylib 装配 / vendored ngx-rust / 其它子系统)
|
||
# 全部来自主项目 ipass/ipass,经仓库根 `deps/ipass` git submodule 引入,
|
||
# 不在此仓库重复维护(避免与上游内核 fork 漂移)。
|
||
#
|
||
# 为什么是「单 .so + crate 级插件」而不是「多 .so 运行时插件」:
|
||
# nginx 动态模块没有稳定 ABI,Rust 侧更是如此(每个 cdylib 各链一份 std)。
|
||
# 跨 .so 共享状态要自己造 C ABI 契约,且 zone tag / 同名变量都会冲突
|
||
# (详见 docs/plugin-architecture-analysis.md)。
|
||
#
|
||
# ⚠️ deps/ipass 是独立 workspace,必须 exclude,否则 cargo 报歧义。
|
||
[workspace]
|
||
members = ["crates/plugin-sso", "gateway"]
|
||
exclude = ["../../deps/ipass", "target"]
|
||
|
||
[workspace.package]
|
||
version = "1.0.0"
|
||
edition = "2021"
|
||
publish = false
|
||
|
||
# ---------------------------------------------------------------------------
|
||
# ⚠️ 依赖必须用 vendored 源码(deps/ipass 子模块内的 ngx-rust),不能走 crates.io,
|
||
# 也不能走 git:
|
||
#
|
||
# 1) `ngx = "0.5"`(crates.io 0.5.1)只发布了配置阶段接口(HttpModule),
|
||
# 请求阶段 API(add_phase_handler / HttpPhase / HttpRequestHandler)尚未发版,
|
||
# 实测直接编译失败:unresolved imports `ngx::http::HttpPhase`
|
||
#
|
||
# 2) git 依赖会永久挂起:ngx-rust 挂了一个指向完整 nginx 仓库的 submodule
|
||
# [submodule "nginx-src/nginx"] url = https://github.com/nginx/nginx.git
|
||
# cargo 解析 git 依赖时会 update_submodules,去克隆几十 MB 的 nginx 仓库,
|
||
# 国内网络下卡死(实测 cargo 5 分钟 0% CPU,调用栈停在
|
||
# GitSource::block_until_ready -> GitCheckout::update_submodules -> fetch -> wait4)。
|
||
#
|
||
# 因此 vendor 到 deps/ipass/rust/vendor/ngx-rust/,用 path 依赖:
|
||
# 离线可编译、无子模块、版本锁定。
|
||
# ---------------------------------------------------------------------------
|
||
[workspace.dependencies]
|
||
ngx = { path = "../../deps/ipass/rust/vendor/ngx-rust" }
|
||
nginx-sys = { path = "../../deps/ipass/rust/vendor/ngx-rust/nginx-sys" }
|
||
ipass-core = { path = "../../deps/ipass/rust/crates/ipass-core" }
|
||
plugin-sso = { path = "crates/plugin-sso" }
|
||
|
||
# 业务层依赖:全部是纯 Rust 实现,不引入任何系统库或常驻依赖
|
||
serde = { version = "1", features = ["derive"] }
|
||
serde_json = "1" # 空 Vec / Vec<Map> 天然序列化为 [] / {},前后端契约简单
|
||
sha2 = "0.10" # 口令哈希 + JWT 的 HMAC-SHA256 + PKCE S256
|
||
getrandom = "0.2" # 会话 token / 授权码 / 客户端密钥;不可退化成可预测伪随机
|
||
libc = "0.2" # 仅用于 localtime_r / time / strftime
|
||
|
||
[profile.release]
|
||
opt-level = 3
|
||
lto = true
|
||
codegen-units = 1
|
||
# 模块被加载进 nginx 这个 C 进程,panic 绝不能跨 FFI 边界展开
|
||
panic = "abort"
|
||
strip = true
|