@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.
- package/CHANGELOG.en.md +6 -0
- package/CHANGELOG.md +6 -0
- package/README.md +20 -132
- package/README_EN.md +20 -177
- package/docs/EDUWORK-MIGRATION.en.md +3 -25
- package/docs/EDUWORK-MIGRATION.md +3 -25
- 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 -40
- package/docs/compatibility.md +6 -40
- 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 +4 -5
- package/docs/desktop-host.md +8 -9
- package/docs/development.en.md +2 -2
- package/docs/development.md +2 -2
- package/docs/dsh-integration.en.md +11 -46
- package/docs/dsh-integration.md +12 -47
- package/docs/ecnu-reference.en.md +4 -61
- package/docs/ecnu-reference.md +4 -61
- package/docs/enterprise-profile.en.md +11 -32
- package/docs/enterprise-profile.md +12 -33
- 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 +5 -67
- package/docs/open-integration.md +5 -67
- package/docs/public-resource-protocol.en.md +8 -44
- package/docs/public-resource-protocol.md +8 -43
- package/docs/security-model.en.md +10 -132
- package/docs/security-model.md +10 -132
- package/docs/server-integration-contract.en.md +12 -813
- package/docs/server-integration-contract.md +12 -825
- package/examples/ecnu.enterprise-profile.example.json +16 -20
- package/examples/enterprise-profile.example.json +16 -20
- package/examples/identity-only.example.json +7 -2
- package/examples/litellm.enterprise-profile.example.json +10 -0
- package/examples/oidc-llm.enterprise-profile.example.json +13 -0
- package/examples/resources-discovery.example.json +7 -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 +87 -0
- package/lib/oidc.js +40 -338
- package/lib/profile.js +42 -74
- package/lib/provider/authorization-scope.js +46 -0
- package/lib/provider/core.js +5 -16
- package/lib/provider/index.js +11 -2
- package/lib/transport.js +5 -0
- package/lib/typert-schemas.js +1 -1
- package/package.json +2 -2
- package/protocol/openapi.yaml +33 -240
- package/protocol/resources.openapi.yaml +8 -9
- package/schema/enterprise-profile.v1alpha1.schema.json +508 -107
|
@@ -12,7 +12,7 @@ The plugin uses public package exports rather than copied DSH source:
|
|
|
12
12
|
| --- | --- |
|
|
13
13
|
| `dsh-typert-protocol` | Host/client RPC descriptors. |
|
|
14
14
|
| `dsh-host-webserver` | Exact `/oauth/callback` route. |
|
|
15
|
-
| `dsh-credentials` |
|
|
15
|
+
| `dsh-credentials` | Authorization session storage. |
|
|
16
16
|
| `dsh-llm` | Adapter registry, credentials, retry policy, stable errors. |
|
|
17
17
|
| `dsh-llm-pi-ai` | Official `PiAiAdapter`. |
|
|
18
18
|
| `dsh-settings` | Provider directory/readiness facts. |
|
|
@@ -23,7 +23,7 @@ The OpenAI-compatible wire implementation comes from `@earendil-works/pi-ai`, wh
|
|
|
23
23
|
|
|
24
24
|
## Why the Provider adapter is inside this package
|
|
25
25
|
|
|
26
|
-
OIDC authentication alone does not yield a callable enterprise model. A closed-loop integration also needs a stable Provider route whose credential reference matches
|
|
26
|
+
OIDC authentication alone does not yield a callable enterprise model. A closed-loop integration also needs a stable Provider route whose credential reference matches current token authorization. Publishing a second organization-specific Provider package would recreate the coupling this repository is meant to remove.
|
|
27
27
|
|
|
28
28
|
The adapter is therefore an internal module of `dsh-oidc`, but its behavior is constrained:
|
|
29
29
|
|
|
@@ -49,12 +49,12 @@ The default export is `OidcAccountService`, a `TypertRemoteService` named `oidcA
|
|
|
49
49
|
| `loginStatus(loginID)` / `cancelLogin(loginID)` | Poll or cancel the current desktop attempt. |
|
|
50
50
|
| `resources(profileID)` | Model metadata and issues, without quota or secrets. |
|
|
51
51
|
| `selectEnterpriseModel(profileID, options)` | Select a verified connected model through official defaults; no arbitrary Provider destination. |
|
|
52
|
-
| `reconcile(profileID, {
|
|
52
|
+
| `reconcile(profileID, {})` | Refresh authorization and model resources. |
|
|
53
53
|
| `logout(profileID)` | Local cleanup and best-effort OIDC revocation. |
|
|
54
54
|
| `management()` | Capability-aware projection consumed by the shared enterprise-model settings UI. |
|
|
55
55
|
| `activate/configure/addCustom/updateCustom/removeProfile/configureModels/restart` | Optional native management operations; Web profiles reject mutation. |
|
|
56
56
|
|
|
57
|
-
The client descriptor uses strict Zod codecs. Configuration sent to the browser excludes issuer, client ID,
|
|
57
|
+
The client descriptor uses strict Zod codecs. Configuration sent to the browser excludes issuer, client ID, , model base URL, tokens, and keys.
|
|
58
58
|
|
|
59
59
|
## Web composition
|
|
60
60
|
|
|
@@ -80,7 +80,7 @@ dsh plugin --profile web add .
|
|
|
80
80
|
|
|
81
81
|
The local-path install links the checkout into the Profile, so the source directory must remain available. It does not scan the current workspace. Team deployments should pin a reviewed, exact npm version and must not mix another DSH prerelease line into the same Profile.
|
|
82
82
|
|
|
83
|
-
The shipped patch mounts exactly one `enterprise-oidc` instance using `EDUWORK_OIDC_PROFILE`. The Web backend requires the DSH WebServer to listen exactly on `127.0.0.1` and builds the fixed `/oauth/callback` from its actual port; no public callback-origin setting is accepted. The patch does not hard-code `agent-default-model`; after explicit login
|
|
83
|
+
The shipped patch mounts exactly one `enterprise-oidc` instance using `EDUWORK_OIDC_PROFILE`. The Web backend requires the DSH WebServer to listen exactly on `127.0.0.1` and builds the fixed `/oauth/callback` from its actual port; no public callback-origin setting is accepted. The patch does not hard-code `agent-default-model`; after explicit gateway login, the Client selects the connected organization model through official APIs. Restart recovery only repairs an unusable default and preserves personal selections. `DSH_OIDC_ENTERPRISE_PROFILE` remains a fallback.
|
|
84
84
|
|
|
85
85
|
### Product-owned Bundle
|
|
86
86
|
|
|
@@ -101,50 +101,15 @@ The shipped patch mounts exactly one `enterprise-oidc` instance using `EDUWORK_O
|
|
|
101
101
|
|
|
102
102
|
The containing DSH profile/bundle must also include the ordinary Web app, credentials, LLM/Pi adapter dependencies, settings, attachment services, and client surfaces. `dsh-oidc` is not a complete DSH distribution.
|
|
103
103
|
|
|
104
|
-
See the [getting-started guide](getting-started.en.md) for OIDC registration,
|
|
104
|
+
See the [getting-started guide](getting-started.en.md) for OIDC registration, Token gateway implementation, environment variables, acceptance, and troubleshooting.
|
|
105
105
|
|
|
106
106
|
## Desktop composition
|
|
107
107
|
|
|
108
|
-
New Wails/Electron products use `backend: desktop`: the plugin owns a temporary loopback callback and opens the browser through official `nativeCommand`. Both shells share identity,
|
|
108
|
+
New Wails/Electron products use `backend: desktop`: the plugin owns a temporary loopback callback and opens the browser through official `nativeCommand`. Both shells share identity, token lifecycle and model behavior. The host still provides credential storage; no new `enterpriseAccounts` bridge is required. See [desktop host integration](desktop-host.en.md).
|
|
109
109
|
|
|
110
110
|
## Legacy native bridge
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```yaml
|
|
115
|
-
- insert:
|
|
116
|
-
- id: enterprise-oidc
|
|
117
|
-
name: '@eduwork/dsh-oidc'
|
|
118
|
-
config:
|
|
119
|
-
backend: native
|
|
120
|
-
uiMode: models-only
|
|
121
|
-
profilePathEnv: PRODUCT_ENTERPRISE_PROFILE
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
The host supplies Cordis service `enterpriseAccounts`. Any product-owned institution catalog MUST first be converted by the host or assembly layer into a standard Enterprise Profile; `dsh-oidc` does not read or interpret product catalogs:
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
interface EnterpriseAccounts {
|
|
128
|
-
status(institutionID: string): Promise<NativeStatus>
|
|
129
|
-
login(institutionID: string, options: { allowProvision: false }): Promise<NativeStatus>
|
|
130
|
-
reconcile(institutionID: string, options: { allowProvision: boolean }): Promise<NativeStatus>
|
|
131
|
-
logout(institutionID: string): Promise<NativeStatus>
|
|
132
|
-
configuration(): Promise<NativeManagement>
|
|
133
|
-
activate(institutionID: string): Promise<NativeManagement>
|
|
134
|
-
configure(institutionID: string): Promise<NativeManagement>
|
|
135
|
-
addCustom(baseURL: string): Promise<NativeManagement>
|
|
136
|
-
updateCustom(institutionID: string, baseURL: string): Promise<NativeManagement>
|
|
137
|
-
removeInstitution(institutionID: string): Promise<NativeManagement>
|
|
138
|
-
configureCustomModels(institutionID: string, mode: 'discovery' | 'manual', models: RuntimeModel[]): Promise<NativeManagement>
|
|
139
|
-
restart(): Promise<{restarting: true}>
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
`NativeStatus` may include `displayName`, `organization`, `state`, `userName`, `affiliation`, `accessExpiresAt`, `runtimeCredentialRef`, `credentialReady`, `credentialState`, and `capabilities`. `runtimeCredentialRef` is only a host status assertion; when present, it MUST equal the normalized Enterprise Profile `keyBinding.credentialRef`. Credential naming belongs to the Profile, not to Wails, Electron, or any other host implementation.
|
|
144
|
-
|
|
145
|
-
Only the first four lifecycle operations are required for a native identity backend. Management operations are capability-detected: when absent, the same UI remains a read-only profile/model viewer. This is a host adapter, not part of OIDC or Key Binding wire standards. It can be implemented by Wails, Electron, Tauri, a mobile bridge, or another local host.
|
|
146
|
-
|
|
147
|
-
The public browser projection is versioned as `dsh-oidc/management/v1alpha1`. It deliberately excludes tokens and credentials. Web Enterprise Profiles set all mutation capabilities to false; a native adapter may set `manageProfiles`, `manageModels`, and `restart` according to the methods it actually provides.
|
|
112
|
+
backend: native has been removed. Use the shared desktop backend and Host credential/browser services.
|
|
148
113
|
|
|
149
114
|
## Model capability transforms
|
|
150
115
|
|
|
@@ -174,7 +139,7 @@ For every DSH release candidate or stable upgrade:
|
|
|
174
139
|
1. update exact peer versions in a branch;
|
|
175
140
|
2. diff the public exports and relevant types used above;
|
|
176
141
|
3. run unit and package tests;
|
|
177
|
-
4. launch a plain Web DSH profile and complete login,
|
|
142
|
+
4. launch a plain Web DSH profile and complete login, model call, refresh, logout;
|
|
178
143
|
5. launch the desktop/native composition and compare user-visible behavior;
|
|
179
144
|
6. verify client loader format and slot names;
|
|
180
145
|
7. review whether official DSH capability supersedes any local adapter code;
|
|
@@ -182,6 +147,6 @@ For every DSH release candidate or stable upgrade:
|
|
|
182
147
|
|
|
183
148
|
No semver range should silently opt this security-sensitive plugin into an untested DSH release while DSH remains pre-1.0.
|
|
184
149
|
|
|
185
|
-
##
|
|
150
|
+
## Authorized requests for institution adapters
|
|
186
151
|
|
|
187
|
-
|
|
152
|
+
Installed adapters use `ctx.oidcAccounts.modelResourceFetch(profileID, relativePath)` for requests authorized by the current Token. See [account extensions](account-extensions.en.md). The old `resolveBoundCredential` method has been removed. Host-only `modelAuthorization(profileID, expectedBaseURL)` checks readiness and the discovered API URL, returning only a boolean. The shared Host transport checks the active session, refreshes authorization, and restricts requests to the discovered model API.
|
package/docs/dsh-integration.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
| --- | --- |
|
|
13
13
|
| `dsh-typert-protocol` | Host/Client RPC 描述符。 |
|
|
14
14
|
| `dsh-host-webserver` | 精确 `/oauth/callback` 路由。 |
|
|
15
|
-
| `dsh-credentials` | Session
|
|
15
|
+
| `dsh-credentials` | 授权 Session 存储。 |
|
|
16
16
|
| `dsh-llm` | Adapter 注册、凭据、重试策略和稳定错误。 |
|
|
17
17
|
| `dsh-llm-pi-ai` | 官方 `PiAiAdapter`。 |
|
|
18
18
|
| `dsh-settings` | Provider 目录和就绪状态。 |
|
|
@@ -23,7 +23,7 @@ OpenAI-compatible 网络实现来自 `@earendil-works/pi-ai`,它也是 DSH 官
|
|
|
23
23
|
|
|
24
24
|
## 为什么 Provider adapter 位于本包内
|
|
25
25
|
|
|
26
|
-
只有 OIDC 认证还不能获得可调用的企业模型。闭环集成还需要稳定 Provider 路由,并确保其凭据引用与
|
|
26
|
+
只有 OIDC 认证还不能获得可调用的企业模型。闭环集成还需要稳定 Provider 路由,并确保其凭据引用与 当前 Token 授权一致。再发布一个机构特有 Provider 包,会重新制造本仓库要消除的耦合。
|
|
27
27
|
|
|
28
28
|
因此 adapter 是 `dsh-oidc` 内部模块,但其行为受到严格约束:
|
|
29
29
|
|
|
@@ -49,12 +49,12 @@ OpenAI-compatible 网络实现来自 `@earendil-works/pi-ai`,它也是 DSH 官
|
|
|
49
49
|
| `loginStatus(loginID)` / `cancelLogin(loginID)` | 查询或取消当前桌面登录。 |
|
|
50
50
|
| `resources(profileID)` | 模型元数据与问题,不含配额或秘密。 |
|
|
51
51
|
| `selectEnterpriseModel(profileID, options)` | 通过官方默认值选择已验证连接的模型,不接受任意 Provider 目的地。 |
|
|
52
|
-
| `reconcile(profileID, {
|
|
52
|
+
| `reconcile(profileID, {})` | 刷新授权和模型资源,不申请模型 Key。 |
|
|
53
53
|
| `logout(profileID)` | 本地清理,并尽力执行 OIDC 撤销。 |
|
|
54
54
|
| `management()` | 共用企业模型设置 UI 使用的宿主能力投影。 |
|
|
55
55
|
| `activate/configure/addCustom/updateCustom/removeProfile/configureModels/restart` | 可选 native 管理操作;Web Profile 拒绝修改。 |
|
|
56
56
|
|
|
57
|
-
Client 描述符使用严格 Zod codec。发送给浏览器的配置不包含 issuer、client ID
|
|
57
|
+
Client 描述符使用严格 Zod codec。发送给浏览器的配置不包含 issuer、client ID、、模型 base URL、Token 或 Key。
|
|
58
58
|
|
|
59
59
|
## Web 组合
|
|
60
60
|
|
|
@@ -101,50 +101,15 @@ dsh plugin --profile web add .
|
|
|
101
101
|
|
|
102
102
|
所属 DSH Profile/Bundle 还必须包含普通 Web 应用、credentials、LLM/Pi adapter 依赖、settings、attachment 服务和 Client 界面。`dsh-oidc` 不是完整 DSH 发行版。
|
|
103
103
|
|
|
104
|
-
OIDC 注册、
|
|
104
|
+
OIDC 注册、Token 网关实现、环境变量、验收和排障见[接入指南](getting-started.md)。
|
|
105
105
|
|
|
106
106
|
## Desktop 组合
|
|
107
107
|
|
|
108
|
-
新 Wails/Electron 产品使用 `backend: desktop`:插件管理临时 loopback 回调,通过官方 `nativeCommand` 打开浏览器。两壳共享身份、
|
|
108
|
+
新 Wails/Electron 产品使用 `backend: desktop`:插件管理临时 loopback 回调,通过官方 `nativeCommand` 打开浏览器。两壳共享身份、Token 生命周期和模型行为;宿主仍提供凭据存储,无需另写 `enterpriseAccounts`。见[桌面 Host 集成](desktop-host.md)。
|
|
109
109
|
|
|
110
|
-
## 旧 native
|
|
110
|
+
## 旧 native 桥
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```yaml
|
|
115
|
-
- insert:
|
|
116
|
-
- id: enterprise-oidc
|
|
117
|
-
name: '@eduwork/dsh-oidc'
|
|
118
|
-
config:
|
|
119
|
-
backend: native
|
|
120
|
-
uiMode: models-only
|
|
121
|
-
profilePathEnv: PRODUCT_ENTERPRISE_PROFILE
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
宿主提供 Cordis 服务 `enterpriseAccounts`。产品自有机构目录必须由宿主或装配层先转换为标准 Enterprise Profile;`dsh-oidc` 不读取或解释产品目录:
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
interface EnterpriseAccounts {
|
|
128
|
-
status(institutionID: string): Promise<NativeStatus>
|
|
129
|
-
login(institutionID: string, options: { allowProvision: false }): Promise<NativeStatus>
|
|
130
|
-
reconcile(institutionID: string, options: { allowProvision: boolean }): Promise<NativeStatus>
|
|
131
|
-
logout(institutionID: string): Promise<NativeStatus>
|
|
132
|
-
configuration(): Promise<NativeManagement>
|
|
133
|
-
activate(institutionID: string): Promise<NativeManagement>
|
|
134
|
-
configure(institutionID: string): Promise<NativeManagement>
|
|
135
|
-
addCustom(baseURL: string): Promise<NativeManagement>
|
|
136
|
-
updateCustom(institutionID: string, baseURL: string): Promise<NativeManagement>
|
|
137
|
-
removeInstitution(institutionID: string): Promise<NativeManagement>
|
|
138
|
-
configureCustomModels(institutionID: string, mode: 'discovery' | 'manual', models: RuntimeModel[]): Promise<NativeManagement>
|
|
139
|
-
restart(): Promise<{restarting: true}>
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
`NativeStatus` 可以包含 `displayName`、`organization`、`state`、`userName`、`affiliation`、`accessExpiresAt`、`runtimeCredentialRef`、`credentialReady`、`credentialState` 和 `capabilities`。`runtimeCredentialRef` 只是宿主状态回报;若提供,必须等于 Enterprise Profile 规范化后的 `keyBinding.credentialRef`。凭据命名策略属于 Profile,不属于 Wails、Electron 或其他宿主实现。
|
|
144
|
-
|
|
145
|
-
Native 身份后端只必须实现前四项生命周期操作。管理操作通过能力探测:缺少这些方法时,同一 UI 会保持为只读 Profile/模型查看器。这是宿主 adapter,不属于 OIDC 或 Key Binding 网络标准;Wails、Electron、Tauri、移动桥接或其他本地宿主均可实现。
|
|
146
|
-
|
|
147
|
-
浏览器公共投影版本为 `dsh-oidc/management/v1alpha1`,有意排除 Token 和凭据。Web Enterprise Profile 的所有修改能力为 false;native adapter 可以根据实际方法声明 `manageProfiles`、`manageModels` 和 `restart`。
|
|
112
|
+
backend: native 已移除。桌面使用共享 desktop 后端及宿主凭据、浏览器服务。
|
|
148
113
|
|
|
149
114
|
## 模型能力转换
|
|
150
115
|
|
|
@@ -167,9 +132,9 @@ const dispose = ctx.enterpriseTransforms.register({
|
|
|
167
132
|
|
|
168
133
|
转换是可执行本地插件,必须单独审查,绝不会从 Enterprise Profile 加载。
|
|
169
134
|
|
|
170
|
-
##
|
|
135
|
+
## 机构资源传输
|
|
171
136
|
|
|
172
|
-
|
|
137
|
+
扩展通过 modelResourceFetch(profileID, relativePath) 使用当前 Token 授权,见[账户扩展](account-extensions.md)。旧 resolveBoundCredential 已移除;可用性检查使用 Host-only modelAuthorization(profileID, expectedBaseURL),只返回布尔值。
|
|
173
138
|
|
|
174
139
|
## DSH 升级流程
|
|
175
140
|
|
|
@@ -178,8 +143,8 @@ const dispose = ctx.enterpriseTransforms.register({
|
|
|
178
143
|
1. 在分支中更新精确 peer version;
|
|
179
144
|
2. 对比上述公开 export 和相关类型;
|
|
180
145
|
3. 运行单元测试和打包测试;
|
|
181
|
-
4. 启动纯 Web DSH Profile
|
|
182
|
-
5. 启动 Desktop
|
|
146
|
+
4. 启动纯 Web DSH Profile,完成登录、模型调用、刷新和退出;
|
|
147
|
+
5. 启动 Desktop 组合并比较用户可见行为;
|
|
183
148
|
6. 验证 Client loader 格式和 slot 名称;
|
|
184
149
|
7. 审查 DSH 官方能力是否已替代任何本地 adapter 代码;
|
|
185
150
|
8. 发布前在 `docs/compatibility.md` 记录结果。
|
|
@@ -1,66 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Institution integration reference
|
|
2
2
|
|
|
3
3
|
[简体中文](ecnu-reference.md) | **English**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The public package contains no real institution endpoints, client registrations, accounts or quota data. Start from the [OIDC Token example](../examples/oidc-llm.enterprise-profile.example.json) or [LiteLLM example](../examples/litellm.enterprise-profile.example.json).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Own-account quota follows existing institutional server rules. Optional extensions use shared Host modelResourceFetch with the current Access Token and their existing parser. The public package defines no quota object or RPC.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
EduWork@ECNU composes the public core with institution extensions:
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
DeepSeek Harness
|
|
15
|
-
+ dsh-oidc
|
|
16
|
-
- standard OIDC identity
|
|
17
|
-
- worker-user-center-v1 Key Binding
|
|
18
|
-
- ECNU Enterprise Profile
|
|
19
|
-
- declarative ChatECNU Provider/models
|
|
20
|
-
- bounded brand/account UI and shared enterprise-model settings UI
|
|
21
|
-
+ ECNU product plugins
|
|
22
|
-
- image-understanding fallback for text-only ecnu-max
|
|
23
|
-
- enterprise search route and official DSH result rendering
|
|
24
|
-
- product presets/skills/resources
|
|
25
|
-
- legacy native account bridge only (new desktops use the public desktop backend)
|
|
26
|
-
- quota or institution-specific business UI
|
|
27
|
-
+ desktop shell/packaging/updater
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
New desktop compositions use the public `desktop` backend and host browser service for temporary loopback login; local functional validation uses `web`. The older Wails `native`/`enterpriseAccounts` bridge is a migration compatibility path, not a requirement for another institution. Trusted files manage organization configuration, while UI shows status and sign-in. Explicit institution plugins own quota, heartbeat and campus search; the public package does not request them. All modes follow the `EDUWORK_API_KEY` rules and complete deployment-binding checks without changing the existing OIDC/Key Binding wire.
|
|
31
|
-
|
|
32
|
-
## Identity expectation
|
|
33
|
-
|
|
34
|
-
The OIDC Provider should return standard UserInfo:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"sub": "opaque-stable-subject",
|
|
39
|
-
"name": "Display Name"
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
If `name` is absent, UI falls back to `sub`. The plugin does not call an ECNU-private profile endpoint and does not map `data.attributes.XM` or similar paths. This is deliberate: the organization OIDC service should expose the standard claim.
|
|
44
|
-
|
|
45
|
-
## Model example
|
|
46
|
-
|
|
47
|
-
The placeholder shows two common facts:
|
|
48
|
-
|
|
49
|
-
- `ecnu-max`: text-only, large context, selectable reasoning efforts;
|
|
50
|
-
- `ecnu-plus`: native text/image input, thinking enabled but no selectable reasoning-effort parameter.
|
|
51
|
-
|
|
52
|
-
For `ecnu-plus`, `supportsReasoningEffort: false` removes the unsupported effort while preserving thinking behavior. For `ecnu-max`, a separate ECNU image-understanding plugin can register `enterpriseTransforms` to add an aggregate image capability without altering the profile or replacing the Provider route.
|
|
53
|
-
|
|
54
|
-
## Before any public release
|
|
55
|
-
|
|
56
|
-
ECNU maintainers must separately approve:
|
|
57
|
-
|
|
58
|
-
- the GitHub organization and repository visibility;
|
|
59
|
-
- copyright holder wording;
|
|
60
|
-
- use of university/ChatECNU names and brand values;
|
|
61
|
-
- public support and security contact addresses;
|
|
62
|
-
- publication of the npm package name;
|
|
63
|
-
- removal of every internal endpoint, identifier, log, archive, and credential;
|
|
64
|
-
- the production deployment's privacy/security review.
|
|
65
|
-
|
|
66
|
-
The existence of this reference document is not authorization to publish institutional infrastructure details or brand assets.
|
|
9
|
+
See [migration](key-binding-protocol.en.md) for old profiles. Real environment configurations and diagnostic records stay outside the public repository.
|
package/docs/ecnu-reference.md
CHANGED
|
@@ -1,66 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 机构接入参考
|
|
2
2
|
|
|
3
3
|
**简体中文** | [English](ecnu-reference.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
公共包不包含真实机构地址、客户端注册信息、账号或配额数据。部署方可使用[OIDC Token 示例](../examples/oidc-llm.enterprise-profile.example.json)或[LiteLLM 示例](../examples/litellm.enterprise-profile.example.json)。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
本人配额沿用机构服务端既有规则。可选机构扩展通过共享 Host 的 modelResourceFetch 发送当前 Access Token,并复用自己的解析器;公共包不定义配额对象或 RPC。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
EduWork@ECNU 使用公共核心加机构扩展的组合:
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
DeepSeek Harness
|
|
15
|
-
+ dsh-oidc
|
|
16
|
-
- 标准 OIDC 身份
|
|
17
|
-
- worker-user-center-v1 Key Binding
|
|
18
|
-
- ECNU Enterprise Profile
|
|
19
|
-
- 声明式 ChatECNU Provider/模型
|
|
20
|
-
- 有边界的品牌/账号 UI 和共用企业模型设置 UI
|
|
21
|
-
+ ECNU 产品插件
|
|
22
|
-
- 面向纯文本 ecnu-max 的图像理解回退
|
|
23
|
-
- 企业搜索通路和 DSH 官方结果渲染
|
|
24
|
-
- 产品预设、Skill 和资源
|
|
25
|
-
- 仅旧版需要的 native 账号桥(新桌面使用公共 desktop 后端)
|
|
26
|
-
- 配额或机构特有业务 UI
|
|
27
|
-
+ 桌面外壳、打包与更新器
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
新桌面组合使用公共 `desktop` 后端,通过宿主浏览器服务完成临时 loopback 登录;本机功能验证用 `web` 后端。旧 Wails 发行版的 `native`/`enterpriseAccounts` 桥属于迁移兼容路径,不是新机构接入要求。企业配置由可信文件管理,界面负责展示和登录。配额、心跳、校内搜索由明确安装的机构插件提供;公版不请求这些服务。所有模式共用 `EDUWORK_API_KEY` 规则和完整部署绑定校验,不改变现有 OIDC/Key Binding wire。
|
|
31
|
-
|
|
32
|
-
## 身份预期
|
|
33
|
-
|
|
34
|
-
OIDC Provider 应返回标准 UserInfo:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"sub": "opaque-stable-subject",
|
|
39
|
-
"name": "Display Name"
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
如果没有 `name`,UI 会降级显示 `sub`。插件不会调用 ECNU 私有人员信息接口,也不会映射 `data.attributes.XM` 等路径。这是有意设计:机构 OIDC 服务应提供标准 claim。
|
|
44
|
-
|
|
45
|
-
## 模型示例
|
|
46
|
-
|
|
47
|
-
占位示例展示了两类常见模型事实:
|
|
48
|
-
|
|
49
|
-
- `ecnu-max`:纯文本、大上下文、支持选择 reasoning effort;
|
|
50
|
-
- `ecnu-plus`:原生文本/图片输入,支持 thinking,但不支持选择 reasoning-effort 参数。
|
|
51
|
-
|
|
52
|
-
对 `ecnu-plus` 设置 `supportsReasoningEffort: false`,会移除不支持的 effort 参数但保留 thinking。对 `ecnu-max`,独立的 ECNU 图像理解插件可注册 `enterpriseTransforms`,在不修改 Profile、不替换 Provider 路由的情况下增加聚合图像能力。
|
|
53
|
-
|
|
54
|
-
## 任何公开发布之前
|
|
55
|
-
|
|
56
|
-
ECNU 维护者必须另行批准:
|
|
57
|
-
|
|
58
|
-
- GitHub 组织和仓库可见性;
|
|
59
|
-
- 版权主体表述;
|
|
60
|
-
- 校名、ChatECNU 名称和品牌值的使用;
|
|
61
|
-
- 公开支持和安全联系地址;
|
|
62
|
-
- npm 包名发布;
|
|
63
|
-
- 清除全部内部 endpoint、标识符、日志、归档和凭据;
|
|
64
|
-
- 生产部署的隐私与安全审查。
|
|
65
|
-
|
|
66
|
-
存在这份参考文档不代表已获准发布任何机构基础设施细节或品牌资产。
|
|
9
|
+
旧 Key Binding 配置迁移见[迁移说明](key-binding-protocol.md)。真实环境的联调日志和配置不进入公开仓库。
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Enterprise Profile specification (`dsh-oidc/v1alpha1`)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Current source accepts token gateway profiles or identity-only OIDC. Key Binding profiles are removed; see [migration](key-binding-protocol.en.md).
|
|
4
4
|
|
|
5
5
|
[简体中文](enterprise-profile.md) | **English**
|
|
6
6
|
|
|
7
7
|
## Status and conformance
|
|
8
8
|
|
|
9
|
-
This document specifies the
|
|
9
|
+
This document specifies the current unpublished source branch contract. See the migration link above for previously released configurations. The key words **MUST**, **MUST NOT**, **REQUIRED**, **SHOULD**, **SHOULD NOT**, and **MAY** are interpreted as described by RFC 2119 and RFC 8174.
|
|
10
10
|
|
|
11
11
|
The canonical machine-readable schema is [`schema/enterprise-profile.v1alpha1.schema.json`](../schema/enterprise-profile.v1alpha1.schema.json). Runtime validation is intentionally stricter in several security-sensitive URL cases. A conforming profile MUST pass both JSON Schema validation and `normalizeEnterpriseProfile()`.
|
|
12
12
|
|
|
@@ -20,7 +20,6 @@ Profiles are trusted deployment configuration, not user input. Nevertheless, the
|
|
|
20
20
|
- development HTTP needs an explicit loopback allowance or exact development-origin allowlist;
|
|
21
21
|
- URL credentials, fragments, and endpoint-base query strings are rejected;
|
|
22
22
|
- only the built-in `openai-compatible` adapter can be selected;
|
|
23
|
-
- Key Binding accepts only its protocol base and an optional local DSH credential reference; network paths and fields remain fixed;
|
|
24
23
|
- logo data URLs accept PNG/WebP only, not SVG.
|
|
25
24
|
|
|
26
25
|
A remote administration system MAY distribute profile JSON only if the host authenticates the source, verifies integrity, and stages changes through review. Downloaded JSON does not become safe merely because it contains no JavaScript.
|
|
@@ -33,12 +32,11 @@ A remote administration system MAY distribute profile JSON only if the host auth
|
|
|
33
32
|
| `id` | yes | Profile ID matching `^[a-z][a-z0-9-]{0,63}$`. |
|
|
34
33
|
| `displayName` | yes | Human-readable integration name. |
|
|
35
34
|
| `organization` | no | Organization label; defaults to `displayName`. |
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `insecureDevelopmentOrigin` | no | Exact non-TLS development origin. It is accepted only together with `allowInsecureDevelopment: true`, and every HTTP OIDC/key-binding/provider endpoint must use this exact origin. Never ship it in a production profile. |
|
|
35
|
+
| `allowInsecureDevelopment` | Optional boolean; `false` (default) accepts HTTPS only, `true` also accepts HTTP service URLs. |
|
|
36
|
+
| `insecureDevelopmentOrigin` | Deprecated; accepted in old files but ignored. Omit from new configurations. |
|
|
39
37
|
| `brand` | no | Bounded presentational values. |
|
|
40
|
-
| `oidc` |
|
|
41
|
-
| `
|
|
38
|
+
| `oidc` | identity-only | OIDC public-client facts; cannot include auth or provider. |
|
|
39
|
+
| `auth` | models | Full discovery URL; see the gateway guide for explicit protocol fields. |
|
|
42
40
|
| `provider` | resource mode | One local OpenAI-compatible Provider route and model list. |
|
|
43
41
|
|
|
44
42
|
## Branding
|
|
@@ -72,31 +70,12 @@ Profiles MUST NOT include logos or names without permission from the rights hold
|
|
|
72
70
|
- `clientId` identifies a public client. No client secret belongs in a profile or this plugin.
|
|
73
71
|
- `scopes` MUST contain `openid` and `profile`, contain no whitespace within an item, and contain no duplicates.
|
|
74
72
|
- `offline_access` SHOULD be requested when the Provider issues refresh tokens and policy allows it.
|
|
75
|
-
- Key Binding authorization scopes are deployment-specific but SHOULD use the names in the reference example.
|
|
76
73
|
|
|
77
74
|
The Web redirect URI is fixed to `http://127.0.0.1:<DSH-port>/oauth/callback`. The host and path are not configurable; the port follows the DSH WebServer's actual listening port.
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## Gateway auth
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
"baseURL": "https://ai.example.edu/api/worker/v1",
|
|
84
|
-
"credentialRef": "EDUWORK_API_KEY"
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
| Field | Required | Meaning |
|
|
89
|
-
| --- | --- | --- |
|
|
90
|
-
| `baseURL` | yes | Base URL of the `worker-user-center-v1` Key Binding interface group. |
|
|
91
|
-
| `credentialRef` | no | Local DSH Credential Provider name under which the bound model API key is stored. It must match `^[A-Za-z_][A-Za-z0-9_]*$` and is limited to 128 characters. |
|
|
92
|
-
|
|
93
|
-
The Provider ID sent on the wire is always `provider.id`. An omitted `credentialRef` now defaults to `EDUWORK_API_KEY`. Legacy automatic references derived from this Profile’s `id` or `provider.id` (uppercase, non-alphanumerics replaced with `_`, followed by `_API_KEY`) normalize to this common name. Other explicit references remain unchanged.
|
|
94
|
-
|
|
95
|
-
`credentialRef` names a local secret-store entry; it is not a key and is never sent over the network. Normal deployments use `EDUWORK_API_KEY`; explicit independent overrides such as `MY_TEST_MODEL_KEY` remain supported. With a shared reference, only a verified login whose bound credential fingerprint matches the current key may read it. Rebinding leaves other profiles disconnected from that key, and their logout cannot delete a key written by another login. Independently configured personal model credentials are unaffected.
|
|
96
|
-
|
|
97
|
-
An upgrade imports an old key only when issuer, client ID, management URL, runtime URL and Provider ID all match and only the automatic reference changed. It neither overwrites nor adopts an occupied target. Unproven ownership retains identity but requires reconnecting model resources. Pre-fingerprint sessions are accepted only with an identical complete binding and unambiguous reference ownership.
|
|
98
|
-
|
|
99
|
-
Endpoint paths, request/response fields, and Provider ID semantics are protocol facts and MUST NOT be customized by profiles. If a native host returns `runtimeCredentialRef`, it MUST equal the normalized profile value or the plugin fails closed.
|
|
78
|
+
Use [LiteLLM](gateway-auth/README_EN.md) or [experimental oidc-llm](gateway-auth/experimental-oidc-llm.en.md). auth.discoveryUrl is explicit; OIDC mode requires the experimental flag, clientId and identityMode. No model-key fallback is supported.
|
|
100
79
|
|
|
101
80
|
## Provider object
|
|
102
81
|
|
|
@@ -107,7 +86,7 @@ The Provider object is data interpreted by a local audited adapter.
|
|
|
107
86
|
| `id` | yes | DSH route ID, independent of the shared default credential reference. Must be unique across loaded profiles. |
|
|
108
87
|
| `displayName` | no | User-facing Provider name. |
|
|
109
88
|
| `adapter` | yes | Exact string `openai-compatible`. |
|
|
110
|
-
| `baseURL` |
|
|
89
|
+
| `baseURL` | not configurable | Derived only from validated gateway discovery. |
|
|
111
90
|
| `reasoning` | no | Default DSH/pi-ai reasoning level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`; default `high`. |
|
|
112
91
|
| `defaultContextWindow` | no | Positive safe integer, default 262144. |
|
|
113
92
|
| `defaultMaxTokens` | no | Positive safe integer, default 32768. |
|
|
@@ -117,8 +96,8 @@ The Provider object is data interpreted by a local audited adapter.
|
|
|
117
96
|
| `streamIdleTimeoutMs` | no | Positive idle timeout, default 300000. |
|
|
118
97
|
| `retryPolicy` | no | DSH provider-owned retry policy; default normal/2 retries. |
|
|
119
98
|
| `compat` | no | Bounded pi-ai OpenAI compatibility facts. |
|
|
120
|
-
| `modelSource` | no |
|
|
121
|
-
| `models` |
|
|
99
|
+
| `modelSource` | no | Only discovery, the default; fetches /models with the current Access Token. |
|
|
100
|
+
| `models` | no | Reviewed model capabilities; cannot expose models absent from the authorized catalog. |
|
|
122
101
|
|
|
123
102
|
`retryPolicy.mode` is `normal` or `always`. `always` can retry indefinitely until success, cancellation, or disposal and SHOULD NOT be enabled without an explicit product decision. The policy is validated again by DSH.
|
|
124
103
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Enterprise Profile 规范(`dsh-oidc/v1alpha1`)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 当前源码接受 Token 网关或纯身份 OIDC 配置。Key Binding 配置已移除,见[迁移说明](key-binding-protocol.md)。
|
|
4
4
|
|
|
5
5
|
**简体中文** | [English](enterprise-profile.en.md)
|
|
6
6
|
|
|
7
7
|
## 状态与符合性
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
本文规定当前未发布源码分支使用的数据契约,旧已发布版本的配置迁移见上文链接。关键词 **必须(MUST)**、**不得(MUST NOT)**、**必需(REQUIRED)**、**应该(SHOULD)**、**不应该(SHOULD NOT)** 和 **可以(MAY)** 按 RFC 2119 与 RFC 8174 解释。
|
|
10
10
|
|
|
11
11
|
权威机器可读 Schema 为 [`schema/enterprise-profile.v1alpha1.schema.json`](../schema/enterprise-profile.v1alpha1.schema.json)。运行时对若干安全敏感 URL 的校验有意比 JSON Schema 更严格。符合规范的 Profile 必须同时通过 JSON Schema 和 `normalizeEnterpriseProfile()` 校验。
|
|
12
12
|
|
|
@@ -17,10 +17,9 @@ Profile 是受信任的部署配置,不是用户输入。即便如此,解析
|
|
|
17
17
|
- 根对象和所有涉及可执行行为的嵌套对象都会拒绝未知字段;
|
|
18
18
|
- 序列化后的 Profile 总大小不超过 512 KiB;
|
|
19
19
|
- 生产 URL 必须使用 HTTPS;
|
|
20
|
-
-
|
|
20
|
+
- 开发环境使用 HTTP 必须显式允许 loopback,或绑定精确的开发 origin;
|
|
21
21
|
- 拒绝 URL 凭据、fragment 和 endpoint-base query string;
|
|
22
22
|
- 只能选择内置的 `openai-compatible` adapter;
|
|
23
|
-
- Key Binding 只接受协议基址和可选的本地 DSH 凭据引用,不能改写网络路径或字段;
|
|
24
23
|
- logo data URL 只接受 PNG/WebP,不接受 SVG。
|
|
25
24
|
|
|
26
25
|
远程管理系统只有在宿主能够认证来源、校验完整性并通过审查流程暂存变更时,才可以分发 Profile JSON。下载的 JSON 不会仅仅因为不包含 JavaScript 就自动变得安全。
|
|
@@ -33,12 +32,11 @@ Profile 是受信任的部署配置,不是用户输入。即便如此,解析
|
|
|
33
32
|
| `id` | 是 | 匹配 `^[a-z][a-z0-9-]{0,63}$` 的 Profile ID。 |
|
|
34
33
|
| `displayName` | 是 | 面向用户的集成名称。 |
|
|
35
34
|
| `organization` | 否 | 机构名称;默认使用 `displayName`。 |
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `insecureDevelopmentOrigin` | 否 | 精确的非 TLS 开发 origin。只有与 `allowInsecureDevelopment: true` 一起使用时才有效,且所有 HTTP OIDC/Key Binding/Provider endpoint 必须使用该 origin。不得放入生产 Profile。 |
|
|
35
|
+
| `allowInsecureDevelopment` | 可选布尔值,默认 `false` 仅接受 HTTPS;`true` 也接受 HTTP 服务地址。 |
|
|
36
|
+
| `insecureDevelopmentOrigin` | 已废弃,仅兼容旧文件;不再参与校验,新配置无需填写。 |
|
|
39
37
|
| `brand` | 否 | 有边界的展示配置。 |
|
|
40
|
-
| `oidc` |
|
|
41
|
-
| `
|
|
38
|
+
| `oidc` | 纯身份模式 | OIDC public client 信息,不得同时配置 auth 或 provider。 |
|
|
39
|
+
| `auth` | 模型模式 | 完整发现地址,协议字段见网关指南。 |
|
|
42
40
|
| `provider` | 资源模式 | 一个本地 OpenAI-compatible Provider 路由和模型列表。 |
|
|
43
41
|
|
|
44
42
|
## 品牌替换
|
|
@@ -72,31 +70,12 @@ Profile 是受信任的部署配置,不是用户输入。即便如此,解析
|
|
|
72
70
|
- `clientId` 标识 public client。Profile 和本插件都不应包含 client secret。
|
|
73
71
|
- `scopes` 必须包含 `openid` 和 `profile`;每项内部不得包含空白,且不得重复。
|
|
74
72
|
- 当 Provider 会签发 refresh token 且策略允许时,应该请求 `offline_access`。
|
|
75
|
-
- Key Binding 授权 scope 由部署决定,但建议使用参考示例中的名称。
|
|
76
73
|
|
|
77
74
|
Web 重定向地址固定为 `http://127.0.0.1:<DSH端口>/oauth/callback`。host 和 path 不可配置;端口取 DSH WebServer 的实际监听端口。
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## 网关 auth
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
"baseURL": "https://ai.example.edu/api/worker/v1",
|
|
84
|
-
"credentialRef": "EDUWORK_API_KEY"
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
| 字段 | 必需 | 含义 |
|
|
89
|
-
| --- | --- | --- |
|
|
90
|
-
| `baseURL` | 是 | `worker-user-center-v1` Key Binding 接口组的基址。 |
|
|
91
|
-
| `credentialRef` | 否 | 保存绑定后模型 API Key 的本地 DSH Credential Provider 名称。必须匹配 `^[A-Za-z_][A-Za-z0-9_]*$`,最长 128 字符。 |
|
|
92
|
-
|
|
93
|
-
请求中的 Provider ID 固定取 `provider.id`。`credentialRef` 省略时统一为 `EDUWORK_API_KEY`。旧配置中按本 Profile 的 `id` 或 `provider.id` 大写、非字母数字替换为 `_` 后追加 `_API_KEY` 的引用,按兼容别名规范化到同一默认值,不再按企业生成名称。其他显式引用原样保留。
|
|
94
|
-
|
|
95
|
-
`credentialRef` 只是本地秘密存储的引用名,不是 API Key,不发送给 OIDC、Key Binding 或模型服务。常规部署使用 `EDUWORK_API_KEY`;需要额外独立管理的显式引用仍可使用例如 `MY_TEST_MODEL_KEY`。默认槽位记录当前绑定的企业 Key;多个 Profile 共用时,仅凭据指纹与当前 Key 匹配的已验证登录可以读取它。重新绑定后,其他 Profile 不会借用该 Key,登出也不会删除其他登录写入的新 Key。个人模型使用的独立引用不受影响。
|
|
96
|
-
|
|
97
|
-
升级只在同一 issuer、client ID、资源管理基址、模型服务基址、Provider ID 且仅旧自动引用改名时迁移原 Key。新槽位已有值时既不覆盖也不自动接管;无法证明归属时保留身份并重新连接模型资源。旧会话缺少指纹时,仅完整绑定相同且引用归属无歧义才兼容。
|
|
98
|
-
|
|
99
|
-
Endpoint 路径、请求/响应字段和 Provider ID 语义属于协议事实,不得由 Profile 自定义。Native 宿主若返回 `runtimeCredentialRef`,其值必须与本字段规范化后的结果一致,否则插件失败关闭。
|
|
78
|
+
选择 [LiteLLM](gateway-auth/README.md) 或 [oidc-llm 实验](gateway-auth/experimental-oidc-llm.md)。auth.discoveryUrl 必须完整;实验 OIDC 另外填写显式开关、clientId 和 identityMode。不支持回退到模型 Key 流程。
|
|
100
79
|
|
|
101
80
|
## Provider 对象
|
|
102
81
|
|
|
@@ -107,7 +86,7 @@ Provider 对象是由本地、经过审查的 adapter 解释的数据。
|
|
|
107
86
|
| `id` | 是 | DSH 路由 ID;在所有已加载 Profile 中必须唯一。 |
|
|
108
87
|
| `displayName` | 否 | 面向用户的 Provider 名称。 |
|
|
109
88
|
| `adapter` | 是 | 精确字符串 `openai-compatible`。 |
|
|
110
|
-
| `baseURL` |
|
|
89
|
+
| `baseURL` | 不得配置 | 只能来自已校验的网关发现。 |
|
|
111
90
|
| `reasoning` | 否 | 默认 DSH/pi-ai reasoning level,取值为 `off`、`minimal`、`low`、`medium`、`high`、`xhigh`、`max`,默认为 `high`。 |
|
|
112
91
|
| `defaultContextWindow` | 否 | 正安全整数,默认 262144。 |
|
|
113
92
|
| `defaultMaxTokens` | 否 | 正安全整数,默认 32768。 |
|
|
@@ -117,8 +96,8 @@ Provider 对象是由本地、经过审查的 adapter 解释的数据。
|
|
|
117
96
|
| `streamIdleTimeoutMs` | 否 | 正数空闲超时,默认 300000。 |
|
|
118
97
|
| `retryPolicy` | 否 | 由 DSH Provider 管理的重试策略;默认 normal/重试 2 次。 |
|
|
119
98
|
| `compat` | 否 | 有边界的 pi-ai OpenAI 兼容事实。 |
|
|
120
|
-
| `modelSource` | 否 |
|
|
121
|
-
| `models` |
|
|
99
|
+
| `modelSource` | 否 | 仅支持 discovery,默认值;使用当前 Access Token 读取 /models。 |
|
|
100
|
+
| `models` | 否 | 已审查的模型能力元数据,不得扩大获授权目录。 |
|
|
122
101
|
|
|
123
102
|
`retryPolicy.mode` 可以是 `normal` 或 `always`。`always` 可能一直重试,直到成功、取消或销毁;没有明确产品决策时不应启用。该策略还会由 DSH 再次校验。
|
|
124
103
|
|