CpfPatrick/dsh-codex-keychain ↗★ 0
dsh-codex-keychain
Unofficial ChatGPT OAuth provider for DeepSeek Harness with strict native OS keychain storage
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CpfPatrick/dsh-codex-keychain说明文档
阅读完整 README ↗dsh-codex-keychain
这是一个独立、非官方的 DeepSeek Harness
ChatGPT OAuth 插件。它注册 openai-codex 模型路由,并把完整 OAuth 凭据严格保存到操作系统原生凭据库:
- macOS Keychain
- Windows Credential Manager
- Linux Secret Service
它不需要 OpenAI Platform API key,不会降级到普通凭据文件,也不会读取或修改
~/.codex/auth.json。
[!IMPORTANT] ChatGPT 订阅与 OpenAI Platform API 是不同产品。本插件只连接符合条件的 ChatGPT 账户所能使用的 Codex 后端,不代表 OpenAI 或 DeepSeek 官方产品。
当前状态
0.1.0-alpha.1 是开发者预览版,初始兼容目标为 DeepSeek Harness
0.1.0-rc.6 与 @earendil-works/pi-ai 0.82.1。
安装
dsh plugin --profile web add dsh-codex-keychain@next
dsh web
打开 设置 → OpenAI Codex,点击 使用浏览器登录,再点击 打开授权页面
并完成 OpenAI 授权。插件不会修改默认模型;登录后请在 DSH 模型选择器中手动选择
openai-codex 模型。
无界面服务器或本地回调端口不可用时,使用设备码:
dsh plugin --profile web exec dsh-codex-keychain login --device-code
CLI
dsh plugin --profile web exec dsh-codex-keychain login
dsh plugin --profile web exec dsh-codex-keychain login --device-code
dsh plugin --profile web exec dsh-codex-keychain status
dsh plugin --profile web exec dsh-codex-keychain status --json
dsh plugin --profile web exec dsh-codex-keychain logout
status --json 只输出登录状态、provider、平台、存储后端,以及失败时的固定错误码与
安全文案;不包含 token、账户 ID 或 token 时间戳。
安全设计
插件把带版本号的清单与限长 Base64 分块全部保存为系统凭据项。固定 service 为
io.github.CpfPatrick.dsh-codex-keychain;根 account 为规范化 DSH_HOME 的
SHA-256,分块 account 从该摘要派生,因此不同 Harness home 不会共用可旋转的
refresh token。两个固定分区保证更新安全:先完整写入并校验新分区,再切换小型清单,
最后清理旧分区;每个凭据项也保持在 Windows Credential Manager 的单项上限以内。
刷新和退出登录通过 $DSH_HOME/.locks 下不含秘密的跨进程锁串行化。刷新失败会保留
原凭据,供稍后重试或重新登录。如果系统凭据库缺失、被锁定或不可用,插件会报告
KEYCHAIN_UNAVAILABLE 并拒绝登录,不会静默写入文件。
Web 认证 RPC 只接受 loopback。远程访问 DSH 时,必须在 DSH 主机上运行 CLI。 OAuth URL 与设备码属于短期交互数据;插件不会把它们写入应用日志或持久存储。CLI 会在 登录所需时显示它们,请勿分享或录制该段终端输出。
更多说明见 SECURITY.md。
故障排查
- **macOS 显示 :**解锁登录钥匙串,并允许终端或 DSH 进程 使用它。插件仍会加载,但在安全存储恢复前会拒绝模型请求。