@eduwork/dsh-oidc 0.2.4 → 0.3.0-dev.2

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.
Files changed (72) hide show
  1. package/CHANGELOG.en.md +6 -0
  2. package/CHANGELOG.md +6 -0
  3. package/README.md +20 -132
  4. package/README_EN.md +20 -177
  5. package/docs/EDUWORK-MIGRATION.en.md +3 -25
  6. package/docs/EDUWORK-MIGRATION.md +3 -25
  7. package/docs/account-extensions.en.md +6 -6
  8. package/docs/account-extensions.md +3 -3
  9. package/docs/architecture.en.md +12 -117
  10. package/docs/architecture.md +12 -118
  11. package/docs/compatibility.en.md +6 -40
  12. package/docs/compatibility.md +6 -40
  13. package/docs/decisions/0001-one-plugin-composition-boundary.en.md +2 -2
  14. package/docs/decisions/0001-one-plugin-composition-boundary.md +2 -2
  15. package/docs/desktop-host.en.md +4 -5
  16. package/docs/desktop-host.md +8 -9
  17. package/docs/development.en.md +2 -2
  18. package/docs/development.md +2 -2
  19. package/docs/dsh-integration.en.md +11 -46
  20. package/docs/dsh-integration.md +12 -47
  21. package/docs/ecnu-reference.en.md +4 -61
  22. package/docs/ecnu-reference.md +4 -61
  23. package/docs/enterprise-profile.en.md +11 -32
  24. package/docs/enterprise-profile.md +12 -33
  25. package/docs/gateway-auth/README.md +168 -0
  26. package/docs/gateway-auth/README_EN.md +70 -0
  27. package/docs/gateway-auth/experimental-oidc-llm.en.md +53 -0
  28. package/docs/gateway-auth/experimental-oidc-llm.md +53 -0
  29. package/docs/gateway-auth/litellm-setup.en.md +114 -0
  30. package/docs/gateway-auth/litellm-setup.md +114 -0
  31. package/docs/gateway-auth/oidc-llm-draft.en.md +141 -0
  32. package/docs/gateway-auth/oidc-llm-draft.md +141 -0
  33. package/docs/getting-started.en.md +17 -122
  34. package/docs/getting-started.md +16 -225
  35. package/docs/key-binding-protocol.en.md +10 -220
  36. package/docs/key-binding-protocol.md +10 -220
  37. package/docs/oidc-interoperability.en.md +1 -1
  38. package/docs/oidc-interoperability.md +1 -1
  39. package/docs/open-integration.en.md +5 -67
  40. package/docs/open-integration.md +5 -67
  41. package/docs/public-resource-protocol.en.md +8 -44
  42. package/docs/public-resource-protocol.md +8 -43
  43. package/docs/security-model.en.md +10 -132
  44. package/docs/security-model.md +10 -132
  45. package/docs/server-integration-contract.en.md +12 -813
  46. package/docs/server-integration-contract.md +12 -825
  47. package/examples/ecnu.enterprise-profile.example.json +16 -20
  48. package/examples/enterprise-profile.example.json +16 -20
  49. package/examples/identity-only.example.json +7 -2
  50. package/examples/litellm.enterprise-profile.example.json +10 -0
  51. package/examples/oidc-llm.enterprise-profile.example.json +13 -0
  52. package/examples/resources-discovery.example.json +7 -9
  53. package/lib/callback-page.js +5 -5
  54. package/lib/client.js +31 -48
  55. package/lib/desktop-oidc.js +7 -11
  56. package/lib/gateway-backend.js +443 -0
  57. package/lib/gateway-protocol.js +6 -0
  58. package/lib/index.js +14 -15
  59. package/lib/litellm-protocol.js +117 -0
  60. package/lib/model-resource-transport.js +19 -0
  61. package/lib/oidc-llm-protocol.js +87 -0
  62. package/lib/oidc.js +40 -338
  63. package/lib/profile.js +42 -74
  64. package/lib/provider/authorization-scope.js +46 -0
  65. package/lib/provider/core.js +5 -16
  66. package/lib/provider/index.js +11 -2
  67. package/lib/transport.js +5 -0
  68. package/lib/typert-schemas.js +1 -1
  69. package/package.json +2 -2
  70. package/protocol/openapi.yaml +33 -240
  71. package/protocol/resources.openapi.yaml +8 -9
  72. package/schema/enterprise-profile.v1alpha1.schema.json +508 -107
