@eduwork/dsh-oidc 0.2.3 → 0.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.en.md +6 -38
- package/CHANGELOG.md +7 -39
- package/CODE_OF_CONDUCT.en.md +1 -1
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTING.en.md +1 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +21 -130
- package/README_EN.md +36 -0
- package/SECURITY.en.md +1 -1
- package/SECURITY.md +1 -1
- package/SUPPORT.en.md +1 -1
- package/SUPPORT.md +1 -1
- package/docs/EDUWORK-MIGRATION.en.md +3 -31
- package/docs/EDUWORK-MIGRATION.md +3 -31
- package/docs/account-extensions.en.md +6 -6
- package/docs/account-extensions.md +3 -3
- package/docs/architecture.en.md +12 -117
- package/docs/architecture.md +12 -118
- package/docs/compatibility.en.md +6 -62
- package/docs/compatibility.md +6 -62
- package/docs/decisions/0001-one-plugin-composition-boundary.en.md +2 -2
- package/docs/decisions/0001-one-plugin-composition-boundary.md +2 -2
- package/docs/desktop-host.en.md +54 -55
- package/docs/desktop-host.md +63 -64
- package/docs/development.en.md +44 -44
- package/docs/development.md +6 -6
- package/docs/dsh-integration.en.md +13 -48
- package/docs/dsh-integration.md +14 -49
- package/docs/ecnu-reference.en.md +4 -61
- package/docs/ecnu-reference.md +4 -61
- package/docs/enterprise-profile.en.md +10 -31
- package/docs/enterprise-profile.md +11 -32
- package/docs/gateway-auth/README.md +168 -0
- package/docs/gateway-auth/README_EN.md +70 -0
- package/docs/gateway-auth/experimental-oidc-llm.en.md +53 -0
- package/docs/gateway-auth/experimental-oidc-llm.md +53 -0
- package/docs/gateway-auth/litellm-setup.en.md +114 -0
- package/docs/gateway-auth/litellm-setup.md +114 -0
- package/docs/gateway-auth/oidc-llm-draft.en.md +141 -0
- package/docs/gateway-auth/oidc-llm-draft.md +141 -0
- package/docs/getting-started.en.md +17 -122
- package/docs/getting-started.md +16 -225
- package/docs/key-binding-protocol.en.md +10 -220
- package/docs/key-binding-protocol.md +10 -220
- package/docs/oidc-interoperability.en.md +1 -1
- package/docs/oidc-interoperability.md +1 -1
- package/docs/open-integration.en.md +11 -0
- package/docs/open-integration.md +11 -0
- package/docs/public-resource-protocol.en.md +8 -44
- package/docs/public-resource-protocol.md +8 -43
- package/docs/release-checklist.en.md +7 -61
- package/docs/release-checklist.md +7 -61
- package/docs/security-model.en.md +10 -132
- package/docs/security-model.md +10 -132
- package/docs/server-integration-contract.en.md +12 -811
- package/docs/server-integration-contract.md +12 -823
- package/examples/ecnu.enterprise-profile.example.json +14 -19
- package/examples/enterprise-profile.example.json +73 -78
- package/examples/identity-only.example.json +1 -1
- package/examples/litellm.enterprise-profile.example.json +9 -0
- package/examples/oidc-llm.enterprise-profile.example.json +12 -0
- package/examples/resources-discovery.example.json +6 -9
- package/lib/callback-page.js +5 -5
- package/lib/client.js +31 -48
- package/lib/desktop-oidc.js +7 -11
- package/lib/gateway-backend.js +443 -0
- package/lib/gateway-protocol.js +6 -0
- package/lib/index.js +14 -15
- package/lib/litellm-protocol.js +117 -0
- package/lib/model-resource-transport.js +19 -0
- package/lib/oidc-llm-protocol.js +88 -0
- package/lib/oidc.js +37 -323
- package/lib/profile.js +34 -40
- package/lib/provider/authorization-scope.js +46 -0
- package/lib/provider/index.js +11 -2
- package/lib/provider/transforms.js +0 -1
- package/lib/typert-schemas.js +1 -1
- package/lib/typert.host.js +38 -38
- package/lib/typert.remote-client.js +37 -37
- package/package.json +7 -6
- package/protocol/openapi.yaml +33 -240
- package/protocol/resources.openapi.yaml +8 -9
- package/schema/enterprise-profile.v1alpha1.schema.json +595 -193
- package/README.en.md +0 -186
package/CHANGELOG.en.md
CHANGED
|
@@ -6,44 +6,12 @@ All notable changes are documented here. The format follows Keep a Changelog pri
|
|
|
6
6
|
|
|
7
7
|
## [0.2.0] - 2026-09-11
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- Local candidate `0.2.0-dev.20260910.7`: unify the default as `EDUWORK_API_KEY`, accepting legacy automatic Profile/Provider names. Migrate only identical deployment bindings without overwriting the target. Session credential fingerprints prevent another login from reading or clearing the active key. Add Host-only `resolveBoundCredential` for extension adapters; no new RPC or organization-switching UI.
|
|
16
|
-
|
|
17
|
-
- `0.2.0-dev.20260910.6`: public OIDC now owns identity/key/models only. Removed quota HTTP, normalization, RPC fields and UI; legacy native mode no longer calls quota. Added a Host-only bounded model-resource transport and the official `oidc.account.menu.details` child slot for explicitly installed institution extensions.
|
|
18
|
-
- Exact RC.1 closure: 264 DSH packages, 78 tests and 6 compiled-browser checks; includes no implicit quota requests, host credential/destination boundaries and logout races. Existing managed keys and personal model selection survive. Public RFC/OpenAPI no longer require quota; heartbeat remains institution-only.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `0.2.0-dev.20260910.5`: restore the public avatar menu with quota, refresh, sign-out, keyboard navigation and outside-focus dismissal, including collapsed sidebars. Desktop callback cards use configured branding and system fonts without authorization secrets or raw server errors.
|
|
22
|
-
- Adapt to official DSH `0.1.5-rc.1` PiAi `modelErrors`, preserving model capabilities and default selection. Serialize vault cleanup and reject late identity/key/quota writes after logout. A coherent 264-package closure, 75 tests and 7 compiled-browser checks pass; final native assembly belongs to the mainline.
|
|
23
|
-
- Expand the server RFC across identity, resource discovery, key lifecycle, models, quota, refresh/logout, versions and errors; validate resource OpenAPI examples using the real normalizer. Heartbeat is a default-off optional proposal only.
|
|
24
|
-
|
|
25
|
-
- Desktop acceptance revised the same `.20260910.4` candidate: onboarding stays visible with disabled actions while the key is connected but default-model selection is still pending, and closes only after selection completes.
|
|
26
|
-
|
|
27
|
-
- Unpublished candidate `0.2.0-dev.20260910.4` fixes independent stale account state in sign-in, sidebar and organization settings. Late reads cannot overwrite newer state; official credential events and connection recovery refresh all consumers. Explicit sign-in/provisioning uses DSH 0.1.5 default/current-session model APIs; upgrade recovery preserves usable personal choices and personal credentials. Added race regressions, compiled-client rendering, real HTTP PKCE/Key/default-settings tests and a local synthetic server for desktop acceptance.
|
|
28
|
-
|
|
29
|
-
- Unpublished candidate `0.2.0-dev.20260910.3` restores compatibility with the existing `worker.user-center.v1` resource protocol while retaining new protocols and unknown-version checks. Errors distinguish authenticated identity from disconnected model resources. File-managed settings offer host-backed configuration and example buttons; organization settings stay read-only and personal models remain available.
|
|
30
|
-
|
|
31
|
-
- Unpublished `0.2.0-dev.20260910.1` adds desktop OIDC without persistent WebServer: temporary loopback PKCE, Host browser service, safe result polling and cancellation, preserving host credentials and existing resource protocols. See [desktop host integration](docs/desktop-host.en.md).
|
|
32
|
-
|
|
33
|
-
- Unpublished 0.2.0-dev.20260909.1 adds optional identity-only login and public runtime model/quota integration with legacy wire compatibility; the host and client share a single Typert schema.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Changed
|
|
37
|
-
|
|
38
|
-
- Advance the local candidate to `0.1.0-dev.20260908.1`: restore the internal thinking signal lost in the previous effort-capability change. `compat.supportsReasoningEffort: false` still hides effort choices and omits `reasoning_effort`, while thinking follows the profile default. Historical user efforts cannot change that default. Non-reasoning models and explicit profile `off` retain their existing behavior.
|
|
39
|
-
- Add a 19-request real PiAi-to-HTTP regression covering direct, prepared, and DSH LLM calls, constrained model levels, historical `medium`/`xhigh`/`off`, non-reasoning models, and explicitly disabled thinking; checking internal request shape alone is insufficient.
|
|
40
|
-
- Advanced the candidate to `0.1.0-dev.20260907.3`: the complete DSH peer closure adds reviewed `0.1.3-alpha.2` (`82a5fd61…`) while continuing to reject mixed trees. An isolated Runtime with 250 coherent packages passes the complete check and 32 tests without OIDC runtime-source changes.
|
|
41
|
-
- Added a repository handoff entry that distinguishes latest user/mainline messages, historical material, current compatibility evidence, and the separate GitHub, npm, and local-deployment boundaries.
|
|
42
|
-
- Advanced the candidate to `0.1.0-dev.20260907.2`: the model-capability chain now preserves the exact seven reasoning-effort IDs, per-model defaults, and independent wire values. Undeclared levels are no longer supplied by pi-ai defaults, and `xhigh` is never rewritten as `max`.
|
|
43
|
-
- Historical provider defaults conservatively fall back within each model's supported efforts. Model resolution, call preparation, and transport share one capability snapshot; invalid efforts fail before HTTP while thinking-only and non-reasoning semantics remain distinct.
|
|
44
|
-
- Added local development candidate `0.1.0-dev.20260907.1`: the complete DSH peer closure explicitly accepts either `0.1.2-rc.1` or `0.1.3-alpha.1` while rejecting every mixed-version tree.
|
|
45
|
-
- Audited upstream `dsh-v0.1.3-alpha.1` (`d347e703…`) source contracts and an isolated Runtime. SessionHandle, session v2/locking, and asynchronous `agentLoop.create()` are outside OIDC's runtime dependency surface, so no plugin runtime source change is required.
|
|
46
|
-
- Extended the contract probe with OidcAccountService construction and all 13 Typert Remote markers while retaining Settings, LLM/Pi, WebServer, credentials, attachment, and Client-slot coverage.
|
|
9
|
+
- Target DSH 0.1.5-rc.1 and keep enterprise identity, managed keys and model integration independent of institution services.
|
|
10
|
+
- Add desktop OIDC with a temporary loopback callback and host browser integration.
|
|
11
|
+
- Use `EDUWORK_API_KEY` as the default credential reference, migrating matching legacy bindings without overwriting an occupied slot.
|
|
12
|
+
- Add account-extension transport and UI slots for separately installed institution services.
|
|
13
|
+
- Refresh login, account and model-selection state after authentication, with guarded updates during logout.
|
|
14
|
+
- Preserve configured reasoning capabilities and model-specific defaults when preparing requests.
|
|
47
15
|
|
|
48
16
|
## [0.1.0] - 2026-09-06
|
|
49
17
|
|
package/CHANGELOG.md
CHANGED
|
@@ -6,50 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
## [0.2.0] - 2026-09-11
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- 本地候选 `0.2.0-dev.20260910.7`:企业 Key 默认统一为 `EDUWORK_API_KEY`,兼容本 Profile/Provider 的旧自动名称;仅在完整部署绑定一致时迁移,不覆盖新槽位。共享引用按会话 Key 指纹校验归属,避免其他登录读取或清除当前 Key。增加仅供 Host 使用的 `resolveBoundCredential`,供机构适配器读取同一份已验证凭据;无新增 RPC/企业切换界面。
|
|
16
|
-
|
|
17
|
-
- `0.2.0-dev.20260910.6`:公共 OIDC 只保留身份/Key/模型;移除配额 HTTP、归一化、RPC 字段和 UI,旧 native 模式不再调用配额桥。新增 Host 专属的有界模型资源运输和官方 `oidc.account.menu.details` 子插槽,由显式安装的机构扩展提供附加账户内容。
|
|
18
|
-
- 精确 RC.1 闭包 264 个 DSH 包、78 项测试及 6 项编译浏览器检查通过,覆盖无隐式配额请求、凭据/地址边界和注销竞态。保留已有托管 Key 与个人模型选择。公共 RFC/OpenAPI 不再要求配额,心跳仍仅属于机构扩展。
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `0.2.0-dev.20260910.5`:恢复公共头像账户菜单(配额、刷新、注销、键盘操作及失焦关闭),支持折叠侧栏;桌面回调新增无外部字体的品牌卡片,不显示授权秘密或服务端原始错误。
|
|
22
|
-
- 适配官方 DSH `0.1.5-rc.1` 的 PiAi `modelErrors` 契约,保留精确模型能力和默认选模;退出时串行清理保险库,拒绝旧请求写回身份/Key/配额。264 包一致闭包、75 项测试与 7 项编译浏览器回归通过;双桌面最终装配由主线验收。
|
|
23
|
-
- 服务端 RFC 完整覆盖身份、资源发现、Key 生命周期、目录、配额、刷新/注销、版本和错误处理;资源 OpenAPI 示例经过实际归一化器验证。心跳只新增默认关闭的可选协议草案。
|
|
24
|
-
|
|
25
|
-
- 同一 `.20260910.4` 候选在桌面联验后修正选模竞态:创建 Key 已完成但默认模型尚在保存时,登录引导保持可见且操作禁用;选模完成后才收起。
|
|
26
|
-
|
|
27
|
-
- 未发布候选 `0.2.0-dev.20260910.4`:修复登录页、侧栏与企业设置的独立旧状态;拒绝迟到查询覆盖新状态,监听官方凭据事件及连接恢复。明确登录/创建凭据后,使用 DSH 0.1.5 的默认模型和当前会话模型接口;升级时仅修复不可用默认值,保留个人凭据与可用选择。增加共享状态竞态、编译客户端显示、真实 HTTP PKCE/Key/默认设置的回归及双桌面验收用本机模拟服务。
|
|
28
|
-
|
|
29
|
-
- 未发布候选 `0.2.0-dev.20260910.3` 恢复已有资源协议 `worker.user-center.v1` 的兼容,同时保留新协议及未知版本检查;错误提示区分已登录身份与尚未连接的模型资源。配置文件模式增加宿主支持的“打开配置文件 / 查看示例”入口;企业配置保持只读,个人模型仍可使用。
|
|
30
|
-
|
|
31
|
-
- 未发布候选 `0.2.0-dev.20260910.1` 新增无常驻 WebServer 的桌面 OIDC:短时 loopback PKCE、Host 浏览器服务、安全登录轮询与取消,继续使用宿主保险库接口及原资源协议。见 [桌面宿主接入](docs/desktop-host.md)。
|
|
32
|
-
|
|
33
|
-
- 未发布候选 0.2.0-dev.20260909.1 新增纯身份模式及公共模型/配额协议,保留原部署 wire;Host/Client 共享同一份 Typert schema。
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### 变更
|
|
37
|
-
|
|
38
|
-
- 候选版本推进至 `0.1.0-dev.20260908.1`:修复上一轮模型档位适配遗漏 thinking-only 内部启用信号的问题。`compat.supportsReasoningEffort: false` 继续隐藏档位且不发送 `reasoning_effort`,同时按 Profile 默认值保留 thinking;历史会话中的 effort 不改变该默认值。无 reasoning 模型及 Profile 的 `off` 行为保持不变。
|
|
39
|
-
- 新增真实 PiAi 到 HTTP 的 19 次请求回归,覆盖直接调用、预备调用、DSH LLM 调用、受限模型档位、历史 `medium`/`xhigh`/`off`、无 reasoning 及明确关闭 thinking;避免仅检查内部请求形状而遗漏过线行为。
|
|
40
|
-
- 候选版本推进至 `0.1.0-dev.20260907.3`:完整 DSH peer 闭包增加已复核的 `0.1.3-alpha.2`(`82a5fd61…`),并继续拒绝混版依赖树;250 个一致包的隔离 Runtime 通过完整检查和 32 项测试,无需修改 OIDC 运行源码。
|
|
41
|
-
- 新增仓库接手入口说明,明确最新用户/主线消息、历史材料、兼容事实以及 GitHub、npm 和本地部署的边界。
|
|
42
|
-
- 候选版本推进至 `0.1.0-dev.20260907.2`:模型能力链路精确保留七种 reasoning effort ID、模型级默认值和独立过线值,未声明档位不再由 pi-ai 缺省补出,`xhigh` 不会被映射为 `max`。
|
|
43
|
-
- Provider 级历史默认值按模型有效档位保守回落;模型解析、调用准备和实际传输使用同一份能力快照,非法档位在任何 HTTP 请求前拒绝,同时保留 thinking-only 与无 reasoning 两种不同语义。
|
|
44
|
-
- 增加本地开发候选 `0.1.0-dev.20260907.1`:完整 DSH peer 闭包明确允许 `0.1.2-rc.1` 或 `0.1.3-alpha.1`,同时拒绝任何混版依赖树。
|
|
45
|
-
- 对上游 `dsh-v0.1.3-alpha.1`(`d347e703…`)完成源码契约核对和隔离 Runtime 验证;SessionHandle、session v2/锁和异步 `agentLoop.create()` 不在 OIDC 运行依赖面内,无需修改插件运行源码。
|
|
46
|
-
- 契约探针新增 OidcAccountService 构造及 13 个 Typert Remote 标记检查,并继续覆盖 Settings、LLM/Pi、WebServer、credentials、附件和客户端插槽。
|
|
9
|
+
- 适配 DSH 0.1.5-rc.1,企业身份、托管 Key 和模型接入独立于机构专属服务。
|
|
10
|
+
- 新增桌面 OIDC 临时 loopback 回调与宿主浏览器接入。
|
|
11
|
+
- 默认凭据引用统一为 `EDUWORK_API_KEY`,匹配的旧绑定可迁移,不覆盖已有目标槽位。
|
|
12
|
+
- 提供账户扩展运输接口与 UI 插槽,供独立机构插件使用。
|
|
13
|
+
- 认证后刷新登录、账户和模型选择状态,注销期间拒绝迟到状态写入。
|
|
14
|
+
- 请求准备保留所配置的思考能力和模型级默认值。
|
|
47
15
|
|
|
48
16
|
## [0.1.0] - 2026-09-06
|
|
49
17
|
|
|
50
18
|
### 变更
|
|
51
19
|
|
|
52
|
-
- 兼容基线精确更新至 DeepSeek Harness `0.1.2-rc.1`(`a66e4702
|
|
20
|
+
- 兼容基线精确更新至 DeepSeek Harness `0.1.2-rc.1`(`a66e4702…`),不再声明支持 alpha.2 组合。
|
|
53
21
|
- 扩充并锁定 DSH peer 闭包,显式包含声明 `settings.general.item` 的页面包,避免 npm 在未锁定宿主中混装 alpha.2 与 rc.1。
|
|
54
22
|
- 逐项核对 Credential Provider、Settings、LLM/Pi Provider、WebServer、API Remotes、Typert 和 Client 页面插槽;新增 `check:dsh` 自动契约检查。
|
|
55
23
|
- Provider 配置只输出已声明字段,并复制为 rc.1 Settings/PiAi schema 可解析的可变数据;同时将 reasoning/compat 值域收紧到 rc.1 支持集合。
|
package/CODE_OF_CONDUCT.en.md
CHANGED
|
@@ -14,4 +14,4 @@ Participants must:
|
|
|
14
14
|
|
|
15
15
|
Maintainers may edit, hide, reject, or remove contributions and may temporarily or permanently restrict participation when behavior threatens contributors or users. Enforcement should be proportionate, documented privately where appropriate, and avoid disclosing victims or security-sensitive details.
|
|
16
16
|
|
|
17
|
-
General conduct concerns may use an issue that contains no personal or sensitive details. For harassment, threats, doxxing, or another incident requiring confidentiality, use GitHub [Private Vulnerability Reporting](https://github.com/
|
|
17
|
+
General conduct concerns may use an issue that contains no personal or sensitive details. For harassment, threats, doxxing, or another incident requiring confidentiality, use GitHub [Private Vulnerability Reporting](https://github.com/ecnu/EduWork/security/advisories/new) and prefix the title with “Code of Conduct”. Do not disclose an affected person's identity or evidence attachments publicly.
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
当行为威胁贡献者或用户时,维护者可以编辑、隐藏、拒绝或删除贡献,也可以临时或永久限制参与。执行措施应当适度;适合时应私下记录,并避免暴露受害者或安全敏感细节。
|
|
16
16
|
|
|
17
|
-
一般行为问题可以创建不含个人敏感信息的 Issue。需要保密处理的骚扰、威胁、人肉搜索或其他行为事件,请使用 GitHub [Private Vulnerability Reporting](https://github.com/
|
|
17
|
+
一般行为问题可以创建不含个人敏感信息的 Issue。需要保密处理的骚扰、威胁、人肉搜索或其他行为事件,请使用 GitHub [Private Vulnerability Reporting](https://github.com/ecnu/EduWork/security/advisories/new),并在标题中标注“Code of Conduct”。不要在公开渠道披露受影响者身份或证据附件。
|
package/CONTRIBUTING.en.md
CHANGED
|
@@ -7,7 +7,7 @@ Thank you for improving `dsh-oidc`. Authentication and credential code has a hig
|
|
|
7
7
|
## Before starting
|
|
8
8
|
|
|
9
9
|
- Use a public issue for non-sensitive design/bug discussion.
|
|
10
|
-
- Use the [private security-reporting entry point](https://github.com/
|
|
10
|
+
- Use the [private security-reporting entry point](https://github.com/ecnu/EduWork/security/advisories/new) for vulnerabilities or secrets.
|
|
11
11
|
- For a protocol or trust-boundary change, open a design issue and add an ADR under `docs/decisions/` before implementation.
|
|
12
12
|
- Do not include production endpoints, identifiers, logs, tokens, personal data, logos, or screenshots without explicit publication approval.
|
|
13
13
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## 开始之前
|
|
8
8
|
|
|
9
9
|
- 非敏感设计或缺陷讨论请使用公开 Issue。
|
|
10
|
-
- 漏洞或秘密信息请使用[私有安全报告入口](https://github.com/
|
|
10
|
+
- 漏洞或秘密信息请使用[私有安全报告入口](https://github.com/ecnu/EduWork/security/advisories/new)。
|
|
11
11
|
- 修改协议或信任边界前,请先创建设计 Issue,并在 `docs/decisions/` 下新增 ADR。
|
|
12
12
|
- 未经明确公开授权,不得提交生产 endpoint、标识符、日志、Token、个人数据、Logo 或截图。
|
|
13
13
|
|
package/README.md
CHANGED
|
@@ -1,145 +1,36 @@
|
|
|
1
1
|
# dsh-oidc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**简体中文** | [English](README_EN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
一次机构登录,直接使用获授权的模型。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
当前源码提供 LiteLLM native OAuth 和显式启用的 oidc-llm 0.1 实验接入。两者共用浏览器/loopback、PKCE、Host 会话、刷新、退出与 DSH Provider;模型请求使用当前 Access Token,客户端不再申请或保存机构模型 API Key。个人 API Key 设置独立保留。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
本分支尚未发布 npm 或桌面版本;已发布版本的行为以对应版本文档为准。旧 OIDC + Key Binding 配置在本源码中会被明确拒绝,迁移见[旧方案迁移](docs/key-binding-protocol.md)。服务端可继续保留旧接口供旧客户端使用。
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
2. 固定的企业 **Key Binding** 协议,用 OIDC Access Token 申请、解析或轮换可撤销的模型运行凭据;
|
|
13
|
-
3. 本地 OpenAI-compatible Provider 与可自动同步的模型目录;
|
|
14
|
-
4. 安全的账户刷新和注销,可选机构账户扩展。
|
|
11
|
+
## 开始接入
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
1. 根据服务端选择 [LiteLLM 接入指南](docs/gateway-auth/litellm-setup.md) 或 [oidc-llm 实验接入](docs/gateway-auth/experimental-oidc-llm.md)。
|
|
14
|
+
2. 复制对应的[LiteLLM 示例](examples/litellm.enterprise-profile.example.json)或[OIDC Token 示例](examples/oidc-llm.enterprise-profile.example.json),填写完整发现地址与所需公开配置。
|
|
15
|
+
3. 在桌面 Host 使用 backend: desktop,本机 Web 使用 backend: web。仅身份登录仍可使用[纯身份示例](examples/identity-only.example.json);该模式不提供企业模型。
|
|
16
|
+
4. 登录后自动读取当前授权的模型目录。账户刷新不应覆盖用户后来选择的个人模型。
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
从源码验证:
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## 为什么叫 `dsh-oidc`
|
|
23
|
-
|
|
24
|
-
这个名字足够准确,也没有把 ECNU、Wails、某个模型网关或某种客户端形态绑进公共能力。仓库名仍为 `dsh-oidc`,npm 包使用 `@eduwork/dsh-oidc`;[旧 npm 包](https://www.npmjs.com/package/dsh-oidc)保留供迁移。
|
|
25
|
-
|
|
26
|
-
它的边界不是“登录结束”,而是“一套能闭环的企业模型接入标准”:
|
|
27
|
-
|
|
28
|
-
- OIDC 负责确认用户是谁;
|
|
29
|
-
- Key Binding 负责确认该用户能否获得哪个 Provider 的运行凭据;
|
|
30
|
-
- Enterprise Profile 负责声明品牌、OIDC 公共客户端、Key Binding 基址和模型事实;
|
|
31
|
-
- 本地 Provider 适配器把凭据和模型事实接入 DSH;
|
|
32
|
-
- 配额由独立机构扩展提供;桌面外壳、学校业务页、心跳与更新器由产品实现方扩展。
|
|
33
|
-
|
|
34
|
-
远程配置只能是数据,不能指定 JS 模块、脚本、CSS、工具、Skill 或自定义 Provider adapter,也不能修改 Key Binding 的路径和字段。这是开源后的核心安全边界。
|
|
35
|
-
|
|
36
|
-
## 能力与非目标
|
|
37
|
-
|
|
38
|
-
已包含:
|
|
39
|
-
|
|
40
|
-
- loopback 回调 `http://127.0.0.1:<实际端口>/oauth/callback`:Web 取 WebServer 端口,桌面默认临时随机端口;
|
|
41
|
-
- OIDC Discovery、PKCE S256、state、nonce、RS256 ID Token 校验、UserInfo subject 绑定、刷新和可选撤销;
|
|
42
|
-
- 只读取标准 `userinfo.name`,缺失时降级到必需字段 `userinfo.sub`;
|
|
43
|
-
- 固定 `worker-user-center-v1` 的 bootstrap / provision / resolve / renew;
|
|
44
|
-
- 使用 DSH Credential Provider 保存 OIDC 会话和模型 API Key;
|
|
45
|
-
- 声明式 Provider/模型目录和有边界的品牌 token;
|
|
46
|
-
- 两种桌面壳和本机 Web 共用官方模型设置、onboarding、侧栏账号与通用设置插槽,按宿主能力显示操作;
|
|
47
|
-
- 桌面原生账号后端适配边界;
|
|
48
|
-
- 稳定的 `enterpriseTransforms` 扩展服务,图像理解等插件可以增强某条模型路由,但不会再注册一套重复 Provider。
|
|
49
|
-
|
|
50
|
-
明确不包含:OIDC 服务端、Key Binding 服务端、多用户会话数据库、学校人员目录、Wails 外壳、客户端更新器和远程可执行插件。
|
|
51
|
-
|
|
52
|
-
## 品牌替换范围
|
|
53
|
-
|
|
54
|
-
`dsh-oidc` 当前已经包含品牌替换。部署方可以在 Enterprise Profile 的 `brand` 中声明:
|
|
55
|
-
|
|
56
|
-
- `productName`、`organizationName` 和 1–4 字符的 `mark`;
|
|
57
|
-
- HTTPS 或 base64 PNG/WebP `logoURL`;
|
|
58
|
-
- 六位十六进制 `primaryColor`;
|
|
59
|
-
- `loginTitle`、`loginDescription` 和 HTTPS `supportURL`。
|
|
60
|
-
|
|
61
|
-
这些字段会作用于页面标题、侧栏品牌、对话开场标记、登录/确认界面和一组受限 DSH 主题 token。它们不能注入任意 CSS、SVG、脚本或组件,也不会替换桌面外壳、更新器、配额界面和机构业务页面。完整字段、大小限制与安全规则见 [Enterprise Profile 规范](docs/enterprise-profile.md#品牌替换)。
|
|
62
|
-
|
|
63
|
-
## 最小接入步骤
|
|
64
|
-
|
|
65
|
-
1. 按[服务端接口规范](docs/server-integration-contract.md)联合提供 OIDC、Key Binding 和模型网关。
|
|
66
|
-
2. 为无 Client Secret 的 Public Client 精确登记 `http://127.0.0.1:3080/oauth/callback`。
|
|
67
|
-
3. 从 [`examples/enterprise-profile.example.json`](examples/enterprise-profile.example.json) 复制一份可信本地配置。
|
|
68
|
-
4. 在统一的 DSH `0.1.5-rc.1` 宿主中安装精确 npm 版本。发布准备期间若 registry 尚未提供该版本,使用下方源码方式,不要改装旧版或忽略 peer 冲突:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
dsh plugin --profile web add @eduwork/dsh-oidc@0.2.0
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
需要审计、开发或测试尚未发布的改动时,也可以从本地 checkout 安装:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
git clone https://github.com/freedomkk-qfeng/dsh-oidc.git
|
|
78
|
-
cd dsh-oidc
|
|
20
|
+
~~~sh
|
|
21
|
+
cd packages/dsh-oidc
|
|
79
22
|
npm ci
|
|
80
23
|
npm run check
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
本地路径安装会把当前 checkout 以依赖链接到 DSH `web` Profile;安装后不要移动或删除源码目录。团队部署应固定经过复核的 npm 精确版本,不要混装其他 DSH 预发布线。
|
|
85
|
-
|
|
86
|
-
高级产品也可以在自己的 DSH bundle 中显式引入 `dsh-oidc`:
|
|
87
|
-
|
|
88
|
-
```yaml
|
|
89
|
-
- insert:
|
|
90
|
-
- id: enterprise-oidc
|
|
91
|
-
name: '@eduwork/dsh-oidc'
|
|
92
|
-
config:
|
|
93
|
-
profilePathEnv: EDUWORK_OIDC_PROFILE
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
5. 用环境变量传入配置文件路径,并让 DSH WebServer 监听 `127.0.0.1`:
|
|
97
|
-
|
|
98
|
-
```text
|
|
99
|
-
EDUWORK_OIDC_PROFILE=/etc/dsh/enterprise-profile.json
|
|
100
|
-
dsh --profile web --host 127.0.0.1 --port 3080
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
回调 host 与 path 不可配置。端口取 DSH WebServer 实际端口;如修改 `3080`,OIDC 注册值也必须同步修改。
|
|
104
|
-
|
|
105
|
-
## 最重要的部署约束
|
|
106
|
-
|
|
107
|
-
当前 Web backend 只支持“可信单用户机器上的一个本地 DSH 进程”,并强制 DSH WebServer 绑定 `127.0.0.1`。它不支持共享公网 Web,也不应通过反向代理暴露为多人站点。需要共享部署时,应由另一个具备每用户会话、凭据隔离、Cookie/CSRF 和存储安全的宿主实现新的 backend,而不是放宽本插件的 loopback 限制。详见 [`docs/security-model.md`](docs/security-model.md)。
|
|
108
|
-
|
|
109
|
-
## 协议原则
|
|
110
|
-
|
|
111
|
-
OIDC 部分坚持标准化,不增加机构私有的 UserInfo 映射语法:
|
|
112
|
-
|
|
113
|
-
- Discovery 的 `issuer` 必须与配置完全一致;
|
|
114
|
-
- OIDC endpoint 可以按标准位于不同 HTTPS origin;
|
|
115
|
-
- UserInfo 的 `sub` 必须等于 ID Token 的 `sub`;
|
|
116
|
-
- 展示名取 `name`,缺失时才取 `sub`;
|
|
117
|
-
- bootstrap 中即使返回姓名,也不得覆盖 OIDC 身份。
|
|
118
|
-
|
|
119
|
-
纯身份接入只需 OIDC,省略 `keyBinding` 与 `provider` 即可。需要自动获得企业 Key 和配置模型时,这两项必须同时配置,并提供 Key Binding 与模型网关。Key Binding 是本项目定义的企业协议:Profile 通过 `baseURL` 指定接口组,其余路径、请求字段和响应字段全部固定。Provider ID 决定运行路由;默认企业凭据统一使用 `EDUWORK_API_KEY`。旧自动名称兼容迁移,独立的自定义引用仍由 `keyBinding.credentialRef` 配置。凭据归属由已验证的身份、资源绑定和 Key 指纹校验,不改变服务端接口。完整接口见[服务端接口规范](docs/server-integration-contract.md)。
|
|
120
|
-
|
|
121
|
-
## 开发与复核
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
npm ci
|
|
125
|
-
npm run check
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
开发依赖与锁文件固定本轮 DSH `0.1.5-rc.1`,不依赖开发机已有客户端目录。完整检查包括锁文件、所选 DSH 基线的 Host/Client/API 契约核对、Host/Client 构建、单元测试、OIDC 安全边界测试、JSON Schema 示例校验、OpenAPI 结构检查、敏感信息扫描和 npm tarball 预检。
|
|
24
|
+
~~~
|
|
129
25
|
|
|
130
|
-
|
|
26
|
+
配置加载、Host 组合和服务端要求见[接入指南](docs/getting-started.md)。发行装配需使用经过审查、已发布并锁定的包;源码修改不会自动进入现有安装包。
|
|
131
27
|
|
|
132
|
-
|
|
28
|
+
## 功能与边界
|
|
133
29
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
- [
|
|
138
|
-
-
|
|
139
|
-
- [`docs/key-binding-protocol.md`](docs/key-binding-protocol.md):Key Binding 规范
|
|
140
|
-
- [`docs/security-model.md`](docs/security-model.md):威胁模型和部署要求
|
|
141
|
-
- [`docs/dsh-integration.md`](docs/dsh-integration.md):DSH 服务依赖和扩展点
|
|
142
|
-
- [`docs/ecnu-reference.md`](docs/ecnu-reference.md):华东师范大学参考组合(仅占位配置)
|
|
143
|
-
- [`docs/compatibility.md`](docs/compatibility.md):版本与发布策略
|
|
30
|
+
- OIDC 模式验证 ID Token 签名、issuer、audience、nonce 与 UserInfo subject。LiteLLM native 按其自身契约处理,不猜测 Token 类型或降级协议。
|
|
31
|
+
- 请求前检查 Token 有效期;临近到期自动刷新,并发刷新合并为一次。
|
|
32
|
+
- 退出清理本地授权并取消在途模型请求,尽力撤销 Refresh Token。已签发 Access Token 的服务端有效期由服务端管理。
|
|
33
|
+
- 模型目录、JSON/SSE、推理档位和附件处理复用 DSH Provider。机构配额由[可选扩展](docs/account-extensions.md)通过共享 Host 传输读取。
|
|
34
|
+
- 品牌配置只接受受限数据,不加载远程代码。插件面向单机客户端,Web 仅监听本机。
|
|
144
35
|
|
|
145
|
-
|
|
36
|
+
进一步阅读:[Profile 配置](docs/enterprise-profile.md)、[桌面 Host](docs/desktop-host.md)、[架构](docs/architecture.md)、[安全边界](docs/security-model.md)、[开发](docs/development.md)。
|
package/README_EN.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# dsh-oidc
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | **English**
|
|
4
|
+
|
|
5
|
+
Sign in with an organization and use its authorized models directly.
|
|
6
|
+
|
|
7
|
+
The current source supports LiteLLM native OAuth and explicitly enabled experimental oidc-llm 0.1. Both reuse browser/loopback transport, PKCE, Host sessions, refresh, logout and the DSH Provider. Model requests use the current Access Token; this client no longer provisions or stores organization model API keys. Personal API-key settings remain independent.
|
|
8
|
+
|
|
9
|
+
This branch has not been published to npm or a desktop release. Published versions retain their documented behavior. The current source rejects old OIDC + Key Binding profiles; see [migration](docs/key-binding-protocol.en.md). Servers may retain legacy endpoints for older clients.
|
|
10
|
+
|
|
11
|
+
## Getting started
|
|
12
|
+
|
|
13
|
+
1. Start with the [LiteLLM setup guide](docs/gateway-auth/litellm-setup.en.md) or [experimental oidc-llm](docs/gateway-auth/experimental-oidc-llm.en.md), depending on the server.
|
|
14
|
+
2. Copy the [LiteLLM example](examples/litellm.enterprise-profile.example.json) or [OIDC Token example](examples/oidc-llm.enterprise-profile.example.json), then supply the full discovery URL and required public settings.
|
|
15
|
+
3. Use backend: desktop for desktop Hosts or backend: web for local Web. [Identity-only OIDC](examples/identity-only.example.json) remains available without organization models.
|
|
16
|
+
4. Sign-in discovers the current authorization's model catalog. Passive account refresh must not replace a personal model selected later.
|
|
17
|
+
|
|
18
|
+
Validate from source:
|
|
19
|
+
|
|
20
|
+
~~~sh
|
|
21
|
+
cd packages/dsh-oidc
|
|
22
|
+
npm ci
|
|
23
|
+
npm run check
|
|
24
|
+
~~~
|
|
25
|
+
|
|
26
|
+
See [integration](docs/getting-started.en.md) for profile loading, Host composition and server requirements. Released applications use reviewed, published and locked packages; editing this source does not update existing installations.
|
|
27
|
+
|
|
28
|
+
## Behavior and boundaries
|
|
29
|
+
|
|
30
|
+
- OIDC validates ID Token signature, issuer, audience, nonce and UserInfo subject. LiteLLM native follows its own contract, without token-shape guessing or protocol fallback.
|
|
31
|
+
- Requests check token expiry and refresh near expiry. Concurrent refresh callers share one request.
|
|
32
|
+
- Logout removes local authorization, cancels in-flight model requests and attempts Refresh Token revocation. Server policy determines the lifetime of issued Access Tokens.
|
|
33
|
+
- Catalogs, JSON/SSE, reasoning and attachments reuse the DSH Provider. Optional [institution extensions](docs/account-extensions.en.md) read quota through shared Host transport.
|
|
34
|
+
- Branding accepts bounded data, never remote code. This is a single-user client; Web listens on loopback only.
|
|
35
|
+
|
|
36
|
+
Further reading: [Profiles](docs/enterprise-profile.en.md), [desktop Host](docs/desktop-host.en.md), [architecture](docs/architecture.en.md), [security](docs/security-model.en.md), [development](docs/development.en.md).
|
package/SECURITY.en.md
CHANGED
|
@@ -10,7 +10,7 @@ The supported release line is `0.1.x`; security fixes are applied to its latest
|
|
|
10
10
|
|
|
11
11
|
Do **not** open a public issue for a suspected vulnerability, leaked secret, private endpoint, identity mix-up, credential exposure, or authorization bypass.
|
|
12
12
|
|
|
13
|
-
Submit reports privately through GitHub [Private Vulnerability Reporting](https://github.com/
|
|
13
|
+
Submit reports privately through GitHub [Private Vulnerability Reporting](https://github.com/ecnu/EduWork/security/advisories/new). Do not disclose vulnerability details, real credentials, or personal data in a public issue, discussion, pull request, or log attachment. If the private reporting entry is unavailable, open only a detail-free public issue asking maintainers to check the security-reporting configuration.
|
|
14
14
|
|
|
15
15
|
Include, where safe:
|
|
16
16
|
|
package/SECURITY.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
怀疑存在漏洞、秘密泄露、私有 endpoint、身份混淆、凭据暴露或授权绕过时,**不要创建公开 Issue**。
|
|
12
12
|
|
|
13
|
-
请通过 GitHub 的 [Private Vulnerability Reporting](https://github.com/
|
|
13
|
+
请通过 GitHub 的 [Private Vulnerability Reporting](https://github.com/ecnu/EduWork/security/advisories/new) 私密提交报告。不要在公开 Issue、Discussion、Pull Request 或日志附件中披露漏洞细节、真实凭据或个人信息。如果该入口不可用,请只创建一条不含技术细节的公开 Issue,提醒维护者检查安全报告配置。
|
|
14
14
|
|
|
15
15
|
在安全允许的情况下,请提供:
|
|
16
16
|
|
package/SUPPORT.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](SUPPORT.md) | **English**
|
|
4
4
|
|
|
5
|
-
Use [GitHub Issues](https://github.com/
|
|
5
|
+
Use [GitHub Issues](https://github.com/ecnu/EduWork/issues) for public integration questions. Use the private process in [`SECURITY.en.md`](SECURITY.en.md) for vulnerabilities and secrets.
|
|
6
6
|
|
|
7
7
|
When reporting a normal bug, include:
|
|
8
8
|
|
package/SUPPORT.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**简体中文** | [English](SUPPORT.en.md)
|
|
4
4
|
|
|
5
|
-
普通集成问题请使用 [GitHub Issues](https://github.com/
|
|
5
|
+
普通集成问题请使用 [GitHub Issues](https://github.com/ecnu/EduWork/issues)。漏洞和秘密信息请使用[安全政策](SECURITY.md)规定的私有流程。
|
|
6
6
|
|
|
7
7
|
报告普通缺陷时,请提供:
|
|
8
8
|
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Upgrading organization authentication
|
|
2
2
|
|
|
3
3
|
[简体中文](EDUWORK-MIGRATION.md) | **English**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The current source replaces Key Binding model access with token gateway authorization. Old model profiles are rejected; migrate explicit configuration and sign in again. Workspaces, conversations and personal provider settings are unchanged. Old model keys are neither adopted nor bulk-deleted. Use desktop/web Host services instead of the removed native account bridge.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Back up an existing Profile's package.json and cordis.patch.yml, then update its dependency and dsh.profile.bundles entries. Update module name paths in custom patches too. Do not enable both package identities together; restart the Host after switching. These are separate npm packages, so updating the old package cannot migrate an installation automatically.
|
|
14
|
-
|
|
15
|
-
## Data compatibility
|
|
16
|
-
|
|
17
|
-
Keep `dsh-oidc/v1alpha1`, `oidcAccounts`, credential references, Provider identities and plugin row ids. Host and Client TYPERT package identities change together.
|
|
18
|
-
|
|
19
|
-
Storage directories and user configuration content do not change. Product-managed Profiles migrate their owned dependencies through the product upgrader; community plugins remain unchanged.
|
|
20
|
-
|
|
21
|
-
## Release scope
|
|
22
|
-
|
|
23
|
-
`0.1.0` stabilizes the package identity as `@eduwork/dsh-oidc` and targets DSH `0.1.2-rc.1` exactly. Build, tests, documentation, license, and tarball checks cover this change; they do not constitute real institutional sign-in, real email delivery, or production acceptance. Production adoption still requires the complete public-release deployment checks. Keep the old package and scoped alpha versions installable rather than unpublishing them.
|
|
24
|
-
|
|
25
|
-
## Current 0.2.x candidate: common enterprise credential
|
|
26
|
-
|
|
27
|
-
The default local reference is `EDUWORK_API_KEY`, independent of institution and Provider names. Explicit legacy automatic references derived from the same Profile ID or Provider ID (uppercase, non-alphanumerics replaced with `_`, plus `_API_KEY`) normalize to the new default. Unrelated custom references such as `MY_TEST_MODEL_KEY` remain unchanged. This is a local secret-store name, never a new server request field.
|
|
28
|
-
|
|
29
|
-
An existing Web/desktop session may migrate a legacy key only when issuer, client ID, management URL, runtime URL and Provider ID match and only the reference changes. The destination must be empty; another profile must not claim the source; a saved fingerprint, when present, must match. Migration never imports arbitrary environment keys, overwrites an occupied destination, or trusts a key from a different deployment. Config files are read compatibly rather than overwritten.
|
|
30
|
-
|
|
31
|
-
After a different organization binds the common slot, only the session owning its current fingerprint may call that Provider. Other sessions retain identity but need resource reconnection; their logout cannot delete the new owner's key. Manually configured personal model keys remain untouched. If endpoints change, identity may remain valid while model credentials must be rebound; changed issuer/client ID requires sign-in again. Do not manually copy keys to bypass these checks.
|
|
32
|
-
|
|
33
|
-
Both new desktop shells use the common desktop backend. Legacy `native` account bridges still own their credential storage and must return a matching reference; this plugin does not rewrite OS-vault entries. Plugin migration moves no workspaces, history directories or application data; shell-level data migration belongs to the product.
|
|
34
|
-
|
|
35
|
-
The frozen dev.7 package remains unchanged. `0.2.0` provides the same runtime implementation under a stable semantic version. Distribution assembly pins npm `@eduwork/dsh-oidc@0.2.0` and its integrity with coherent DSH `0.1.5-rc.1` dependencies. Publication status and [release checks](release-checklist.en.md) are recorded separately; no old npm version or public tag is rewritten.
|
|
7
|
+
See [migration steps](key-binding-protocol.en.md), [configuration](enterprise-profile.en.md) and [compatibility](compatibility.en.md).
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 机构认证升级
|
|
2
2
|
|
|
3
3
|
**简体中文** | [English](EDUWORK-MIGRATION.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
当前源码用 Token 网关授权替代 Key Binding 模型接入。旧模型配置会被拒绝,需显式迁移配置并重新登录。工作区、会话和个人 Provider 设置不变;旧模型 Key 不会被新路径接纳,也不会被批量删除。使用 desktop/web Host 服务,旧 native 账户桥已移除。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
已有 Profile 先备份 package.json 与 cordis.patch.yml,再更新依赖和 dsh.profile.bundles;手写 patch 的模块路径 name 也需切换。不要同时启用新旧两份插件,切换后重启 Host。旧版本和新作用域版本是不同 npm 包,旧包的更新不会自动迁移安装。
|
|
14
|
-
|
|
15
|
-
## 数据兼容
|
|
16
|
-
|
|
17
|
-
保留 `dsh-oidc/v1alpha1`、`oidcAccounts`、凭据引用、Provider 标识和插件行 id;Host 与 Client 的 TYPERT 包归属一起更新。
|
|
18
|
-
|
|
19
|
-
本次迁移不修改存储目录或用户配置内容。产品管理的 Profile 由产品升级逻辑迁移其受管依赖;社区插件保持原状。
|
|
20
|
-
|
|
21
|
-
## 发布范围
|
|
22
|
-
|
|
23
|
-
`0.1.0` 将包身份稳定在 `@eduwork/dsh-oidc`,并精确适配 DSH `0.1.2-rc.1`。构建、测试、文档、开源和 tarball 检查针对本次变更执行;这不等于真实学校登录、真实邮件发送或生产部署验收。生产采用仍须完成公开发布检查表中的完整部署验收。旧包和 scoped alpha 保持可安装,不撤回旧版本。
|
|
24
|
-
|
|
25
|
-
## 当前 0.2.x 候选:统一企业凭据
|
|
26
|
-
|
|
27
|
-
默认本地引用为 `EDUWORK_API_KEY`,与学校和 Provider 名称无关。同一 Profile ID 或 Provider ID 派生的旧自动引用(转大写,非字母数字换为 `_`,后接 `_API_KEY`)也会规范化为新默认值。其他显式自定义引用如 `MY_TEST_MODEL_KEY` 保持不变。这只是本地秘密存储名称,不是新的服务端请求字段。
|
|
28
|
-
|
|
29
|
-
旧 Web/desktop 会话只有在 issuer、client ID、管理 URL、运行 URL、Provider ID 全部一致,仅引用改名时才迁移旧 Key。目标槽必须为空,源引用不能被其他 Profile 声明;已有指纹时必须匹配。不会从任意环境变量导入 Key,不覆盖非空目标,也不接纳其他部署的 Key。已有配置文件按兼容规则读取,不会被覆盖改写。
|
|
30
|
-
|
|
31
|
-
另一机构完成绑定并写入公共槽后,只有拥有当前指纹的会话才能调用该 Provider。其他会话保留身份但需重新连接资源;它们注销时不能删除新所有者的 Key。用户单独配置的个人模型 Key 不受影响。资源端点改变可保留身份,但必须重新绑定模型凭据;issuer/client ID 改变需重新登录。不要手动复制 Key 绕过归属校验。
|
|
32
|
-
|
|
33
|
-
两种新桌面壳共用 desktop backend。旧 `native` 账号桥仍由宿主管理凭据存储并返回匹配引用;本插件不改写操作系统凭据库。插件迁移不搬动工作区、历史目录或应用数据;更换桌面壳的数据迁移由产品处理。
|
|
34
|
-
|
|
35
|
-
已冻结 dev.7 包保持原样。`0.2.0` 将同一运行实现按稳定语义版本提供,正式装配固定 npm `@eduwork/dsh-oidc@0.2.0` 和 integrity,并统一宿主 DSH `0.1.5-rc.1` 依赖;发布状态和[发布检查](release-checklist.md)分别记录,不重写旧 npm 版本或公开 tag。
|
|
7
|
+
见[迁移步骤](key-binding-protocol.md)、[配置](enterprise-profile.md)与[兼容性说明](compatibility.md)。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](account-extensions.md) | **English**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Public OIDC owns identity, token authorization, model/default selection and sign-out. Quota HTTP, normalization and presentation remain optional institution extensions. resources(profileID) returns only model metadata. The current client does not provision or migrate model API keys; deploy matching client and Host descriptors.
|
|
6
6
|
|
|
7
7
|
## Host transport
|
|
8
8
|
|
|
@@ -12,22 +12,22 @@ An institution plugin depends on `oidcAccounts` and MUST first check its explici
|
|
|
12
12
|
const response = await ctx.oidcAccounts.modelResourceFetch(profileID, '/quota', { signal })
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
This Host-only method has no Remote decorator and never exposes credentials. It uses the
|
|
15
|
+
This Host-only method has no Remote decorator and never exposes credentials. It uses the validated gateway API base and current Access Token; an authenticated auth profile is required. Only GET is supported. Paths consist of slash-separated letters, digits, underscores or hyphens; absolute URLs, query/hash, escaped or dot paths and extra options are rejected. Redirects are denied, timeout is 20 seconds, and the buffered response limit is 1 MiB. HTTP failures return Response; the extension defines safe user-facing states. Do not display raw request/response secrets.
|
|
16
16
|
|
|
17
|
-
Logout or
|
|
17
|
+
Logout or reauthorization during response reading invalidates the result. The extension MUST also subscribe to `oidc/accounts-changed` and `credentials/reference-updated`, invalidate its generation, and check that generation after async operations. Abort requests on disposal. The public package does not cache extension data.
|
|
18
18
|
|
|
19
|
-
For identity-token services, use the separate `authorizedFetch(profileID, endpoint, init)` method with approved origins, token refresh and one 401 retry. See [the public protocol](public-resource-protocol.en.md). Neither transport schedules business requests itself.
|
|
19
|
+
For identity-token services, use the separate `authorizedFetch(profileID, endpoint, init)` method with approved origins, token refresh and at most one 401 retry for safe reads; generation is never replayed. See [the public protocol](public-resource-protocol.en.md). Neither transport schedules business requests itself.
|
|
20
20
|
|
|
21
21
|
## Client account menu
|
|
22
22
|
|
|
23
|
-
The public sidebar account declares the official `oidc.account.menu.details` child slot, `kind: single`, `scope: root`. Use `slots.inject()` before registering the occupant. Public UI continues to own identity, login, model
|
|
23
|
+
The public sidebar account declares the official `oidc.account.menu.details` child slot, `kind: single`, `scope: root`. Use `slots.inject()` before registering the occupant. Public UI continues to own identity, login, model connection and sign-out.
|
|
24
24
|
|
|
25
25
|
| Owner prop | Meaning |
|
|
26
26
|
| --- | --- |
|
|
27
27
|
| `profile`, `status` | Trusted configuration and non-secret current state; read-only |
|
|
28
28
|
| `busy` | Public account operation in progress; disable competing operations |
|
|
29
29
|
| `run(operation)` | Shared busy/error handling for an async user action |
|
|
30
|
-
| `refreshAccount()` | Reconcile identity/model connection without
|
|
30
|
+
| `refreshAccount()` | Reconcile identity/model connection without changing the selected model |
|
|
31
31
|
| `defaultContent` | Public Refresh account action; return it for inapplicable profiles |
|
|
32
32
|
|
|
33
33
|
```js
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**简体中文** | [English](account-extensions.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
公共 OIDC 负责身份、Token 授权、模型及默认选择和退出。配额请求、解析和展示由可选机构扩展提供;resources(profileID) 只返回模型元数据。当前客户端不再申请或迁移模型 API Key;Host 与 Client 描述符应配套部署。
|
|
6
6
|
|
|
7
7
|
## Host 授权传输
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const response = await ctx.oidcAccounts.modelResourceFetch(profileID, '/quota', { signal })
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
这是 Host 专属方法,**没有 Remote 标记**,不向客户端返回 Key
|
|
15
|
+
这是 Host 专属方法,**没有 Remote 标记**,不向客户端返回 Key。请求使用已校验的网关 API 基址和当前 Access Token,要求有效的 auth 模型授权。只允许 GET,路径必须是 `/segment` 形式(字母、数字、下划线、连字符,可多级),拒绝 URL、查询、片段、编码路径、点段和额外请求选项。请求不跟随重定向,超时 20 秒,缓冲响应最多 1 MiB。HTTP 错误仍返回 Response,由扩展定义友好状态。网络异常和身份变化可能抛出错误;扩展不得向 UI 回显原始请求或响应中的秘密。
|
|
16
16
|
|
|
17
17
|
读取响应期间注销或替换 Key 会拒绝结果。扩展还必须在自身层订阅 `oidc/accounts-changed` 和 `credentials/reference-updated`,失效正在请求的账户快照;每次异步操作结束后检查世代编号,不能将旧用户结果写入新用户状态。扩展卸载时中止请求。公版不缓存扩展资源。
|
|
18
18
|
|
|
@@ -37,6 +37,6 @@ ctx.slots.inject('oidc.account.menu.details', () =>
|
|
|
37
37
|
ctx.slots.register({ name: 'oidc.account.menu.details', priority: -100 }, Details))
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
扩展自定义 RPC 与字段 schema 归自己的包。组件必须根据明确配置的 profile ID、Provider 是否存在和 `status.credentialReady`
|
|
40
|
+
扩展自定义 RPC 与字段 schema 归自己的包。组件必须根据明确配置的 profile ID、Provider 是否存在和 `status.credentialReady` 决定是否读取;不匹配或未获得有效模型授权 时返回 `defaultContent`,不得请求配额。账户切换、退出及组件卸载后丢弃迟到结果。可聚焦操作使用 `role="menuitem"`,复用公共菜单的方向键、Escape 与失焦关闭规则。刷新不应夺走用户后来选择的个人模型。
|
|
41
41
|
|
|
42
42
|
ECNU 发行方的独立扩展可以提供模型额度、资源包、重置时间、详情和刷新。数量缺失代表未知;没有总量不能绘制百分比。该业务及其 `/quota` wire 不属于公共资源协议。
|