@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/README.en.md
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
# dsh-oidc
|
|
2
|
-
|
|
3
|
-
> `0.2.0`, based on official DSH `0.1.5-rc.1`: identity login, managed keys, model discovery and logout remain public. Quota requests, normalization and UI belong to a separately installed institution extension. No public quota or heartbeat requests. See [account extensions](docs/account-extensions.en.md) and [server specification](docs/server-integration-contract.en.md). Consult the npm registry for publication status.
|
|
4
|
-
|
|
5
|
-
[简体中文](README.md) | **English**
|
|
6
|
-
|
|
7
|
-
Standards-based enterprise identity and model integration for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness).
|
|
8
|
-
|
|
9
|
-
`dsh-oidc` composes four concerns behind one reviewed, declarative Enterprise Profile:
|
|
10
|
-
|
|
11
|
-
1. OpenID Connect Authorization Code flow with PKCE for a public client;
|
|
12
|
-
2. a fixed enterprise **Key Binding** protocol that exchanges the authenticated OIDC access token for a revocable model runtime credential;
|
|
13
|
-
3. a local OpenAI-compatible Provider with optional automatic model discovery; and
|
|
14
|
-
4. safe account refresh and sign-out, with optional institution account extensions.
|
|
15
|
-
|
|
16
|
-
Shared account UI and optional bounded branding accompany these capabilities. Identity-only integration may omit resource APIs, and personal model providers remain available.
|
|
17
|
-
|
|
18
|
-
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).
|
|
19
|
-
|
|
20
|
-
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.
|
|
21
|
-
|
|
22
|
-
## Why this boundary
|
|
23
|
-
|
|
24
|
-
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.
|
|
25
|
-
|
|
26
|
-
```mermaid
|
|
27
|
-
flowchart LR
|
|
28
|
-
subgraph Local[Trusted local machine]
|
|
29
|
-
U[Browser] <-->|127.0.0.1 callback| D[DSH + dsh-oidc]
|
|
30
|
-
C[DSH Credential Provider]
|
|
31
|
-
P[Local OpenAI-compatible adapter]
|
|
32
|
-
D --> C --> P
|
|
33
|
-
end
|
|
34
|
-
subgraph Service[One institutional integration service]
|
|
35
|
-
O[OIDC Provider]
|
|
36
|
-
K[Key Binding]
|
|
37
|
-
M[Model gateway]
|
|
38
|
-
end
|
|
39
|
-
D <--> O
|
|
40
|
-
D --> K
|
|
41
|
-
K -->|runtime API key| C
|
|
42
|
-
P --> M
|
|
43
|
-
E[Enterprise Profile JSON] --> D
|
|
44
|
-
X[Optional capability plugin] -->|enterpriseTransforms| P
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
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.
|
|
48
|
-
|
|
49
|
-
## What is included
|
|
50
|
-
|
|
51
|
-
- loopback callback `http://127.0.0.1:<actual-port>/oauth/callback`: the WebServer port for Web, a temporary random port by default for desktop;
|
|
52
|
-
- OIDC Discovery, PKCE S256, state, nonce, RS256 ID Token validation, UserInfo subject binding, refresh, and optional revocation;
|
|
53
|
-
- `userinfo.name` for display, falling back only to the required `userinfo.sub`;
|
|
54
|
-
- fixed `worker-user-center-v1` endpoints for bootstrap, provision, resolve, and renew;
|
|
55
|
-
- DSH Credential Provider storage for OIDC session material and the runtime API key;
|
|
56
|
-
- declarative provider/model catalog and bounded brand tokens;
|
|
57
|
-
- shared official model-settings, onboarding, sidebar-account and general-settings slots, with capability-aware operations across local Web and both desktop shells;
|
|
58
|
-
- a native backend adapter boundary for desktop products;
|
|
59
|
-
- a stable `enterpriseTransforms` service for capabilities such as a text-model image fallback without forking the Provider route.
|
|
60
|
-
|
|
61
|
-
Not included: an OIDC Provider, a Key Binding server, multi-user session storage, an organization directory, a desktop shell, or remote executable plugins.
|
|
62
|
-
|
|
63
|
-
## Branding scope
|
|
64
|
-
|
|
65
|
-
`dsh-oidc` already includes bounded product branding. An Enterprise Profile may declare:
|
|
66
|
-
|
|
67
|
-
- `productName`, `organizationName`, and a one-to-four-character `mark`;
|
|
68
|
-
- an HTTPS or base64 PNG/WebP `logoURL`;
|
|
69
|
-
- a six-digit hexadecimal `primaryColor`;
|
|
70
|
-
- `loginTitle`, `loginDescription`, and an HTTPS `supportURL`.
|
|
71
|
-
|
|
72
|
-
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.
|
|
73
|
-
|
|
74
|
-
## Requirements
|
|
75
|
-
|
|
76
|
-
- Node.js 22 or newer;
|
|
77
|
-
- one coherent DeepSeek Harness `0.1.5-rc.1` peer set for this source candidate; historical stable `0.1.0` targets DSH `0.1.2-rc.1`;
|
|
78
|
-
- 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;
|
|
79
|
-
- Discovery metadata with PKCE S256, RS256 ID Tokens, and `userinfo_endpoint`;
|
|
80
|
-
- 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);
|
|
81
|
-
- a DSH Credential Provider appropriate for the deployment.
|
|
82
|
-
|
|
83
|
-
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).
|
|
84
|
-
|
|
85
|
-
## Install
|
|
86
|
-
|
|
87
|
-
Install the exact npm version in a coherent DSH `0.1.5-rc.1` host. During release preparation, if the version is not yet in the registry, use the source instructions below rather than installing an older version or suppressing peer conflicts:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
dsh plugin --profile web add @eduwork/dsh-oidc@0.2.0
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
For auditing, development, or testing unpublished changes, install from a local checkout instead:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
git clone https://github.com/freedomkk-qfeng/dsh-oidc.git
|
|
97
|
-
cd dsh-oidc
|
|
98
|
-
npm ci
|
|
99
|
-
npm run check
|
|
100
|
-
dsh plugin --profile web add .
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
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.
|
|
104
|
-
|
|
105
|
-
Advanced products may instead add it explicitly to their own DSH bundle patch:
|
|
106
|
-
|
|
107
|
-
```yaml
|
|
108
|
-
- insert:
|
|
109
|
-
- id: enterprise-oidc
|
|
110
|
-
name: '@eduwork/dsh-oidc'
|
|
111
|
-
config:
|
|
112
|
-
profilePathEnv: EDUWORK_OIDC_PROFILE
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
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).
|
|
116
|
-
|
|
117
|
-
Start DSH on the fixed IPv4 loopback host. The public OIDC client must register exactly:
|
|
118
|
-
|
|
119
|
-
```text
|
|
120
|
-
http://127.0.0.1:3080/oauth/callback
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
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.
|
|
124
|
-
|
|
125
|
-
## Configuration surfaces
|
|
126
|
-
|
|
127
|
-
| Plugin config | Purpose |
|
|
128
|
-
| --- | --- |
|
|
129
|
-
| `profile` | One inline Enterprise Profile object. |
|
|
130
|
-
| `profiles` | An array of inline Enterprise Profiles. Provider IDs must also be unique. |
|
|
131
|
-
| `profilePathEnv` | Name of an environment variable containing the trusted JSON profile path. |
|
|
132
|
-
| `backend` | `web` (default) for local validation, `desktop` for the shared temporary loopback/native-browser implementation, or legacy `native` for a host-provided `enterpriseAccounts` service. |
|
|
133
|
-
| `uiMode` | `standard` (shared model settings plus account/onboarding/branding), `models-only` (shared model settings only), or `external` (no plugin UI). |
|
|
134
|
-
| `web.returnPath` | Same-origin absolute path after callback; defaults to `/`. |
|
|
135
|
-
| `allowEmptyProfiles` | Allows the plugin service to start with no profile, mainly for composition tests. |
|
|
136
|
-
|
|
137
|
-
See [Enterprise Profile](docs/enterprise-profile.en.md) for every data field and trust rule.
|
|
138
|
-
|
|
139
|
-
## Protocol summary
|
|
140
|
-
|
|
141
|
-
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).
|
|
142
|
-
|
|
143
|
-
Given `keyBinding.baseURL = https://ai.example.edu/api/worker/v1`, the only valid operations are:
|
|
144
|
-
|
|
145
|
-
- `GET /bootstrap`
|
|
146
|
-
- `POST /runtime-credential/provision`
|
|
147
|
-
- `POST /runtime-credential/resolve`
|
|
148
|
-
- `POST /runtime-credential/renew`
|
|
149
|
-
|
|
150
|
-
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.
|
|
151
|
-
|
|
152
|
-
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.
|
|
153
|
-
|
|
154
|
-
## Development
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
npm ci
|
|
158
|
-
npm run check
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
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.
|
|
162
|
-
|
|
163
|
-
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`.
|
|
164
|
-
|
|
165
|
-
Plugin `0.2.0` does not track the EduWork product version. Distribution assembly uses an exact npm version and integrity; source paths are for development. This version does not replace earlier frozen artifacts. See [development and release preparation](docs/development.en.md) for clean installation and validation boundaries.
|
|
166
|
-
|
|
167
|
-
## Documentation
|
|
168
|
-
|
|
169
|
-
- [Architecture and boundaries](docs/architecture.en.md)
|
|
170
|
-
- [Complete institutional server integration contract](docs/server-integration-contract.en.md)
|
|
171
|
-
- [Third-party getting-started guide](docs/getting-started.en.md)
|
|
172
|
-
- [Enterprise Profile specification](docs/enterprise-profile.en.md)
|
|
173
|
-
- [OIDC interoperability profile](docs/oidc-interoperability.en.md)
|
|
174
|
-
- [Key Binding protocol](docs/key-binding-protocol.en.md)
|
|
175
|
-
- [Security model and deployment requirements](docs/security-model.en.md)
|
|
176
|
-
- [DSH integration and extension seams](docs/dsh-integration.en.md)
|
|
177
|
-
- [ECNU reference composition](docs/ecnu-reference.en.md)
|
|
178
|
-
- [Compatibility and release policy](docs/compatibility.en.md)
|
|
179
|
-
- [Public release checklist](docs/release-checklist.en.md)
|
|
180
|
-
- [Contribution guide](CONTRIBUTING.en.md), [security policy](SECURITY.en.md), and [governance](GOVERNANCE.en.md)
|
|
181
|
-
|
|
182
|
-
## License and trademarks
|
|
183
|
-
|
|
184
|
-
Code and original documentation are licensed under MIT. Dependency notices are in [THIRD_PARTY_NOTICES.en.md](THIRD_PARTY_NOTICES.en.md).
|
|
185
|
-
|
|
186
|
-
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.
|