From f35252e26704f88c4a840c529eb699da251224de Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 9 Oct 2026 17:43:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(deploy):=20=E5=B7=A5=E4=BD=9C=E5=8F=B0=20+?= =?UTF-8?q?=20=E4=BC=81=E5=BE=AE=20OAuth=20=E9=83=A8=E7=BD=B2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE(v0.7.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **影响** - 镜像 tag 升 `ipass-sso-v0.6.1` → `ipass-sso-v0.7.0`,需重建 + push - pod env 增 5 条 WXWORK_*;SECRET 走 `kubectl set env` 注入(不进 git) - 域名 `i96772757dm.mayishangshu.cn:88/portal/wxwork/callback` 配到 WXWORK_REDIRECT - 新增 `nginx ~* ^/WW_verify_.*\.txt$` 静态,文件在 PVC `data/verify/` **改动** - `deploy/k8s/ipass-sso.yaml` 镜像 tag 升一档 + container env 加 5 条;SECRET 用占位 `REPLACE_ME_VIA_KUBECTL_SET_ENV` - `deploy/nginx.conf` env 白名单 5 条;`location ~* ^/WW_verify_` 静态出 - `data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt` 占位文件,部署时由 seed-verify.sh 复制到 PVC - `scripts/seed-verify.sh` 幂等复制脚本(已存在则跳过),不覆盖现场值 - `rust/Cargo.toml` / `Cargo.lock` workspace 增 `ureq` 间接(实际由 plugin-sso 引入) - `docs/superpowers/specs/2026-10-09-sso-workbench-wxwork-design.md` 设计文档 **设计** - 校验文件放 PVC 不放镜像(与 tls/ 同思路):换内容不重打镜像 - 部署后第一步:`kubectl -n wuguirong set env deploy/ipass-sso WXWORK_SECRET=<真值>`,触发滚动 - 启动日志若 `wxwork::route` 全部 None(=enabled=false),提示「WXWORK_ENABLED 未开或 SECRET 缺」 Co-Authored-By: Claude Code --- .../verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt | 1 + deploy/k8s/ipass-sso.yaml | 17 +- deploy/nginx.conf | 15 + .../2026-10-09-sso-workbench-wxwork-design.md | 193 +++ rust/Cargo.lock | 1386 +---------------- rust/Cargo.toml | 3 + scripts/seed-verify.sh | 35 + 7 files changed, 348 insertions(+), 1302 deletions(-) create mode 100644 data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt create mode 100644 docs/superpowers/specs/2026-10-09-sso-workbench-wxwork-design.md create mode 100755 scripts/seed-verify.sh diff --git a/data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt b/data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt new file mode 100644 index 0000000..e5dd72d --- /dev/null +++ b/data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt @@ -0,0 +1 @@ +PLACEHOLDER_REPLACE_WITH_WECHAT_WORK_CONSOLE_VALUE diff --git a/deploy/k8s/ipass-sso.yaml b/deploy/k8s/ipass-sso.yaml index bbb9f37..710bcd6 100644 --- a/deploy/k8s/ipass-sso.yaml +++ b/deploy/k8s/ipass-sso.yaml @@ -42,7 +42,7 @@ spec: # 之后业务写盘才炸,最难查)。幂等,每次滚动都会跑。 initContainers: - name: init-data-dir - image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx:ipass-sso-v0.6.1 + image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx:ipass-sso-v0.7.0 imagePullPolicy: IfNotPresent command: ["bash", "-c", "mkdir -p /persist/sso && ls -la /persist"] securityContext: @@ -54,7 +54,7 @@ spec: mountPath: /persist containers: - name: ipass-sso - image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx:ipass-sso-v0.6.1 + image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx:ipass-sso-v0.7.0 imagePullPolicy: IfNotPresent ports: - name: http @@ -72,6 +72,19 @@ spec: # 固定签名密钥:不设则 seed 随机生成,Pod 重启后已签发 token 全部失效 - name: OAUTH_SIGNING_SECRET value: "ipass-sso-k8s-dev-signing-key-2026" + # 企微 OAuth(v0.7.0 工作台用企微登录入口) + # ⚠️ SECRET 是高敏感凭据,不能进 git 史;apply 后用: + # kubectl -n wuguirong set env deploy/ipass-sso WXWORK_SECRET=<真值> + - name: WXWORK_ENABLED + value: "true" + - name: WXWORK_CORP_ID + value: "wwac71328171b889cb" + - name: WXWORK_AGENT_ID + value: "1000015" + - name: WXWORK_SECRET + value: "REPLACE_ME_VIA_KUBECTL_SET_ENV" + - name: WXWORK_REDIRECT + value: "https://i96772757dm.mayishangshu.cn:88/portal/wxwork/callback" securityContext: runAsUser: 10106 runAsNonRoot: true diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 8181425..4388ad2 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -30,6 +30,12 @@ env SYNC_WORKWECHAT_URL; env SYNC_FEISHU_URL; env PASSWORD_RESET_TOKEN_SINK; env PASSWORD_RESET_TTL; +# 企微 OAuth 集成(2026-10-09 v0.7.0)—— 工作台「用企微登录」入口 +env WXWORK_ENABLED; +env WXWORK_CORP_ID; +env WXWORK_AGENT_ID; +env WXWORK_SECRET; +env WXWORK_REDIRECT; events { worker_connections 2048; @@ -133,5 +139,14 @@ http { } # 装配层自定义页清单(精简版不挂自定义页,无 /static/custom/) # 老管理台多页应用(精简版不集成老管理台,无 /legacy/) + + # ---- 企微域名校验文件(v0.7.0+)---- + # 文件在 PVC 的 verify/ 目录(/usr/local/nginx/data/verify/WW_verify_*.txt), + # 部署时由 scripts/seed-verify.sh 从 data-seed/verify/ 复制过去。 + # 留空内容即可命中(Content-Type 显式给 text/plain)。 + location ~* ^/WW_verify_[A-Za-z0-9_-]+\.txt$ { + root /usr/local/nginx/data/verify; + add_header Content-Type "text/plain; charset=utf-8" always; + } } } \ No newline at end of file diff --git a/docs/superpowers/specs/2026-10-09-sso-workbench-wxwork-design.md b/docs/superpowers/specs/2026-10-09-sso-workbench-wxwork-design.md new file mode 100644 index 0000000..f68f726 --- /dev/null +++ b/docs/superpowers/specs/2026-10-09-sso-workbench-wxwork-design.md @@ -0,0 +1,193 @@ +# SSO 通用工作台 + 企微 OAuth 集成 — 设计 + +**日期**: 2026-10-09 +**目标**: 把 SSO 的「认证 / 身份 / 代理 / 企微认证」四块能力收口成一个 Web 工作台 +**部署**: 本地容器,域名 `i96772757dm.mayishangshu.cn:88` → 宿主机 28889 + +--- + +## 1. 范围 + +工作台 = 浏览器打开后的「统一入口」。形态:单页 HTML(服务端渲染),不引前端框架, +复用现有 `ipass-plugin-sso/src/portal.rs` 的卡片布局风格。 + +四种登录方式并存(已存在的 `用户名+密码+TOTP+CAPTCHA` + 新增的 `企微 OAuth`): +- 走 `企微 OAuth` 的用户在 SSO 里是「次级身份」,只在 `users.json` 里多一个 `extra.wx_userid` 字段,其他照常。 +- 后续管理员可以在「账号管理」里给这类用户改密 / 补字段(已有 `accounts.rs` 流程)。 + +## 2. WeChat Work OAuth 流(新增) + +### 2.1 配置(env) + +``` +WXWORK_CORP_ID = wwac71328171b889cb +WXWORK_AGENT_ID = 1000015 +WXWORK_SECRET = +WXWORK_ENABLED = true # 缺省 false,显式开启 +WXWORK_REDIRECT = https://i96772757dm.mayishangshu.cn:88/portal/wxwork/callback +``` + +### 2.2 端点(新) + +| Method | Path | 说明 | +|---|---|---| +| GET | `/portal/wxwork/login?redirect=...` | 生成 state(防 CSRF),302 到企微授权页 | +| GET | `/portal/wxwork/callback?code=&state=` | 校验 state → 换 access_token → 拉 userinfo → upsert user → 写 `sso_sid` cookie → 302 到 `redirect` 或 `/workbench` | +| GET | `/workbench` | 工作台页(已登录才显示;未登录跳 `/login`) | +| GET | `/WW_verify_.txt` | 域名校验文件(nginx 静态) | + +### 2.3 授权 URL(scope = snsapi_privateinfo) + +``` +https://open.weixin.qq.com/connect/oauth2/authorize + ?appid={corp_id} + &redirect_uri={callback} + &response_type=code + &scope=snsapi_privateinfo + &agentid={agent_id} + &state={csrf_token} + #wechat_redirect +``` + +### 2.4 拿到 code 后 + +``` +1. POST https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo + ?access_token=... + &code={code} + → { UserId, DeviceId, OpenId, ... } + +2. POST https://qyapi.weixin.qq.com/cgi-bin/auth/getuserdetail + ?access_token=... + &user_ticket={user_ticket} + → { userid, name, avatar, ... } // 头像仅此接口返回,需 user_ticket + +3. 拿到 access_token 步骤: + GET https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={corp_id}&corpsecret={secret} + → { access_token, expires_in } +``` + +为减少一次外部请求,合并到一次 `gettoken` + `getuserinfo`(+ 视情况 `getuserdetail`)。 +token 缓存:进程内 `OnceLock<...>` + 提前 60s 刷新,避免每次回调都打 `gettoken`。 + +### 2.5 用户映射(自动建账号) + +按 `UserId` 查 `users.json`(`extra.wx_userid` 命中): +- **命中** → 复用现有 user,只刷 `sso_sid` cookie +- **未命中** → 自动创建 + - `username` = `wx_{UserId}`(只保留 ASCII,企微 userid 已是) + - `display_name` = `name`(来自 `getuserdetail`;拿不到就空) + - `role` = `user` + - `extra.wx_userid` = `UserId` + - `extra.wx_avatar` = `avatar`(来自 `getuserdetail`,可选) + - `extra.wx_openid` = `OpenId`(来自 `getuserinfo`) + - `pwd_hash` / `salt` = 随机占位(企微用户改密走 API 单独处理,**不开放 `/login` 密码登录**) + - `api_key` = 标准 `sk_...`(给后续 LLM 代理用,跟其他用户对齐) + - `created_at` = now + - `extra.wx_source = "privateinfo"`(标记) + +⚠️ 企微用户**不**用「密码 + TOTP」方式登录,登录按钮灰色 / 不展示密码输入框, +只展示「用企微登录」入口。后续若管理员给该用户补了密码,自动解锁密码登录。 + +## 3. 工作台 UI(扩展现有 `/apps`) + +### 3.1 渲染条件 + +`/workbench` 与现有 `/apps` 行为一致(都调 `h_apps_page`),只是模板换名 + 多了 +身份卡片 + 企微登录按钮。两者互为别名(同一 handler,新模板取代旧模板)。 + +### 3.2 模板布局 + +``` +┌─────────────────────────────────────────────────┐ +│ 🏢 统一工作台 您好,{display_name} [退出登录] │ +├─────────────────────────────────────────────────┤ +│ ┌─身份 ─────────────────────────────────────┐ │ +│ │ 用户名: {username} 来源: SSO/企微 │ │ +│ │ 角色: admin/user 部门: {dept} │ │ +│ │ 邮箱: {email} 组: {groups} │ │ +│ │ API Key: sk_xxxx [复制] [重置] │ │ +│ │ 上次登录: {ts} │ │ +│ └────────────────────────────────────────────┘ │ +│ │ +│ ┌─常用 ─────────────────────────────────────┐ │ +│ │ [🛡️ 管理台] [🤖 LLM] [🔌 API代理] │ │ +│ │ [🌐 域名转发] [🔑 我的 Key] │ │ +│ └────────────────────────────────────────────┘ │ +│ │ +│ ┌─已接入应用 ───────────────────────────────┐ │ +│ │ {oauth_clients 里登记的应用,卡片} │ │ +│ └────────────────────────────────────────────┘ │ +│ │ +│ Powered by WeChat Work · corp wwac7132... │ +└─────────────────────────────────────────────────┘ +``` + +未登录时:身份卡片显示「用企微登录」大按钮(跳 `/portal/wxwork/login?redirect=/workbench`), +下方显示「或用账号密码登录」折叠表单(走现有 `/login` 流程)。 + +### 3.3 行为要点 + +- 复制 API Key:`navigator.clipboard.writeText` + Toast +- 重置 API Key:弹窗确认 → 调现有 `POST /api/admin/users/key`(管理员)或新增 + `POST /api/me/key`(普通用户自助) → 刷新页面 +- 企微登录按钮:在已登录用户视图下**隐藏**(避免误触发;真要切身份走退出登录) +- 「来源:企微」标签只在 `extra.wx_source == "privateinfo"` 时显示 +- 「上次登录」读 `extra.last_login_at` 字段,本次登录时回写(用 `update_extra`) +- 移动端:复用现有响应式 CSS(单列,卡片堆叠) + +## 4. 域名校验文件 + +- 路径:数据卷 `nginx-data/sso/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt` +- 内容:企业微信后台下载时给定的纯文本 +- nginx 静态: + +```nginx +location ~* ^/WW_verify_[A-Za-z0-9_-]+\.txt$ { + root /usr/local/nginx/data/verify; + add_header Content-Type text/plain; +} +``` + +放在数据卷而非镜像内,证书换一次不用重打镜像(和 `tls/` 同思路)。 + +## 5. 端口 + +- 容器内仍 listen `18098`(K8s manifest 不动) +- K8s Service `30082 → 18098` 不动 +- 外部域名 `i96772757dm.mayishangshu.cn:88 → 192.168.1.18:28889` 由用户侧路由器/DNS + 处理,网关本身不直接 listen 88 +- `OAUTH_ISSUER` 与 `WXWORK_REDIRECT` 都用域名 URL + (`https://i96772757dm.mayishangshu.cn:88`) + +## 6. 文件改动 + +| 文件 | 改动 | +|---|---| +| `ipass-plugin-sso/src/wxwork.rs` (新) | OAuth 流程 + token 缓存 + user upsert + 端点 | +| `ipass-plugin-sso/src/lib.rs` | `mod wxwork;` + 在 `dispatch_api` 转发 `/portal/wxwork/*` | +| `ipass-plugin-sso/src/portal.rs` | 模板升级为工作台版(身份卡片 + 企微登录按钮 + 来源标签) | +| `ipass-sso/deploy/nginx.conf` | 3 条 `env WXWORK_*` + 1 条 `location` 校验文件 | +| `ipass-sso/deploy/k8s/ipass-sso.yaml` | container env 加 3 条 + image tag 升一档 + nodePort 注释 | +| `ipass-sso/data-seed/verify/WW_verify_rA7XMVuzBQ7kaXWZ.txt` (新) | 校验文件占位 | +| `ipass-sso/scripts/seed-verify.sh` (新) | 部署时从 `data-seed/verify/` 复制到 PVC `nginx-data/sso/verify/`(幂等) | + +## 7. 不做(明确 YAGNI) + +- 企微扫码登录(网页里弹二维码 → 用企微 App 扫)— 用户要求是「企微工作台里 + 打开应用」的模型,不是「PC 网页扫码」 +- 企微消息推送 / 通讯录同步(已有 `sync.rs` 路径,够用) +- 企微用户登出时调 `/cgi-bin/auth/revoke`(本 SSO 已销毁 sso_sid,效果等价) +- 给企微用户发密码重置链接(改密走管理员流程) +- 企微用户的头像实时同步(`getuserdetail` 一次性写入,后续不变) +- 工作台主题 / 自定义皮肤(灰白蓝就够了,跟现有 portal 一致) + +## 8. 风险与回滚 + +| 风险 | 缓解 | +|---|---| +| 企微 access_token 泄露(进 env / 日志) | `OnceLock` 持有,**不打印**,err 信息只说「企微服务异常」 | +| 自动建账号被滥用(任意企业成员都能登录) | v1 不做限制;后续可加 `WXWORK_ALLOWED_USERS` 白名单(逗号分隔 userid) | +| 用户误删企微用户的 SSO 账号 | 普通 `/api/admin/users/delete` 流程,审计照常;企微用户下次登录会被重建(同 userid) | +| `WXWORK_REDIRECT` 与实际 URL 不一致 → 企微报 redirect_uri 错误 | K8s 启动日志打印当前 `redirect`;环境差异 fail-fast | +| 域名校验文件被改 | 数据卷不在镜像里,改也只影响 `nginx-data/sso/verify/`,重 deploy 不丢 | diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 0da5325..bcb318e 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -17,44 +17,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c880a97d28a3681c0267bd29cff89621202715b065127cd445fa0f0fe0aa2880" -[[package]] -name = "android_system_properties" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" - -[[package]] -name = "async-trait" -version = "0.1.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.6", -] - -[[package]] -name = "autocfg" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -67,7 +29,7 @@ version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.13.2", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -81,12 +43,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.13.2" @@ -102,18 +58,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bumpalo" -version = "3.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" - -[[package]] -name = "bytes" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" - [[package]] name = "cc" version = "1.5.1" @@ -139,20 +83,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" -[[package]] -name = "chrono" -version = "0.4.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-link", -] - [[package]] name = "clang-sys" version = "1.9.1" @@ -164,38 +94,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "core_detect" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" - [[package]] name = "cpufeatures" version = "0.2.17" @@ -248,39 +146,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" -[[package]] -name = "encoding_rs" -version = "0.8.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679" -dependencies = [ - "cfg-if", - "core_detect", - "multiversion_no_op", - "rustversion", - "scopeguard", - "simdutf8", -] - -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - [[package]] name = "errno" version = "0.3.14" @@ -291,39 +156,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "fastrand" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" - [[package]] name = "find-msvc-tools" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -333,66 +171,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "futures-channel" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" - -[[package]] -name = "futures-io" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" - -[[package]] -name = "futures-macro" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.6", -] - -[[package]] -name = "futures-sink" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" - -[[package]] -name = "futures-task" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" - -[[package]] -name = "futures-util" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -414,167 +192,12 @@ dependencies = [ "wasi", ] -[[package]] -name = "getrandom" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" -dependencies = [ - "cfg-if", - "libc", - "r-efi", -] - [[package]] name = "glob" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" -[[package]] -name = "h2" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" - -[[package]] -name = "hermit-abi" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "html-escape" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9356095b4b41197bba32173600e1582792cda618f65d12f68e2e77d273413c5" - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" - -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.10", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "2.3.0" @@ -679,38 +302,11 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "indexmap" -version = "2.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "ipass-all-gateway" -version = "1.0.0" -dependencies = [ - "ipass-core", - "ipass-plugin-apix", - "ipass-plugin-cache", - "ipass-plugin-domain", - "ipass-plugin-llm", - "ipass-plugin-sso", - "ipass-plugin-waf", - "nginx-sys", - "ngx", - "serde", - "serde_json", -] - [[package]] name = "ipass-core" version = "2.0.0" dependencies = [ - "getrandom 0.2.17", + "getrandom", "libc", "nginx-sys", "ngx", @@ -719,59 +315,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "ipass-plugin-apix" -version = "2.0.0" -dependencies = [ - "ipass-core", - "ipass-plugin-llm", - "nginx-sys", - "ngx", - "serde", - "serde_json", -] - -[[package]] -name = "ipass-plugin-cache" -version = "2.0.0" -dependencies = [ - "ipass-core", - "nginx-sys", - "ngx", - "serde", - "serde_json", -] - -[[package]] -name = "ipass-plugin-domain" -version = "2.0.0" -dependencies = [ - "ipass-core", - "nginx-sys", - "ngx", - "serde", - "serde_json", -] - -[[package]] -name = "ipass-plugin-llm" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "env_logger", - "ipass-core", - "log", - "nginx-sys", - "ngx", - "reqwest", - "serde", - "serde_json", - "tokio", - "uuid", -] - [[package]] name = "ipass-plugin-sso" version = "2.0.0" @@ -782,45 +325,19 @@ dependencies = [ "serde", "serde_json", "sha2", + "ureq", ] [[package]] -name = "ipass-plugin-waf" -version = "0.1.0" +name = "ipass-sso-gateway" +version = "1.0.0" dependencies = [ "ipass-core", - "ipnetwork", - "libc", + "ipass-plugin-sso", "nginx-sys", "ngx", - "once_cell", "serde", "serde_json", - "thiserror", - "zentinel-modsec", -] - -[[package]] -name = "ipnet" -version = "2.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" - -[[package]] -name = "ipnetwork" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf370abdafd54d13e54a620e8c3e1145f28e46cc9d704bc6d94414559df41763" - -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", ] [[package]] @@ -838,17 +355,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "js-sys" -version = "0.3.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" -dependencies = [ - "cfg-if", - "futures-util", - "wasm-bindgen", -] - [[package]] name = "libc" version = "0.2.189" @@ -865,12 +371,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - [[package]] name = "litemap" version = "0.8.3" @@ -892,68 +392,18 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - [[package]] name = "memchr" version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "mio" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "multiversion_no_op" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" - -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nginx-sys" version = "0.5.0" @@ -985,148 +435,18 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "openssl" -version = "0.10.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" -dependencies = [ - "bitflags 2.13.2", - "cfg-if", - "foreign-types", - "libc", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - -[[package]] -name = "openssl-sys" -version = "0.9.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link", -] - [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "pkg-config" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" - [[package]] name = "potential_utf" version = "0.1.6" @@ -1155,15 +475,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "quick-xml" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" -dependencies = [ - "memchr", -] - [[package]] name = "quote" version = "1.0.47" @@ -1173,21 +484,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.13.2", -] - [[package]] name = "regex" version = "1.13.1" @@ -1218,45 +514,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] -name = "reqwest" -version = "0.11.27" +name = "ring" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "winreg", + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -1266,46 +534,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] -name = "rustix" -version = "1.1.5" +name = "rustls" +version = "0.23.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d" +checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" dependencies = [ - "bitflags 2.13.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-pki-types" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ - "base64 0.21.7", + "zeroize", ] [[package]] -name = "rustversion" -version = "1.0.23" +name = "rustls-webpki" +version = "0.103.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "schannel" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" dependencies = [ - "windows-sys 0.61.2", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -1314,29 +574,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags 2.13.2", - "core-foundation 0.10.1", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "serde" version = "1.0.229" @@ -1380,29 +617,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.9" @@ -1426,66 +640,24 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - -[[package]] -name = "siphasher" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - [[package]] name = "smallvec" version = "1.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "2.0.119" @@ -1508,12 +680,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "synstructure" version = "0.14.0" @@ -1525,69 +691,6 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.3", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "2.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.6", -] - [[package]] name = "tinystr" version = "0.8.4" @@ -1598,101 +701,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "tokio" -version = "1.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" -dependencies = [ - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.6.5", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.6", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "libc", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "typenum" version = "1.20.1" @@ -1705,6 +713,29 @@ version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "url", + "webpki-roots 0.26.11", +] + [[package]] name = "url" version = "2.5.8" @@ -1723,39 +754,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "uuid" -version = "1.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" -dependencies = [ - "getrandom 0.4.3", - "js-sys", - "serde_core", - "wasm-bindgen", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -1763,126 +767,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasm-bindgen" -version = "0.2.129" +name = "webpki-roots" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", + "webpki-roots 1.0.9", ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.79" +name = "webpki-roots" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" dependencies = [ - "js-sys", - "tokio", - "wasm-bindgen", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.129" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.129" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 3.0.6", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.129" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", + "rustls-pki-types", ] [[package]] @@ -1891,40 +790,13 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1936,67 +808,34 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2009,64 +848,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "writeable" version = "0.6.4" @@ -2096,31 +901,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zentinel-modsec" -version = "0.4.0" -dependencies = [ - "aho-corasick", - "base64 0.22.1", - "glob", - "hex", - "html-escape", - "ipnetwork", - "md-5", - "once_cell", - "percent-encoding", - "phf", - "quick-xml", - "regex", - "regex-syntax", - "serde", - "serde_json", - "sha1", - "sha2", - "thiserror", - "tracing", -] - [[package]] name = "zerofrom" version = "0.1.8" @@ -2142,6 +922,12 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zeroize" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879" + [[package]] name = "zerotrie" version = "0.2.5" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index a1d68d6..e2f4473 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -33,6 +33,9 @@ ipass-plugin-sso = { path = "../../ipass-plugin-sso" } # 业务层依赖:全部是纯 Rust 实现,不引入任何系统库或常驻依赖 serde = { version = "1", features = ["derive"] } serde_json = "1" +# 企微 OAuth 需要 HTTPS 给 qyapi.weixin.qq.com;ureq + rustls 是最小可行栈 +# (rustls 纯 Rust,不引系统 openssl) +ureq = { version = "2.10", default-features = false, features = ["tls", "json"] } [profile.release] opt-level = 3 diff --git a/scripts/seed-verify.sh b/scripts/seed-verify.sh new file mode 100755 index 0000000..fa0955d --- /dev/null +++ b/scripts/seed-verify.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# 把 data-seed/verify/ 下的企微域名校验文件复制到 PVC 上的 verify 目录。 +# +# 目的:验证文件放在 PVC(persist 目录),不重打镜像就能换内容; +# 与 tls/、users.json 等运行时数据并列。 +# +# 用法:bash scripts/seed-verify.sh +# 例: bash scripts/seed-verify.sh /persist/sso +# +# 幂等:已存在的同名文件**不覆盖**(避免误盖现场临时调试值)。 +# 要重置请先 rm。 +set -euo pipefail + +PERSIST="${1:?usage: seed-verify.sh }" +SRC="$(cd "$(dirname "$0")/.." && pwd)/data-seed/verify" + +[ -d "$SRC" ] || { echo "[seed-verify] 源目录不存在: $SRC"; exit 0; } +mkdir -p "$PERSIST/verify" + +copied=0; skipped=0 +for f in "$SRC"/*; do + [ -f "$f" ] || continue + name="$(basename "$f")" + dst="$PERSIST/verify/$name" + if [ -e "$dst" ]; then + skipped=$((skipped + 1)) + echo "[seed-verify] 已存在,跳过: $name" + else + cp "$f" "$dst" + copied=$((copied + 1)) + echo "[seed-verify] 复制: $name" + fi +done + +echo "[seed-verify] 完成:复制 $copied 个,跳过 $skipped 个 → $PERSIST/verify/"