package/CHANGELOG.en.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  All notable changes are documented here. The format follows Keep a Changelog principles and the project uses Semantic Versioning with pre-1.0 qualifications described in `docs/compatibility.en.md`.
6
6
 
7
+ ## [0.3.0-dev.2] - 2026-09-21
8
+
9
+ - Explicitly allow HTTP test services through the single `allowInsecureDevelopment` flag, disabled by default; HTTPS behavior is unchanged.
10
+ - Accept the legacy `insecureDevelopmentOrigin` field without requiring a duplicate origin setting.
11
+ - Align transport policy across OIDC, OIDC-LLM, LiteLLM and model requests, with documented examples and regression tests.
12
+
7
13
  ## [0.2.0] - 2026-09-11
8
14
 
9
15
  - Target DSH 0.1.5-rc.1 and keep enterprise identity, managed keys and model integration independent of institution services.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  所有重要变更均记录于此。格式遵循 Keep a Changelog 原则;项目使用语义化版本,并遵循[兼容性与发布策略](docs/compatibility.md)中对 1.0 之前版本的说明。
6
6
 
7
+ ## [0.3.0-dev.2] - 2026-09-21
8
+
9
+ - 使用 `allowInsecureDevelopment` 单一开关显式允许 HTTP 测试服务,默认关闭;HTTPS 行为不变。
10
+ - 兼容读取旧 `insecureDevelopmentOrigin` 字段,但不再要求重复配置地址。
11
+ - 统一 OIDC、OIDC-LLM、LiteLLM 与模型请求的传输策略,并补齐配置示例和回归测试。
12
+
7
13
  ## [0.2.0] - 2026-09-11
8
14
 
9
15
  - 适配 DSH 0.1.5-rc.1,企业身份、托管 Key 和模型接入独立于机构专属服务。
package/README.md CHANGED
@@ -1,148 +1,36 @@
1
1
  # dsh-oidc
2
2
 
3
- **一次机构登录,连接用户获授权的模型服务。**
4
-
5
- > npm 包:`@eduwork/dsh-oidc@0.2.3` · DSH 开发基线:`0.1.5-rc.1`。
6
-
7
3
  **简体中文** | [English](README_EN.md)
8
4
 
