dsh-auth-remote 0.1.1 → 0.1.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.md +6 -0
- package/CHANGELOG.zh-CN.md +6 -0
- package/README.md +11 -3
- package/README.zh-CN.md +11 -3
- package/dist/client.js +117 -96
- package/dist/client.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/login.css +100 -73
- package/dist/login.css.map +2 -2
- package/dist/types/adapters/dsh/compatibility.d.ts +1 -0
- package/dist/types/adapters/dsh/compatibility.d.ts.map +1 -1
- package/docs/deployment.md +5 -3
- package/docs/deployment.zh-CN.md +5 -3
- package/docs/development.md +22 -7
- package/docs/development.zh-CN.md +22 -7
- package/docs/releasing.md +5 -5
- package/docs/releasing.zh-CN.md +5 -5
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ This file records user-visible changes to the released package. Version numbers
|
|
|
8
8
|
|
|
9
9
|
No changes recorded yet.
|
|
10
10
|
|
|
11
|
+
## 0.1.2 - 2026-09-29
|
|
12
|
+
|
|
13
|
+
- Align login and security settings with DSH typography, neutral colors, controls, and light/dark themes.
|
|
14
|
+
- Verify DSH 0.1.7-rc.1, 0.1.7-rc.2, and 0.2.0-rc.1 in the CLI/browser matrix; use 0.2.0-rc.1 as the default development runtime.
|
|
15
|
+
- Admit DSH versions `>=0.1.7-rc.1` without an upper version ceiling, retaining required authentication API and package identity checks. Later versions are forward-admitted, not individually verified.
|
|
16
|
+
|
|
11
17
|
## 0.1.1 - 2026-09-28
|
|
12
18
|
|
|
13
19
|
- Documented installation from the published npm package in English and Chinese.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
暂无记录。
|
|
10
10
|
|
|
11
|
+
## 0.1.2 - 2026-09-29
|
|
12
|
+
|
|
13
|
+
- 登录页和安全设置对齐 DSH 的字体、灰阶、控件与浅色/深色主题。
|
|
14
|
+
- CLI/浏览器矩阵验证 DSH 0.1.7-rc.1、0.1.7-rc.2 和 0.2.0-rc.1,默认开发运行时升级为 0.2.0-rc.1。
|
|
15
|
+
- DSH 版本准入改为 `>=0.1.7-rc.1`,去掉上限并保留必需的认证接口及包实例检查;后续版本属于向前准入,不宣称已逐版验证。
|
|
16
|
+
|
|
11
17
|
## 0.1.1 - 2026-09-28
|
|
12
18
|
|
|
13
19
|
- 中英文文档改为指导从已发布的 npm 包安装插件。
|
package/README.md
CHANGED
|
@@ -6,21 +6,29 @@ Single-user remote sign-in for DeepSeek Harness (DSH), with password, TOTP, one-
|
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
|
-
- Linux with `/proc`, Node.js 24 or newer, and
|
|
9
|
+
- Linux with `/proc`, Node.js 24 or newer, and a tested DSH runtime: **0.1.7-rc.1**, **0.1.7-rc.2**, or **0.2.0-rc.1**. pnpm 12.5.1 is needed only when building from source.
|
|
10
10
|
- DSH's default `~/.dsh` data directory and a `web` profile. The account state belongs to that profile; it is not shared with another profile.
|
|
11
11
|
- For source browser tests, install Playwright Chromium with `pnpm exec playwright install chromium`. The tests use that managed browser and a dedicated, self-signed TLS fixture.
|
|
12
12
|
|
|
13
|
+
## DSH compatibility
|
|
14
|
+
|
|
15
|
+
Plugin 0.1.2 is tested against DSH **0.1.7-rc.1**, **0.1.7-rc.2**, and **0.2.0-rc.1**. The host peer declaration and runtime version check both use `>=0.1.7-rc.1`, with no upper bound. DSH's loader includes prereleases, so 0.2 and later releases are admitted without a per-version exemption or a plugin update solely to widen the range.
|
|
16
|
+
|
|
17
|
+
Later versions are forward-admitted, not claimed as tested. The plugin still verifies the required WebServer/Connection APIs, shared host package identity, and native authentication exchange. If those contracts change, authentication stays unavailable with a diagnostic; removing the version ceiling cannot guarantee compatibility with unknown API changes. CI runs CLI and browser regressions on all three tested versions.
|
|
18
|
+
|
|
19
|
+
These compatibility and theme changes are available starting with plugin **0.1.2**. Upgrade older plugin installations to 0.1.2 or newer when using DSH 0.2.0-rc.1. For source builds, see the [development guide](docs/development.md).
|
|
20
|
+
|
|
13
21
|
## Install from npm
|
|
14
22
|
|
|
15
23
|
With DSH installed, verify its version and install the published plugin into the default `web` profile:
|
|
16
24
|
|
|
17
25
|
```sh
|
|
18
26
|
dsh --version
|
|
19
|
-
dsh plugin --profile web add dsh-auth-remote@0.1.
|
|
27
|
+
dsh plugin --profile web add dsh-auth-remote@0.1.2
|
|
20
28
|
dsh plugin --profile web list
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
Check that `dsh --version` prints `0.
|
|
31
|
+
Check that `dsh --version` prints `0.2.0-rc.1` (or another tested version listed above) and the plugin list includes `dsh-auth-remote@0.1.2`. These commands use DSH's default data directory. For source builds and an isolated development runtime, see the [development guide](docs/development.md).
|
|
24
32
|
|
|
25
33
|
## Configure the web profile
|
|
26
34
|
|
package/README.zh-CN.md
CHANGED
|
@@ -6,21 +6,29 @@ DeepSeek Harness(DSH)的单用户远程登录插件,提供密码、TOTP、
|
|
|
6
6
|
|
|
7
7
|
## 前置条件
|
|
8
8
|
|
|
9
|
-
- Linux(含 `/proc`)、Node.js 24 或更高版本,以及已测试的 DSH **0.1.7-rc.1** 运行时。仅从源码构建时需要 pnpm 12.5.1。
|
|
9
|
+
- Linux(含 `/proc`)、Node.js 24 或更高版本,以及已测试的 DSH **0.1.7-rc.1**、**0.1.7-rc.2** 或 **0.2.0-rc.1** 运行时。仅从源码构建时需要 pnpm 12.5.1。
|
|
10
10
|
- DSH 默认的 `~/.dsh` 数据目录和 `web` profile。账号状态属于该 profile,不与其他 profile 共用。
|
|
11
11
|
- 源码浏览器测试先执行 `pnpm exec playwright install chromium`。测试使用 Playwright 管理的浏览器和专用自签 TLS 夹具。
|
|
12
12
|
|
|
13
|
+
## DSH 兼容性
|
|
14
|
+
|
|
15
|
+
插件 0.1.2 已测试 DSH **0.1.7-rc.1**、**0.1.7-rc.2** 和 **0.2.0-rc.1**。宿主 peer 声明和运行时版本检查统一使用 `>=0.1.7-rc.1`,不设版本上限。DSH 的加载器检查包含预发布版本,因此 0.2 及后续版本无需逐版豁免,也无需仅为放宽版本范围而更新插件。
|
|
16
|
+
|
|
17
|
+
后续版本属于向前准入,并不宣称已经逐版测试。插件仍检查必需的 WebServer/Connection 接口、宿主包实例一致性和原生认证交换。若这些约定改变,认证入口会保持不可用并给出诊断;取消版本上限不能保证未知接口变更后的兼容性。CI 在上述三个版本上运行 CLI 和浏览器回归。
|
|
18
|
+
|
|
19
|
+
上述兼容性和样式更新从插件 **0.1.2** 开始提供。使用 DSH 0.2.0-rc.1 时,请将旧插件升级到 0.1.2 或更高版本。源码构建参见[开发指南](docs/development.zh-CN.md)。
|
|
20
|
+
|
|
13
21
|
## 从 npm 安装
|
|
14
22
|
|
|
15
23
|
安装 DSH 后,核对版本并把已发布的插件安装到默认 `web` profile:
|
|
16
24
|
|
|
17
25
|
```sh
|
|
18
26
|
dsh --version
|
|
19
|
-
dsh plugin --profile web add dsh-auth-remote@0.1.
|
|
27
|
+
dsh plugin --profile web add dsh-auth-remote@0.1.2
|
|
20
28
|
dsh plugin --profile web list
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
确认 `dsh --version` 输出 `0.
|
|
31
|
+
确认 `dsh --version` 输出 `0.2.0-rc.1`(或上文列出的其他已测试版本),且插件列表中有 `dsh-auth-remote@0.1.2`。这些命令使用 DSH 默认数据目录。源码构建及隔离开发运行时参见[开发指南](docs/development.zh-CN.md)。
|
|
24
32
|
|
|
25
33
|
## 配置 web profile
|
|
26
34
|
|
package/dist/client.js
CHANGED
|
@@ -219,19 +219,19 @@ var require_bit_matrix = __commonJS({
|
|
|
219
219
|
this.data = new Uint8Array(size * size);
|
|
220
220
|
this.reservedBit = new Uint8Array(size * size);
|
|
221
221
|
}
|
|
222
|
-
BitMatrix.prototype.set = function(
|
|
223
|
-
const index =
|
|
222
|
+
BitMatrix.prototype.set = function(row, col, value, reserved) {
|
|
223
|
+
const index = row * this.size + col;
|
|
224
224
|
this.data[index] = value;
|
|
225
225
|
if (reserved) this.reservedBit[index] = true;
|
|
226
226
|
};
|
|
227
|
-
BitMatrix.prototype.get = function(
|
|
228
|
-
return this.data[
|
|
227
|
+
BitMatrix.prototype.get = function(row, col) {
|
|
228
|
+
return this.data[row * this.size + col];
|
|
229
229
|
};
|
|
230
|
-
BitMatrix.prototype.xor = function(
|
|
231
|
-
this.data[
|
|
230
|
+
BitMatrix.prototype.xor = function(row, col, value) {
|
|
231
|
+
this.data[row * this.size + col] ^= value;
|
|
232
232
|
};
|
|
233
|
-
BitMatrix.prototype.isReserved = function(
|
|
234
|
-
return this.reservedBit[
|
|
233
|
+
BitMatrix.prototype.isReserved = function(row, col) {
|
|
234
|
+
return this.reservedBit[row * this.size + col];
|
|
235
235
|
};
|
|
236
236
|
module2.exports = BitMatrix;
|
|
237
237
|
}
|
|
@@ -326,11 +326,11 @@ var require_mask_pattern = __commonJS({
|
|
|
326
326
|
let sameCountRow = 0;
|
|
327
327
|
let lastCol = null;
|
|
328
328
|
let lastRow = null;
|
|
329
|
-
for (let
|
|
329
|
+
for (let row = 0; row < size; row++) {
|
|
330
330
|
sameCountCol = sameCountRow = 0;
|
|
331
331
|
lastCol = lastRow = null;
|
|
332
332
|
for (let col = 0; col < size; col++) {
|
|
333
|
-
let module3 = data.get(
|
|
333
|
+
let module3 = data.get(row, col);
|
|
334
334
|
if (module3 === lastCol) {
|
|
335
335
|
sameCountCol++;
|
|
336
336
|
} else {
|
|
@@ -338,7 +338,7 @@ var require_mask_pattern = __commonJS({
|
|
|
338
338
|
lastCol = module3;
|
|
339
339
|
sameCountCol = 1;
|
|
340
340
|
}
|
|
341
|
-
module3 = data.get(col,
|
|
341
|
+
module3 = data.get(col, row);
|
|
342
342
|
if (module3 === lastRow) {
|
|
343
343
|
sameCountRow++;
|
|
344
344
|
} else {
|
|
@@ -355,9 +355,9 @@ var require_mask_pattern = __commonJS({
|
|
|
355
355
|
exports.getPenaltyN2 = function getPenaltyN2(data) {
|
|
356
356
|
const size = data.size;
|
|
357
357
|
let points = 0;
|
|
358
|
-
for (let
|
|
358
|
+
for (let row = 0; row < size - 1; row++) {
|
|
359
359
|
for (let col = 0; col < size - 1; col++) {
|
|
360
|
-
const last = data.get(
|
|
360
|
+
const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1);
|
|
361
361
|
if (last === 4 || last === 0) points++;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -368,12 +368,12 @@ var require_mask_pattern = __commonJS({
|
|
|
368
368
|
let points = 0;
|
|
369
369
|
let bitsCol = 0;
|
|
370
370
|
let bitsRow = 0;
|
|
371
|
-
for (let
|
|
371
|
+
for (let row = 0; row < size; row++) {
|
|
372
372
|
bitsCol = bitsRow = 0;
|
|
373
373
|
for (let col = 0; col < size; col++) {
|
|
374
|
-
bitsCol = bitsCol << 1 & 2047 | data.get(
|
|
374
|
+
bitsCol = bitsCol << 1 & 2047 | data.get(row, col);
|
|
375
375
|
if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++;
|
|
376
|
-
bitsRow = bitsRow << 1 & 2047 | data.get(col,
|
|
376
|
+
bitsRow = bitsRow << 1 & 2047 | data.get(col, row);
|
|
377
377
|
if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -411,9 +411,9 @@ var require_mask_pattern = __commonJS({
|
|
|
411
411
|
exports.applyMask = function applyMask(pattern, data) {
|
|
412
412
|
const size = data.size;
|
|
413
413
|
for (let col = 0; col < size; col++) {
|
|
414
|
-
for (let
|
|
415
|
-
if (data.isReserved(
|
|
416
|
-
data.xor(
|
|
414
|
+
for (let row = 0; row < size; row++) {
|
|
415
|
+
if (data.isReserved(row, col)) continue;
|
|
416
|
+
data.xor(row, col, getMaskAt(pattern, row, col));
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
};
|
|
@@ -1634,16 +1634,16 @@ var require_qrcode = __commonJS({
|
|
|
1634
1634
|
const size = matrix.size;
|
|
1635
1635
|
const pos = FinderPattern.getPositions(version);
|
|
1636
1636
|
for (let i = 0; i < pos.length; i++) {
|
|
1637
|
-
const
|
|
1637
|
+
const row = pos[i][0];
|
|
1638
1638
|
const col = pos[i][1];
|
|
1639
1639
|
for (let r = -1; r <= 7; r++) {
|
|
1640
|
-
if (
|
|
1640
|
+
if (row + r <= -1 || size <= row + r) continue;
|
|
1641
1641
|
for (let c = -1; c <= 7; c++) {
|
|
1642
1642
|
if (col + c <= -1 || size <= col + c) continue;
|
|
1643
1643
|
if (r >= 0 && r <= 6 && (c === 0 || c === 6) || c >= 0 && c <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && c >= 2 && c <= 4) {
|
|
1644
|
-
matrix.set(
|
|
1644
|
+
matrix.set(row + r, col + c, true, true);
|
|
1645
1645
|
} else {
|
|
1646
|
-
matrix.set(
|
|
1646
|
+
matrix.set(row + r, col + c, false, true);
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
@@ -1660,14 +1660,14 @@ var require_qrcode = __commonJS({
|
|
|
1660
1660
|
function setupAlignmentPattern(matrix, version) {
|
|
1661
1661
|
const pos = AlignmentPattern.getPositions(version);
|
|
1662
1662
|
for (let i = 0; i < pos.length; i++) {
|
|
1663
|
-
const
|
|
1663
|
+
const row = pos[i][0];
|
|
1664
1664
|
const col = pos[i][1];
|
|
1665
1665
|
for (let r = -2; r <= 2; r++) {
|
|
1666
1666
|
for (let c = -2; c <= 2; c++) {
|
|
1667
1667
|
if (r === -2 || r === 2 || c === -2 || c === 2 || r === 0 && c === 0) {
|
|
1668
|
-
matrix.set(
|
|
1668
|
+
matrix.set(row + r, col + c, true, true);
|
|
1669
1669
|
} else {
|
|
1670
|
-
matrix.set(
|
|
1670
|
+
matrix.set(row + r, col + c, false, true);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
@@ -1676,13 +1676,13 @@ var require_qrcode = __commonJS({
|
|
|
1676
1676
|
function setupVersionInfo(matrix, version) {
|
|
1677
1677
|
const size = matrix.size;
|
|
1678
1678
|
const bits = Version.getEncodedBits(version);
|
|
1679
|
-
let
|
|
1679
|
+
let row, col, mod;
|
|
1680
1680
|
for (let i = 0; i < 18; i++) {
|
|
1681
|
-
|
|
1681
|
+
row = Math.floor(i / 3);
|
|
1682
1682
|
col = i % 3 + size - 8 - 3;
|
|
1683
1683
|
mod = (bits >> i & 1) === 1;
|
|
1684
|
-
matrix.set(
|
|
1685
|
-
matrix.set(col,
|
|
1684
|
+
matrix.set(row, col, mod, true);
|
|
1685
|
+
matrix.set(col, row, mod, true);
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
1688
|
function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) {
|
|
@@ -1711,19 +1711,19 @@ var require_qrcode = __commonJS({
|
|
|
1711
1711
|
function setupData(matrix, data) {
|
|
1712
1712
|
const size = matrix.size;
|
|
1713
1713
|
let inc = -1;
|
|
1714
|
-
let
|
|
1714
|
+
let row = size - 1;
|
|
1715
1715
|
let bitIndex = 7;
|
|
1716
1716
|
let byteIndex = 0;
|
|
1717
1717
|
for (let col = size - 1; col > 0; col -= 2) {
|
|
1718
1718
|
if (col === 6) col--;
|
|
1719
1719
|
while (true) {
|
|
1720
1720
|
for (let c = 0; c < 2; c++) {
|
|
1721
|
-
if (!matrix.isReserved(
|
|
1721
|
+
if (!matrix.isReserved(row, col - c)) {
|
|
1722
1722
|
let dark = false;
|
|
1723
1723
|
if (byteIndex < data.length) {
|
|
1724
1724
|
dark = (data[byteIndex] >>> bitIndex & 1) === 1;
|
|
1725
1725
|
}
|
|
1726
|
-
matrix.set(
|
|
1726
|
+
matrix.set(row, col - c, dark);
|
|
1727
1727
|
bitIndex--;
|
|
1728
1728
|
if (bitIndex === -1) {
|
|
1729
1729
|
byteIndex++;
|
|
@@ -1731,9 +1731,9 @@ var require_qrcode = __commonJS({
|
|
|
1731
1731
|
}
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
|
-
|
|
1735
|
-
if (
|
|
1736
|
-
|
|
1734
|
+
row += inc;
|
|
1735
|
+
if (row < 0 || size <= row) {
|
|
1736
|
+
row -= inc;
|
|
1737
1737
|
inc = -inc;
|
|
1738
1738
|
break;
|
|
1739
1739
|
}
|
|
@@ -2032,12 +2032,12 @@ var require_svg_tag = __commonJS({
|
|
|
2032
2032
|
let lineLength = 0;
|
|
2033
2033
|
for (let i = 0; i < data.length; i++) {
|
|
2034
2034
|
const col = Math.floor(i % size);
|
|
2035
|
-
const
|
|
2035
|
+
const row = Math.floor(i / size);
|
|
2036
2036
|
if (!col && !newRow) newRow = true;
|
|
2037
2037
|
if (data[i]) {
|
|
2038
2038
|
lineLength++;
|
|
2039
2039
|
if (!(i > 0 && col > 0 && data[i - 1])) {
|
|
2040
|
-
path += newRow ? svgCmd("M", col + margin, 0.5 +
|
|
2040
|
+
path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
|
|
2041
2041
|
moveBy = 0;
|
|
2042
2042
|
newRow = false;
|
|
2043
2043
|
}
|
|
@@ -2237,29 +2237,6 @@ function isUnauthorized(error) {
|
|
|
2237
2237
|
|
|
2238
2238
|
// src/client/settings/section.tsx
|
|
2239
2239
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
2240
|
-
var field = {
|
|
2241
|
-
display: "block",
|
|
2242
|
-
width: "100%",
|
|
2243
|
-
maxWidth: 420,
|
|
2244
|
-
minHeight: 38,
|
|
2245
|
-
margin: "6px 0 14px",
|
|
2246
|
-
padding: "7px 10px",
|
|
2247
|
-
border: "1px solid currentColor",
|
|
2248
|
-
borderRadius: 6,
|
|
2249
|
-
background: "transparent",
|
|
2250
|
-
color: "inherit",
|
|
2251
|
-
font: "inherit"
|
|
2252
|
-
};
|
|
2253
|
-
var button = {
|
|
2254
|
-
padding: "8px 13px",
|
|
2255
|
-
border: "1px solid currentColor",
|
|
2256
|
-
borderRadius: 6,
|
|
2257
|
-
background: "transparent",
|
|
2258
|
-
color: "inherit",
|
|
2259
|
-
font: "inherit",
|
|
2260
|
-
cursor: "pointer"
|
|
2261
|
-
};
|
|
2262
|
-
var row = { display: "flex", flexWrap: "wrap", gap: 10, margin: "20px 0" };
|
|
2263
2240
|
var draft = {
|
|
2264
2241
|
panel: null,
|
|
2265
2242
|
binding: null,
|
|
@@ -2271,12 +2248,11 @@ function resetDraft() {
|
|
|
2271
2248
|
draft = { panel: null, binding: null, backupCodes: null, message: null, fields: {} };
|
|
2272
2249
|
}
|
|
2273
2250
|
function TextField(props) {
|
|
2274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "auth-remote-field", children: [
|
|
2275
2252
|
props.label,
|
|
2276
2253
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2277
2254
|
"input",
|
|
2278
2255
|
{
|
|
2279
|
-
style: field,
|
|
2280
2256
|
name: props.name,
|
|
2281
2257
|
defaultValue: draft.fields[props.name] ?? "",
|
|
2282
2258
|
onChange: (event) => {
|
|
@@ -2367,41 +2343,50 @@ function SecuritySection({
|
|
|
2367
2343
|
return new FormData(event.currentTarget);
|
|
2368
2344
|
}
|
|
2369
2345
|
if (backupCodes) {
|
|
2370
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
"
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2347
|
+
"section",
|
|
2348
|
+
{
|
|
2349
|
+
ref: sectionRef,
|
|
2350
|
+
className: "auth-remote-security",
|
|
2351
|
+
"aria-label": t("settingsSectionAria"),
|
|
2352
|
+
children: [
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: t("settingsBackupTitle") }),
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("settingsBackupDescription") }),
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "auth-remote-backup-codes", children: backupCodes.map((code) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: code }, code)) }),
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2357
|
+
"button",
|
|
2358
|
+
{
|
|
2359
|
+
className: "auth-remote-button",
|
|
2360
|
+
onClick: () => {
|
|
2361
|
+
resetDraft();
|
|
2362
|
+
goToLogin("updated");
|
|
2363
|
+
},
|
|
2364
|
+
children: t("settingsBackupSaved")
|
|
2365
|
+
}
|
|
2366
|
+
)
|
|
2367
|
+
]
|
|
2368
|
+
}
|
|
2369
|
+
);
|
|
2386
2370
|
}
|
|
2387
2371
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2388
2372
|
"section",
|
|
2389
2373
|
{
|
|
2390
2374
|
ref: sectionRef,
|
|
2391
2375
|
"aria-label": t("settingsSectionAria"),
|
|
2392
|
-
|
|
2376
|
+
className: "auth-remote-security",
|
|
2393
2377
|
children: [
|
|
2394
2378
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: t("settingsTitle") }),
|
|
2395
2379
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: me ? t("settingsAccountSummary", {
|
|
2396
2380
|
username: me.username,
|
|
2397
2381
|
totp: t(me.totpEnabled ? "settingsTotpEnabled" : "settingsTotpNotBound")
|
|
2398
2382
|
}) : t("settingsLoading") }),
|
|
2399
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "auth-remote-actions", children: [
|
|
2400
2384
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2401
2385
|
"button",
|
|
2402
2386
|
{
|
|
2403
|
-
|
|
2404
|
-
disabled: !me,
|
|
2387
|
+
className: "auth-remote-button",
|
|
2388
|
+
disabled: !me || busy,
|
|
2389
|
+
"aria-pressed": panel === "password",
|
|
2405
2390
|
onClick: () => {
|
|
2406
2391
|
setPanel("password");
|
|
2407
2392
|
setMessage(null);
|
|
@@ -2412,8 +2397,9 @@ function SecuritySection({
|
|
|
2412
2397
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2413
2398
|
"button",
|
|
2414
2399
|
{
|
|
2415
|
-
|
|
2416
|
-
disabled: !me,
|
|
2400
|
+
className: "auth-remote-button",
|
|
2401
|
+
disabled: !me || busy,
|
|
2402
|
+
"aria-pressed": panel === "totp",
|
|
2417
2403
|
onClick: () => {
|
|
2418
2404
|
setPanel("totp");
|
|
2419
2405
|
setBinding(null);
|
|
@@ -2425,8 +2411,9 @@ function SecuritySection({
|
|
|
2425
2411
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2426
2412
|
"button",
|
|
2427
2413
|
{
|
|
2428
|
-
|
|
2429
|
-
disabled: !me,
|
|
2414
|
+
className: "auth-remote-button",
|
|
2415
|
+
disabled: !me || busy,
|
|
2416
|
+
"aria-pressed": panel === "sessions",
|
|
2430
2417
|
onClick: () => {
|
|
2431
2418
|
setPanel("sessions");
|
|
2432
2419
|
setMessage(null);
|
|
@@ -2492,7 +2479,7 @@ function SecuritySection({
|
|
|
2492
2479
|
autoComplete: "new-password"
|
|
2493
2480
|
}
|
|
2494
2481
|
),
|
|
2495
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "auth-remote-button auth-remote-primary", disabled: busy, type: "submit", children: t("settingsSavePassword") })
|
|
2496
2483
|
]
|
|
2497
2484
|
}
|
|
2498
2485
|
),
|
|
@@ -2537,7 +2524,15 @@ function SecuritySection({
|
|
|
2537
2524
|
autoComplete: "one-time-code"
|
|
2538
2525
|
}
|
|
2539
2526
|
),
|
|
2540
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2528
|
+
"button",
|
|
2529
|
+
{
|
|
2530
|
+
className: "auth-remote-button auth-remote-primary",
|
|
2531
|
+
disabled: busy,
|
|
2532
|
+
type: "submit",
|
|
2533
|
+
children: t("settingsStartBinding")
|
|
2534
|
+
}
|
|
2535
|
+
)
|
|
2541
2536
|
]
|
|
2542
2537
|
}
|
|
2543
2538
|
),
|
|
@@ -2574,7 +2569,15 @@ function SecuritySection({
|
|
|
2574
2569
|
autoComplete: "one-time-code"
|
|
2575
2570
|
}
|
|
2576
2571
|
),
|
|
2577
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2573
|
+
"button",
|
|
2574
|
+
{
|
|
2575
|
+
className: "auth-remote-button auth-remote-primary",
|
|
2576
|
+
disabled: busy,
|
|
2577
|
+
type: "submit",
|
|
2578
|
+
children: t("settingsDisableTotp")
|
|
2579
|
+
}
|
|
2580
|
+
)
|
|
2578
2581
|
]
|
|
2579
2582
|
}
|
|
2580
2583
|
)
|
|
@@ -2598,14 +2601,14 @@ function SecuritySection({
|
|
|
2598
2601
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
|
|
2599
2602
|
t("settingsManualSecret"),
|
|
2600
2603
|
" ",
|
|
2601
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: binding.secret })
|
|
2602
2605
|
] }),
|
|
2603
2606
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextField, { label: t("settingsNewCode"), name: "code", autoComplete: "one-time-code" }),
|
|
2604
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
2607
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "auth-remote-button auth-remote-primary", disabled: busy, type: "submit", children: t("settingsConfirmBinding") }),
|
|
2605
2608
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2606
2609
|
"button",
|
|
2607
2610
|
{
|
|
2608
|
-
|
|
2611
|
+
className: "auth-remote-button auth-remote-restart",
|
|
2609
2612
|
type: "button",
|
|
2610
2613
|
onClick: () => setBinding(null),
|
|
2611
2614
|
children: t("settingsRestartBinding")
|
|
@@ -2619,7 +2622,7 @@ function SecuritySection({
|
|
|
2619
2622
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2620
2623
|
"button",
|
|
2621
2624
|
{
|
|
2622
|
-
|
|
2625
|
+
className: "auth-remote-button",
|
|
2623
2626
|
disabled: busy,
|
|
2624
2627
|
onClick: () => void submit(
|
|
2625
2628
|
() => authRequest("/auth-remote/logout", {}),
|
|
@@ -2661,12 +2664,20 @@ function SecuritySection({
|
|
|
2661
2664
|
autoComplete: "one-time-code"
|
|
2662
2665
|
}
|
|
2663
2666
|
),
|
|
2664
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2668
|
+
"button",
|
|
2669
|
+
{
|
|
2670
|
+
className: "auth-remote-button auth-remote-primary",
|
|
2671
|
+
disabled: busy,
|
|
2672
|
+
type: "submit",
|
|
2673
|
+
children: t("settingsSignOutAll")
|
|
2674
|
+
}
|
|
2675
|
+
)
|
|
2665
2676
|
]
|
|
2666
2677
|
}
|
|
2667
2678
|
)
|
|
2668
2679
|
] }),
|
|
2669
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "alert", "aria-live": "assertive", children: message && t(message.key, message.params) })
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "auth-remote-error", role: "alert", "aria-live": "assertive", children: message && t(message.key, message.params) })
|
|
2670
2681
|
]
|
|
2671
2682
|
}
|
|
2672
2683
|
);
|
|
@@ -3049,11 +3060,21 @@ var zh = {
|
|
|
3049
3060
|
cliErrorUnknown: "\u64CD\u4F5C\u5931\u8D25\uFF1B\u518D\u6B21\u64CD\u4F5C\u524D\u8BF7\u5148\u68C0\u67E5\u72B6\u6001\u3002"
|
|
3050
3061
|
};
|
|
3051
3062
|
|
|
3063
|
+
// src/client/settings/style.css
|
|
3064
|
+
var style_default = "/* Inherit the host's live DSH theme. Scope every rule to this settings section.\n * Radius fallbacks match 0.1.7, before DSH published the shared radius tokens. */\n.auth-remote-security {\n min-width: 0;\n color: var(--dsw-alias-label-primary);\n font-family: var(--dsw-font-family);\n font-size: 14px;\n line-height: 22px;\n}\n\n.auth-remote-security h2 {\n margin: 0 0 8px;\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n}\n\n.auth-remote-security h3 {\n margin: 0 0 8px;\n font-size: 14px;\n font-weight: 500;\n line-height: 22px;\n}\n\n.auth-remote-security p {\n margin: 0 0 16px;\n color: var(--dsw-alias-label-secondary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.auth-remote-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n padding: 4px 0 20px;\n}\n\n.auth-remote-security form {\n margin: 0;\n padding: 20px 0;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.auth-remote-field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin-bottom: 16px;\n font-size: 13px;\n line-height: 20px;\n}\n\n.auth-remote-field input {\n box-sizing: border-box;\n width: 100%;\n max-width: 420px;\n min-width: 0;\n height: 32px;\n padding: 0 10px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-md, 8px);\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n}\n\n.auth-remote-field input:focus {\n outline: none;\n border-color: var(--dsw-alias-state-business-primary);\n}\n\n.auth-remote-button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n max-width: 100%;\n padding: 6px 14px;\n border: 0.5px solid var(--dsw-alias-border-l3);\n border-radius: var(--dsw-radius-md, 18px);\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n cursor: pointer;\n}\n\n.auth-remote-button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.auth-remote-button[aria-pressed='true'] {\n background: var(--dsw-alias-bg-module-platform);\n border-color: var(--dsw-static-neutral-bluish-400);\n}\n\n.auth-remote-primary {\n border-color: transparent;\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.auth-remote-primary:hover:not(:disabled) {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.auth-remote-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.auth-remote-button:focus-visible {\n outline: 2px solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));\n outline-offset: 2px;\n}\n\n.auth-remote-restart {\n margin-left: 8px;\n}\n\n.auth-remote-security img {\n display: block;\n max-width: 100%;\n height: auto;\n margin: 16px 0;\n border-radius: var(--dsw-radius-md, 8px);\n}\n\n.auth-remote-security code,\n.auth-remote-backup-codes {\n font-family: var(--ds-font-family-code);\n overflow-wrap: anywhere;\n user-select: all;\n}\n\n.auth-remote-backup-codes {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px 24px;\n margin: 20px 0;\n padding: 16px 16px 16px 40px;\n border-radius: var(--dsw-radius-lg, 16px);\n background: var(--dsw-alias-bg-module-platform);\n}\n\n.auth-remote-security .auth-remote-error {\n margin: 12px 0 0;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.auth-remote-error:empty {\n display: none;\n}\n";
|
|
3065
|
+
|
|
3052
3066
|
// src/client/index.ts
|
|
3053
3067
|
var name = "auth-remote";
|
|
3054
3068
|
var inject = ["connection", "slots", "locale"];
|
|
3055
3069
|
function apply(ctx) {
|
|
3056
3070
|
assertRemoteHostCapability(ctx);
|
|
3071
|
+
ctx.effect(() => {
|
|
3072
|
+
const tag = document.createElement("style");
|
|
3073
|
+
tag.dataset.plugin = "dsh-auth-remote";
|
|
3074
|
+
tag.textContent = style_default;
|
|
3075
|
+
document.head.appendChild(tag);
|
|
3076
|
+
return () => tag.remove();
|
|
3077
|
+
}, "auth-remote: settings styles");
|
|
3057
3078
|
monitorSession(ctx);
|
|
3058
3079
|
ctx.effect(() => ctx.locale.register("auth-remote", { en, zh }), "auth-remote: dictionaries");
|
|
3059
3080
|
const t = ctx.locale.bind("auth-remote");
|