dsh-device-auth 0.2.0 → 0.2.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.md +10 -0
- package/README.en.md +15 -3
- package/README.md +30 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.2.1] - 2026-11-21
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `.github/workflows/release.yml`: publishing on `v*` tags with the npm
|
|
12
|
+
provenance attestation (GitHub OIDC), version/tag consistency check, and the
|
|
13
|
+
same checks as CI. Authenticated with the `NPM_TOKEN` repository secret; the
|
|
14
|
+
README documents how to switch to npm trusted publishing once the publisher is
|
|
15
|
+
registered on npmjs.com.
|
|
16
|
+
|
|
7
17
|
## [0.2.0] - 2026-11-21
|
|
8
18
|
|
|
9
19
|
### Added
|
package/README.en.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
> Stable, revocable per-device login tokens for the DeepSeek Harness Web UI — paired clients survive restarts instead of copying the rotating 43-character launch token again.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/nypyp/dsh-device-auth/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/dsh-device-auth)
|
|
6
7
|

|
|
7
8
|

|
|
8
9
|
[中文](README.md)
|
|
@@ -25,15 +26,18 @@ DeepSeek Harness mints one random Web launch token per process and prints it onc
|
|
|
25
26
|
## Install
|
|
26
27
|
|
|
27
28
|
```sh
|
|
28
|
-
# from npm (
|
|
29
|
+
# from npm (available since 0.2.0)
|
|
29
30
|
dsh plugin --profile web add -w dsh-device-auth
|
|
30
31
|
|
|
32
|
+
# update
|
|
33
|
+
dsh plugin --profile web update dsh-device-auth@latest
|
|
34
|
+
|
|
31
35
|
# from a local checkout (development)
|
|
32
36
|
dsh plugin --profile web add -w file:/absolute/path/to/dsh-device-auth
|
|
33
|
-
|
|
34
|
-
systemctl --user restart dsh-web # or however you restart your instance
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
Installing or updating reloads the plugin through the normal loader path; restart `dsh web` only if the profile asks for it.
|
|
40
|
+
|
|
37
41
|
The bundle patch also sets `web-runtime.printUrl: false`, so the startup log no longer contains a usable launch token. You can also install it from the Web GUI's **Plugins → Add plugin** search once the package is published.
|
|
38
42
|
|
|
39
43
|
## Usage
|
|
@@ -113,6 +117,14 @@ dsh plugin --profile web remove dsh-device-auth # or plugin_manager remove_bun
|
|
|
113
117
|
|
|
114
118
|
Remove the bundle selection from the profile as well, then restart `dsh web`. Baseline behaviour (random launch token, startup URL printed) returns.
|
|
115
119
|
|
|
120
|
+
## Releasing (maintainers)
|
|
121
|
+
|
|
122
|
+
Pushing a `v*` tag runs [`.github/workflows/release.yml`](.github/workflows/release.yml): checks, unit tests, `npm pack` verification, then `npm publish --provenance` (signed with GitHub OIDC provenance). Authentication uses the `NPM_TOKEN` repository secret (a granular npm token scoped to publishing `dsh-device-auth`).
|
|
123
|
+
|
|
124
|
+
### Optional, preferred: trusted publishing (OIDC, no long-lived token)
|
|
125
|
+
|
|
126
|
+
Enable it on `https://www.npmjs.com/package/dsh-device-auth/settings` → **Trusted publishing** → GitHub Actions: repository `nypyp/dsh-device-auth`, workflow `release.yml`. Once registered, delete the `NPM_TOKEN` secret and the workflow publishes through OIDC (it already has `id-token: write`).
|
|
127
|
+
|
|
116
128
|
## Credits
|
|
117
129
|
|
|
118
130
|
The credential model is inspired by [OpenChamber](https://github.com/openchamber/openchamber): an opaque random bearer stored server-side as SHA-256, in-place rotation for the same device, and per-device revocation.
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
> 给 DeepSeek Harness Web UI 增加**稳定、可按设备撤销**的登录令牌:`dsh web` 重启后,已配对客户端不用再复制一次 43 位随机 launch token。
|
|
4
4
|
|
|
5
5
|
[](https://github.com/nypyp/dsh-device-auth/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/dsh-device-auth)
|
|
6
7
|

|
|
7
8
|

|
|
8
9
|
[English](README.en.md)
|
|
@@ -34,15 +35,18 @@ DeepSeek Harness 的 Web 启动令牌(launch token)由进程在每次启动
|
|
|
34
35
|
### 命令行
|
|
35
36
|
|
|
36
37
|
```sh
|
|
37
|
-
#
|
|
38
|
+
# 从 npm 安装(0.2.0 起可用)
|
|
38
39
|
dsh plugin --profile web add -w dsh-device-auth
|
|
39
40
|
|
|
41
|
+
# 更新
|
|
42
|
+
dsh plugin --profile web update dsh-device-auth@latest
|
|
43
|
+
|
|
40
44
|
# 从本地目录安装(开发调试)
|
|
41
45
|
dsh plugin --profile web add -w file:/absolute/path/to/dsh-device-auth
|
|
42
|
-
|
|
43
|
-
systemctl --user restart dsh-web # 或按你的部署方式重启
|
|
44
46
|
```
|
|
45
47
|
|
|
48
|
+
安装/更新后 `dsh web` 会按新模块重新加载;若界面提示需要重启,重启一次即可。
|
|
49
|
+
|
|
46
50
|
安装后插件所在的 bundle 层会同时把 `web-runtime.printUrl` 设为 `false`:启动日志不再出现带真实令牌的 URL。
|
|
47
51
|
|
|
48
52
|
## 使用
|
|
@@ -134,6 +138,29 @@ dsh plugin --profile web remove dsh-device-auth # 或 plugin_manager remove_bu
|
|
|
134
138
|
|
|
135
139
|
回滚后行为回到基线(随机 launch token、启动 URL 照常打印);`~/.dsh/remote-auth.json` 可保留或删除。
|
|
136
140
|
|
|
141
|
+
## 发布(维护者)
|
|
142
|
+
|
|
143
|
+
推送 `v*` tag 触发 [`.github/workflows/release.yml`](.github/workflows/release.yml):
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
# 1) 确认 package.json 版本与 tag 一致
|
|
147
|
+
npm version 0.2.2 --no-git-tag-version # 或手改
|
|
148
|
+
git commit -am "release: v0.2.2"
|
|
149
|
+
git tag -a v0.2.2 -m "v0.2.2"
|
|
150
|
+
git push origin main --tags
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
工作流会跑 check/单测/npm pack,然后 `npm publish --provenance`,在 npm 上生成可验证的 provenance 证明。发布认证使用仓库 secret `NPM_TOKEN`(npm granular token,仅授权 `dsh-device-auth` 的 publish 权限)。
|
|
154
|
+
|
|
155
|
+
### 可选的更优方案:Trusted Publishing(OIDC,无长期 token)
|
|
156
|
+
|
|
157
|
+
npm 官方推荐用 OIDC 代替长期 token。账号需要能在 npmjs.com 上完成 2FA:
|
|
158
|
+
|
|
159
|
+
1. 登录 npmjs.com(账号 `nypyp`),打开 `https://www.npmjs.com/package/dsh-device-auth/settings`;
|
|
160
|
+
2. **Trusted publishing** → 添加 GitHub Actions:仓库 `nypyp/dsh-device-auth`、workflow 文件名 `release.yml`(可留环境名空);
|
|
161
|
+
3. 或者在本机执行 `npm trust github dsh-device-auth --repo nypyp/dsh-device-auth --file release.yml --allow-publish -y`(需要交互式 2FA/邮箱验证码);
|
|
162
|
+
4. 配置完成后可以删除仓库 secret `NPM_TOKEN`,release workflow 会自动使用 OIDC(`id-token: write` 已就绪)。
|
|
163
|
+
|
|
137
164
|
## 参考与致谢
|
|
138
165
|
|
|
139
166
|
设计参考了 [OpenChamber](https://github.com/openchamber/openchamber) 的设备凭据模型(不透明 bearer、服务端只存 SHA-256、同设备重发即轮换、按设备撤销)。感谢其 MIT 开源实现为这套方案提供了可直接对照的工程先例。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-device-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Stable, revocable per-device login tokens for the DeepSeek Harness Web UI — paired clients survive restarts without copying the rotating launch token",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|