9
- `dsh-oidc` 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 客户端提供机构登录、模型凭据和模型目录接入。启用托管模型模式后,用户在浏览器完成登录及必要确认,客户端即可获取并配置获授权的机构模型,个人 API Key 和其他模型也可以继续使用。
10
-
11
- 我们希望机构服务能被更多 AI 客户端复用。**[开放身份与模型接入倡议](docs/open-integration.md)** 介绍了这个目标、已有实现和社区参与方式;具体接入遵循下方协议,不要求采用 EduWork 的界面或桌面壳。
12
-
13
- 插件提供四项能力:
14
-
15
- 1. 标准 OIDC Authorization Code + PKCE 公共客户端登录;
16
- 2. 固定的企业 **Key Binding** 协议,用 OIDC Access Token 申请、解析或轮换可撤销的模型运行凭据;
17
- 3. 本地 OpenAI-compatible Provider 与可自动同步的模型目录;
18
- 4. 安全的账户刷新和注销,可选机构账户扩展。
19
-
20
- 这些能力配有共享账号界面和可选品牌配置。纯身份接入可省略资源协议,个人模型入口始终保留。
21
-
22
- 插件面向单机客户端。本机 Web 用于功能验证;桌面通过 `backend: desktop` 使用临时 loopback 回调和宿主浏览器服务,无需常驻 WebServer。`backend: native` 仅兼容旧宿主账户桥。三种后端都不依赖特定外壳,详见 [桌面宿主接入](docs/desktop-host.md)。
23
-
24
- 准备接入自己的机构?先读 **[服务端接口规范](docs/server-integration-contract.md)**,再按 **[完整中文接入指南](docs/getting-started.md)** 部署。前者以请求、响应、字段和错误码形式定义一个机构服务必须共同实现的 OIDC + PKCE、Key Binding 和模型网关能力;后者覆盖配置、安装、验收和排障。
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`。
5
+ 一次机构登录,直接使用获授权的模型。
60
6
 
61
- 这些字段会作用于页面标题、侧栏品牌、对话开场标记、登录/确认界面和一组受限 DSH 主题 token。它们不能注入任意 CSS、SVG、脚本或组件,也不会替换桌面外壳、更新器、配额界面和机构业务页面。完整字段、大小限制与安全规则见 [Enterprise Profile 规范](docs/enterprise-profile.md#品牌替换)。
7
+ 当前源码提供 LiteLLM native OAuth 和显式启用的 oidc-llm 0.1 实验接入。两者共用浏览器/loopback、PKCE、Host 会话、刷新、退出与 DSH Provider;模型请求使用当前 Access Token,客户端不再申请或保存机构模型 API Key。个人 API Key 设置独立保留。
62
8
 
63
- ## 最小接入步骤
9
+ 本分支尚未发布 npm 或桌面版本;已发布版本的行为以对应版本文档为准。旧 OIDC + Key Binding 配置在本源码中会被明确拒绝,迁移见[旧方案迁移](docs/key-binding-protocol.md)。服务端可继续保留旧接口供旧客户端使用。
64
10
 
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 版本:
11
+ ## 开始接入
69
12
 
70
- ```bash
71
- dsh plugin --profile web add @eduwork/dsh-oidc@0.2.3
72
- ```
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. 登录后自动读取当前授权的模型目录。账户刷新不应覆盖用户后来选择的个人模型。
73
17
 
74
- 需要审计、开发或测试尚未发布的改动时,也可以从本地 checkout 安装:
18
+ 从源码验证:
75
19
 
76
- ```bash
77
- git clone https://github.com/ecnu/EduWork.git
78
- cd EduWork/packages/dsh-oidc
20
+ ~~~sh
21
+ cd packages/dsh-oidc
79
22
  npm ci
80
23
  npm run check
81
- dsh plugin --profile web add .
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 预检。
129
-
130
- 插件与 EduWork 产品分别管理版本。装配使用精确 npm 版本及 integrity;源码路径用于开发。见[开发说明](docs/development.md)。
24
+ ~~~
131
25
 
132
- 详细材料:
26
+ 配置加载、Host 组合和服务端要求见[接入指南](docs/getting-started.md)。发行装配需使用经过审查、已发布并锁定的包;源码修改不会自动进入现有安装包。
133
27
 
134
- - [开放身份与模型接入倡议](docs/open-integration.md):目标、现有契约和社区参与方式
135
- - [`docs/architecture.md`](docs/architecture.md):组合架构与代码边界
136
- - [`docs/server-integration-contract.md`](docs/server-integration-contract.md):机构服务端必须共同实现的完整接口规范
137
- - [`docs/getting-started.md`](docs/getting-started.md):第三方从零接入、部署、验收与排障
138
- - [`docs/enterprise-profile.md`](docs/enterprise-profile.md):Enterprise Profile 字段和信任规则
139
- - [`docs/oidc-interoperability.md`](docs/oidc-interoperability.md):OIDC 兼容性要求
140
- - [`docs/key-binding-protocol.md`](docs/key-binding-protocol.md):Key Binding 规范
141
- - [`docs/security-model.md`](docs/security-model.md):威胁模型和部署要求
142
- - [`docs/dsh-integration.md`](docs/dsh-integration.md):DSH 服务依赖和扩展点
143
- - [`docs/ecnu-reference.md`](docs/ecnu-reference.md):华东师范大学参考组合(仅占位配置)
144
- - [`docs/compatibility.md`](docs/compatibility.md):版本与发布策略
28
+ ## 功能与边界
145
29
 
146
- 代码和原创文档使用 MIT 许可证。ECNU/ChatECNU 示例不包含真实地址、Client ID 或密钥,也不授予任何校名、商标和品牌资产使用权。
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 仅监听本机。
147
35
 
148
- 源码、Issue 与 PR 统一在 [EduWork](https://github.com/ecnu/EduWork/tree/main/packages/dsh-oidc)。开发命令在 `EduWork/packages/dsh-oidc` 中执行,npm 安装保持独立;发布流程见[包维护说明](https://github.com/ecnu/EduWork/blob/main/docs/PACKAGES.md)。
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 CHANGED
@@ -1,193 +1,36 @@
1
1
  # dsh-oidc
2
2
 
3
- **Sign in with an institution to access the models it authorizes for you.**
4
-
5
- > npm package: `@eduwork/dsh-oidc@0.2.3` · DSH development baseline: `0.1.5-rc.1`.
6
-
7
3
  [简体中文](README.md) | **English**
8
4
 
9
- `dsh-oidc` connects [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) clients to institutional sign-in, model credentials, and model catalogs. With managed-model mode enabled, the client obtains and configures authorized institutional models after browser sign-in and any required confirmation. Personal API keys and other models remain available.
10
-
11
- We want institutional services to work across more AI clients. The **[Open Identity and Model Integration Initiative](docs/open-integration.en.md)** explains the goal, existing implementation, and ways to participate. Integration follows the contracts below without requiring EduWork's UI or desktop shell.
12
-
13
- `dsh-oidc` composes four concerns behind one reviewed, declarative Enterprise Profile:
14
-
15
- 1. OpenID Connect Authorization Code flow with PKCE for a public client;
16
- 2. a fixed enterprise **Key Binding** protocol that exchanges the authenticated OIDC access token for a revocable model runtime credential;
17
- 3. a local OpenAI-compatible Provider with optional automatic model discovery; and
18
- 4. safe account refresh and sign-out, with optional institution account extensions.
19
-
20
- Shared account UI and optional bounded branding accompany these capabilities. Identity-only integration may omit resource APIs, and personal model providers remain available.
21
-
22
- The plugin targets a single-user local client. Web is for local validation; `backend: desktop` uses a temporary loopback callback and the host browser service without a persistent WebServer. `backend: native` remains for the legacy account bridge. No backend is tied to a particular shell; see [desktop host integration](docs/desktop-host.en.md).
23
-
24
- Integrating your own organization? Read the **[server API specification](docs/server-integration-contract.en.md)** first, then follow the **[getting-started guide](docs/getting-started.en.md)**. The first defines, with requests, responses, fields, and errors, the OIDC + PKCE, Key Binding, and model-gateway capabilities one institutional service must jointly deliver; the second covers configuration, installation, acceptance, and troubleshooting.
25
-
26
- ## Why this boundary
27
-
28
- An organization should be able to integrate DSH without forking DSH, shipping executable configuration, or binding its identity layer to one desktop shell. The organization supplies data and standards-compliant endpoints; the plugin owns the executable adapter and validates that data before use.
29
-
30
- ```mermaid
31
- flowchart LR
32
- subgraph Local[Trusted local machine]
33
- U[Browser] <-->|127.0.0.1 callback| D[DSH + dsh-oidc]
34
- C[DSH Credential Provider]
35
- P[Local OpenAI-compatible adapter]
36
- D --> C --> P
37
- end
38
- subgraph Service[One institutional integration service]
39
- O[OIDC Provider]
40
- K[Key Binding]
41
- M[Model gateway]
42
- end
43
- D <--> O
44
- D --> K
45
- K -->|runtime API key| C
46
- P --> M
47
- E[Enterprise Profile JSON] --> D
48
- X[Optional capability plugin] -->|enterpriseTransforms| P
49
- ```
50
-
51
- The Enterprise Profile is data only. It cannot name JavaScript modules, inject CSS, install tools or skills, or redefine Key Binding paths and wire fields.
52
-
53
- ## What is included
54
-
55
- - loopback callback `http://127.0.0.1:<actual-port>/oauth/callback`: the WebServer port for Web, a temporary random port by default for desktop;
56
- - OIDC Discovery, PKCE S256, state, nonce, RS256 ID Token validation, UserInfo subject binding, refresh, and optional revocation;
57
- - `userinfo.name` for display, falling back only to the required `userinfo.sub`;
58
- - fixed `worker-user-center-v1` endpoints for bootstrap, provision, resolve, and renew;
59
- - DSH Credential Provider storage for OIDC session material and the runtime API key;
60
- - declarative provider/model catalog and bounded brand tokens;
61
- - shared official model-settings, onboarding, sidebar-account and general-settings slots, with capability-aware operations across local Web and both desktop shells;
62
- - a native backend adapter boundary for desktop products;
63
- - a stable `enterpriseTransforms` service for capabilities such as a text-model image fallback without forking the Provider route.
64
-
65
- Not included: an OIDC Provider, a Key Binding server, multi-user session storage, an organization directory, a desktop shell, or remote executable plugins.
66
-
67
- ## Branding scope
68
-
69
- `dsh-oidc` already includes bounded product branding. An Enterprise Profile may declare:
70
-
71
- - `productName`, `organizationName`, and a one-to-four-character `mark`;
72
- - an HTTPS or base64 PNG/WebP `logoURL`;
73
- - a six-digit hexadecimal `primaryColor`;
74
- - `loginTitle`, `loginDescription`, and an HTTPS `supportURL`.
75
-
76
- These values affect the document title, sidebar brand, conversation hero mark, login/confirmation surfaces, and a bounded set of DSH theme tokens. They cannot inject arbitrary CSS, SVG, scripts, or components, and they do not replace a desktop shell, updater, or institution-specific business pages. See the [Enterprise Profile specification](docs/enterprise-profile.en.md#branding) for limits and security rules.
77
-
78
- ## Requirements
79
-
80
- - Node.js 22 or newer;
81
- - one coherent DeepSeek Harness `0.1.5-rc.1` peer set for this package;
82
- - an OIDC Public Client without a Client Secret: new desktops use `http://127.0.0.1:<actual-port>/oauth/callback`, while local Web validation registers its actual fixed port;
83
- - Discovery metadata with PKCE S256, RS256 ID Tokens, and `userinfo_endpoint`;
84
- - an OIDC service for identity-only mode; managed models additionally require the Key Binding and model gateway in the [server contract](docs/server-integration-contract.en.md);
85
- - a DSH Credential Provider appropriate for the deployment.
86
-
87
- The current Web backend is intentionally limited to a trusted, single-user DSH process bound to `127.0.0.1`. It is not a shared public-Web session solution. See [Security model](docs/security-model.en.md).
88
-
89
- ## Install
5
+ Sign in with an organization and use its authorized models directly.
90
6
 
91
- Install the exact npm version in a coherent DSH `0.1.5-rc.1` host.:
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.
92
8
 
93
- ```bash
94
- dsh plugin --profile web add @eduwork/dsh-oidc@0.2.3
95
- ```
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.
96
10
 
97
- For auditing, development, or testing unpublished changes, install from a local checkout instead:
11
+ ## Getting started
98
12
 
99
- ```bash
100
- git clone https://github.com/ecnu/EduWork.git
101
- cd EduWork/packages/dsh-oidc
102
- npm ci
103
- npm run check
104
- dsh plugin --profile web add .
105
- ```
106
-
107
- The local-path form links the checkout into the DSH `web` Profile, so keep the source directory in place. Team deployments should pin a reviewed, exact npm version and must not mix another DSH prerelease line into the same profile.
108
-
109
- Advanced products may instead add it explicitly to their own DSH bundle patch:
110
-
111
- ```yaml
112
- - insert:
113
- - id: enterprise-oidc
114
- name: '@eduwork/dsh-oidc'
115
- config:
116
- profilePathEnv: EDUWORK_OIDC_PROFILE
117
- ```
118
-
119
- Set `EDUWORK_OIDC_PROFILE` to a trusted local JSON file. Start from [`examples/enterprise-profile.example.json`](examples/enterprise-profile.example.json) and validate it with [`schema/enterprise-profile.v1alpha1.schema.json`](schema/enterprise-profile.v1alpha1.schema.json).
120
-
121
- Start DSH on the fixed IPv4 loopback host. The public OIDC client must register exactly:
122
-
123
- ```text
124
- http://127.0.0.1:3080/oauth/callback
125
- ```
126
-
127
- This installation example uses local Web validation. Its port follows the actual DSH WebServer port; if the operator changes `3080`, registration must match. New desktops use a temporary listener and normally request an available port; see [desktop integration](docs/desktop-host.en.md). The loopback host and callback path stay fixed.
128
-
129
- ## Configuration surfaces
130
-
131
- | Plugin config | Purpose |
132
- | --- | --- |
133
- | `profile` | One inline Enterprise Profile object. |
134
- | `profiles` | An array of inline Enterprise Profiles. Provider IDs must also be unique. |
135
- | `profilePathEnv` | Name of an environment variable containing the trusted JSON profile path. |
136
- | `backend` | `web` (default) for local validation, `desktop` for the shared temporary loopback/native-browser implementation, or legacy `native` for a host-provided `enterpriseAccounts` service. |
137
- | `uiMode` | `standard` (shared model settings plus account/onboarding/branding), `models-only` (shared model settings only), or `external` (no plugin UI). |
138
- | `web.returnPath` | Same-origin absolute path after callback; defaults to `/`. |
139
- | `allowEmptyProfiles` | Allows the plugin service to start with no profile, mainly for composition tests. |
140
-
141
- See [Enterprise Profile](docs/enterprise-profile.en.md) for every data field and trust rule.
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.
142
17
 
143
- ## Protocol summary
18
+ Validate from source:
144
19
 
145
- OIDC remains standard OIDC. The plugin does not support custom “userinfo field mapping”: `name` is the standard display claim and `sub` is the guaranteed stable fallback. Identity-only mode requires OIDC and omits both `keyBinding` and `provider`. Managed enterprise keys/models require both fields and the Key Binding/model-gateway services. See the [complete server integration contract](docs/server-integration-contract.en.md).
146
-
147
- Given `keyBinding.baseURL = https://ai.example.edu/api/worker/v1`, the only valid operations are:
148
-
149
- - `GET /bootstrap`
150
- - `POST /runtime-credential/provision`
151
- - `POST /runtime-credential/resolve`
152
- - `POST /runtime-credential/renew`
153
-
154
- The profile cannot change these paths or their fields. [`protocol/openapi.yaml`](protocol/openapi.yaml) is the machine-readable contract; [Key Binding protocol](docs/key-binding-protocol.en.md) defines normative behavior, authorization, idempotency, logging, and lifecycle semantics.
155
-
156
- Provider ID determines the runtime route; the default enterprise credential reference is `EDUWORK_API_KEY`. Legacy automatic names are migrated compatibly, while independently managed references remain configurable through `keyBinding.credentialRef`. Verified identity, resource binding and a key fingerprint enforce ownership without changing the server API.
157
-
158
- ## Development
159
-
160
- ```bash
20
+ ~~~sh
21
+ cd packages/dsh-oidc
161
22
  npm ci
162
23
  npm run check
163
- ```
164
-
165
- Development dependencies and the lockfile pin DSH `0.1.5-rc.1`, without referring to a developer’s installed desktop. `npm run check` verifies the dependency lock and selected DSH Host, Client, Provider, WebServer, credentials, and Typert contracts; rebuilds both plugin faces; runs unit/security-contract tests; validates examples and OpenAPI structure; scans publishable sources for common secrets, personal paths, non-example addresses, and ECNU service endpoints; and inspects the npm tarball.
166
-
167
- The repository intentionally keeps Host code as native ESM under `src/host`; `scripts/build-host.mjs` copies it to `lib`. The DSH browser client is bundled as the loader-compatible `lib/client.js`.
168
-
169
- The plugin and EduWork product use independent versions. Distribution builds use exact npm versions and integrity; source paths are for development. See [development](docs/development.en.md).
170
-
171
- ## Documentation
172
-
173
- - [Open Identity and Model Integration Initiative](docs/open-integration.en.md)
174
- - [Architecture and boundaries](docs/architecture.en.md)
175
- - [Complete institutional server integration contract](docs/server-integration-contract.en.md)
176
- - [Third-party getting-started guide](docs/getting-started.en.md)
177
- - [Enterprise Profile specification](docs/enterprise-profile.en.md)
178
- - [OIDC interoperability profile](docs/oidc-interoperability.en.md)
179
- - [Key Binding protocol](docs/key-binding-protocol.en.md)
180
- - [Security model and deployment requirements](docs/security-model.en.md)
181
- - [DSH integration and extension seams](docs/dsh-integration.en.md)
182
- - [ECNU reference composition](docs/ecnu-reference.en.md)
183
- - [Compatibility and release policy](docs/compatibility.en.md)
184
- - [Public release checklist](docs/release-checklist.en.md)
185
- - [Contribution guide](CONTRIBUTING.en.md), [security policy](SECURITY.en.md), and [governance](GOVERNANCE.en.md)
24
+ ~~~
186
25
 
187
- ## License and trademarks
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.
188
27
 
189
- Code and original documentation are licensed under MIT. Dependency notices are in [THIRD_PARTY_NOTICES.en.md](THIRD_PARTY_NOTICES.en.md).
28
+ ## Behavior and boundaries
190
29
 
191
- DeepSeek Harness and DeepSeek are names of their respective owners. “华东师范大学”, “ECNU”, “ChatECNU”, and associated marks remain the property of their respective rights holders. The ECNU file in `examples/` is a placeholder reference configuration, contains no production endpoint or client identifier, and does not grant trademark rights.
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.
192
35
 
193
- Source, issues and PRs are maintained in [EduWork](https://github.com/ecnu/EduWork/tree/main/packages/dsh-oidc). Run development commands from `EduWork/packages/dsh-oidc`. npm installation remains independent. See [package publication](https://github.com/ecnu/EduWork/blob/main/docs/PACKAGES_EN.md).
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).
@@ -1,29 +1,7 @@
1
- # Package and enterprise-credential migration
1
+ # Upgrading organization authentication
2
2
 
3
3
  [简体中文](EDUWORK-MIGRATION.md) | **English**
4
4
 
5
- Starting with `0.1.0-alpha.11`, the npm package identity changed to `@eduwork/dsh-oidc`, replacing `dsh-oidc`; `0.1.0` is the first stable semantic version after that migration. Source is maintained under `EduWork/packages/dsh-oidc`.
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
- ## Historical npm scope migration (0.1.0)
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
- ## Enterprise credentials in 0.2.x
22
-
23
- 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.
24
-
25
- 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.
26
-
27
- 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.
28
-
29
- 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.
7
+ See [migration steps](key-binding-protocol.en.md), [configuration](enterprise-profile.en.md) and [compatibility](compatibility.en.md).
@@ -1,29 +1,7 @@
1
- # 包名与企业凭据迁移
1
+ # 机构认证升级
2
2
 
3
3
  **简体中文** | [English](EDUWORK-MIGRATION.en.md)
4
4
 
5
- 从 `0.1.0-alpha.11` 起,npm 包改用 `@eduwork/dsh-oidc`,替代旧的 `dsh-oidc`;`0.1.0` 是完成该迁移后的首个稳定语义版本。源码位于 EduWork 的 `packages/dsh-oidc`。
5
+ 当前源码用 Token 网关授权替代 Key Binding 模型接入。旧模型配置会被拒绝,需显式迁移配置并重新登录。工作区、会话和个人 Provider 设置不变;旧模型 Key 不会被新路径接纳,也不会被批量删除。使用 desktop/web Host 服务,旧 native 账户桥已移除。
6
6
 
7
- ## 历史 npm 作用域迁移(0.1.0)
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
- ## 0.2.x 企业凭据
22
-
23
- 默认本地引用为 `EDUWORK_API_KEY`,与学校和 Provider 名称无关。同一 Profile ID 或 Provider ID 派生的旧自动引用(转大写,非字母数字换为 `_`,后接 `_API_KEY`)也会规范化为新默认值。其他显式自定义引用如 `MY_TEST_MODEL_KEY` 保持不变。这只是本地秘密存储名称,不是新的服务端请求字段。
24
-
25
- 旧 Web/desktop 会话只有在 issuer、client ID、管理 URL、运行 URL、Provider ID 全部一致,仅引用改名时才迁移旧 Key。目标槽必须为空,源引用不能被其他 Profile 声明;已有指纹时必须匹配。不会从任意环境变量导入 Key,不覆盖非空目标,也不接纳其他部署的 Key。已有配置文件按兼容规则读取,不会被覆盖改写。
26
-
27
- 另一机构完成绑定并写入公共槽后,只有拥有当前指纹的会话才能调用该 Provider。其他会话保留身份但需重新连接资源;它们注销时不能删除新所有者的 Key。用户单独配置的个人模型 Key 不受影响。资源端点改变可保留身份,但必须重新绑定模型凭据;issuer/client ID 改变需重新登录。不要手动复制 Key 绕过归属校验。
28
-
29
- 两种新桌面壳共用 desktop backend。旧 `native` 账号桥仍由宿主管理凭据存储并返回匹配引用;本插件不改写操作系统凭据库。插件迁移不搬动工作区、历史目录或应用数据;更换桌面壳的数据迁移由产品处理。
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
- As of `0.2.0-dev.20260910.6`, public OIDC owns identity, managed model keys, models/default selection and sign-out. Quota HTTP, normalization and presentation are external, and public OIDC sends no heartbeat. `resources(profileID)` returns only `{profileID, modelSource, models, issues}`. Extracting quota alone does not require a new login. The dev.7 credential rename migrates only verified ownership and an identical deployment binding; unproven ownership retains identity but requires model-resource reconnection. Deploy matching client and Host type descriptors.
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 configured `profile.provider.baseURL`, active identity and current managed model key; `provider` and `keyBinding` are 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.
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 key replacement 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.
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 credential provisioning and sign-out.
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 automatic provisioning |
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
- 从 `0.2.0-dev.20260910.6` 起,公版负责 OIDC 身份、托管模型 Key、模型目录、默认模型与注销;不再包含配额请求、字段归一化或配额 UI,也不发送心跳。`resources(profileID)` 只返回 `{profileID, modelSource, models, issues}`。配额拆分本身不要求重新登录;dev.7 的凭据改名按完整绑定与归属校验迁移,无法证明归属时保留身份并重新连接模型。安装新客户端和公共包须使用一致的类型描述。
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。请求使用已配置的 `profile.provider.baseURL` 和当前托管模型 Key;需要已配置 `provider`、`keyBinding` 和有效登录。只允许 GET,路径必须是 `/segment` 形式(字母、数字、下划线、连字符,可多级),拒绝 URL、查询、片段、编码路径、点段和额外请求选项。请求不跟随重定向,超时 20 秒,缓冲响应最多 1 MiB。HTTP 错误仍返回 Response,由扩展定义友好状态。网络异常和身份变化可能抛出错误;扩展不得向 UI 回显原始请求或响应中的秘密。
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` 决定是否读取;不匹配或缺少 Key 时返回 `defaultContent`,不得请求配额。账户切换、退出及组件卸载后丢弃迟到结果。可聚焦操作使用 `role="menuitem"`,复用公共菜单的方向键、Escape 与失焦关闭规则。刷新不应夺走用户后来选择的个人模型。
40
+ 扩展自定义 RPC 与字段 schema 归自己的包。组件必须根据明确配置的 profile ID、Provider 是否存在和 `status.credentialReady` 决定是否读取;不匹配或未获得有效模型授权 时返回 `defaultContent`,不得请求配额。账户切换、退出及组件卸载后丢弃迟到结果。可聚焦操作使用 `role="menuitem"`,复用公共菜单的方向键、Escape 与失焦关闭规则。刷新不应夺走用户后来选择的个人模型。
41
41
 
42
42
  ECNU 发行方的独立扩展可以提供模型额度、资源包、重置时间、详情和刷新。数量缺失代表未知;没有总量不能绘制百分比。该业务及其 `/quota` wire 不属于公共资源协议。