dsh-auth-remote 0.1.6 → 0.1.7

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 CHANGED
@@ -8,6 +8,11 @@ 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.7 - 2026-10-10
12
+
13
+ - Automatically declare the finalized native bridge authority in Connection's trusted hosts, fixing downstream plugin POST rejection when a concrete listener address was not explicitly trusted. Use the actual bound port and retain the legacy loopback bridge.
14
+ - Merge and deduplicate explicit CLI trusted hosts and public authorities required by preserved paths, while retaining the outer public-origin and session checks.
15
+
11
16
  ## 0.1.6 - 2026-10-10
12
17
 
13
18
  - Use DSH 0.2.1-alpha.2 for development and default verification, repair native WebServer/Connection composition, and retain all six declared releases in the CLI, smoke and browser CI matrix.
@@ -8,6 +8,11 @@
8
8
 
9
9
  暂无记录。
10
10
 
11
+ ## 0.1.7 - 2026-10-10
12
+
13
+ - 自动将定稿的原生桥接 authority 登记到 Connection 的 trusted hosts,修复具体监听地址未显式登记时下游插件 POST 被拒绝的问题;使用实际绑定端口,并保留旧版回环桥接。
14
+ - 合并去重显式 CLI trusted hosts 与保留路径所需的公开 authority,外层公开来源和会话校验继续生效。
15
+
11
16
  ## 0.1.6 - 2026-10-10
12
17
 
13
18
  - 开发与默认验证运行时升级为 DSH 0.2.1-alpha.2,修复原生 WebServer/Connection 组合,CLI、smoke 和浏览器 CI 矩阵保留六个声明版本。
package/README.md CHANGED
@@ -30,11 +30,11 @@ With DSH installed, verify its version and install the published plugin into the
30
30
 
31
31
  ```sh
32
32
  dsh --version
33
- dsh plugin --profile web add dsh-auth-remote@0.1.6
33
+ dsh plugin --profile web add dsh-auth-remote@0.1.7
34
34
  dsh plugin --profile web list
35
35
  ```
36
36
 
37
- Check that `dsh --version` prints `0.2.1-alpha.2` (or another compatible release above) and the plugin list includes `dsh-auth-remote@0.1.6`. These commands use DSH's default data directory. For source builds and an isolated development runtime, see the [development guide](docs/development.md).
37
+ Check that `dsh --version` prints `0.2.1-alpha.2` (or another compatible release above) and the plugin list includes `dsh-auth-remote@0.1.7`. These commands use DSH's default data directory. For source builds and an isolated development runtime, see the [development guide](docs/development.md).
38
38
 
39
39
  ## Configure the web profile
40
40
 
@@ -42,7 +42,7 @@ The minimal setup needs no profile patch. Start with `dsh web --no-open --port 1
42
42
 
43
43
  For a public HTTPS entry, use the [deployment guide](docs/deployment.md) and [profile example](examples/web-profile-auth-remote.patch.yml), with top-level `publicUrl: https://dsh.example.com/`, `host` and `port`. Alpha.2 also supports concrete IPv6 and paired top-level `tlsCert`/`tlsKey`. The URL must be an HTTP(S) root, with no credentials, child path, query or fragment. One public origin plus literal loopback is admitted. Setting a URL does not configure proxy routing or TLS.
44
44
 
45
- If a downstream route needs the original public Host, add its path to `preserveOriginPaths`. Native Connection trust follows the final public origin; no extra `--trusted-host` or Connection row is needed. CLI host/port and public URL override file values; TLS overrides as one complete pair. See the [migration and path rules](docs/deployment.md#configuration-priority-and-path-bases) before upgrading `allowedOrigins`: zero or one item is migrated in memory with a warning, multiple items and any explicit coexistence with `publicUrl` fail.
45
+ The plugin automatically declares its finalized native bridge authority in Connection's `trustedHosts`, so downstream plugins can recognize a concrete listener without an extra `--trusted-host`. If a downstream route needs the original public Host, add its path to `preserveOriginPaths`; the final public authority is then declared as well. Explicit CLI trusted hosts are retained, while the outer public-origin and sign-in checks still apply. CLI host/port and public URL override file values; TLS overrides as one complete pair. See the [migration and path rules](docs/deployment.md#configuration-priority-and-path-bases) before upgrading `allowedOrigins`: zero or one item is migrated in memory with a warning, multiple items and any explicit coexistence with `publicUrl` fail.
46
46
 
47
47
  ## Initialize the account
48
48
 
package/README.zh-CN.md CHANGED
@@ -30,11 +30,11 @@ DeepSeek Harness(DSH)的单用户远程登录插件,提供密码、TOTP、
30
30
 
31
31
  ```sh
32
32
  dsh --version
33
- dsh plugin --profile web add dsh-auth-remote@0.1.6
33
+ dsh plugin --profile web add dsh-auth-remote@0.1.7
34
34
  dsh plugin --profile web list
35
35
  ```
36
36
 
37
- 确认 `dsh --version` 输出 `0.2.1-alpha.2`(或上文其他兼容版本),且插件列表中有 `dsh-auth-remote@0.1.6`。这些命令使用 DSH 默认数据目录。源码构建及隔离开发运行时参见[开发指南](docs/development.zh-CN.md)。
37
+ 确认 `dsh --version` 输出 `0.2.1-alpha.2`(或上文其他兼容版本),且插件列表中有 `dsh-auth-remote@0.1.7`。这些命令使用 DSH 默认数据目录。源码构建及隔离开发运行时参见[开发指南](docs/development.zh-CN.md)。
38
38
 
39
39
  ## 配置 web profile
40
40
 
@@ -42,7 +42,7 @@ dsh plugin --profile web list
42
42
 
43
43
  公网 HTTPS 入口请使用[部署指南](docs/deployment.zh-CN.md)和 [profile 示例](examples/web-profile-auth-remote.patch.yml),设置顶层 `publicUrl: https://dsh.example.com/`、`host`、`port`。alpha.2 还支持具体 IPv6 和成对的顶层 `tlsCert`/`tlsKey`。URL 必须是 HTTP(S) 根地址,不能带凭据、子路径、查询或片段。准入范围是唯一公开来源加字面回环。配置 URL 不会配置代理路由或 TLS。
44
44
 
45
- 下游路由若需要原始公网 Host,可把路径加入 `preserveOriginPaths`。原生 Connection 信任来自最终公开来源,无需额外 `--trusted-host` 或 Connection 条目。CLI 的 host/port 和公开 URL 覆盖文件值;TLS 按完整一对覆盖。升级 `allowedOrigins` 前阅读[迁移和路径规则](docs/deployment.zh-CN.md#配置优先级与路径基准):零项或单项在内存迁移并告警,多项及任意显式新旧字段共存报错。
45
+ 插件自动将定稿的原生桥接 authority 登记到 Connection 的 `trustedHosts`,下游插件无需额外 `--trusted-host` 即可识别具体监听地址。下游路由若需要原始公网 Host,可把路径加入 `preserveOriginPaths`,此时也自动登记最终公开 authority。显式 CLI trusted hosts 继续保留,外层公开来源与登录校验仍然生效。CLI 的 host/port 和公开 URL 覆盖文件值;TLS 按完整一对覆盖。升级 `allowedOrigins` 前阅读[迁移和路径规则](docs/deployment.zh-CN.md#配置优先级与路径基准):零项或单项在内存迁移并告警,多项及任意显式新旧字段共存报错。
46
46
 
47
47
  ## 初始化账号
48
48
 
package/cordis.patch.yml CHANGED
@@ -24,12 +24,12 @@
24
24
  sessionHours: 168
25
25
  preserveOriginPaths: []
26
26
 
27
- # Connection starts after the authenticated listener and receives public
28
- # authorities only when a preserved path needs the original browser Host.
27
+ # Connection starts after the authenticated listener and receives its finalized
28
+ # bridge authority, plus public authorities needed by preserved paths and CLI trust.
29
29
  - id: connection
30
30
  inject: [webStartup, webServer]
31
31
  config:
32
- trustedHosts: !!js '[...ctx.webStartup.trustedHosts, ...ctx.webServer.connectionTrustedHosts]'
32
+ trustedHosts: !!js '[...new Set([...ctx.webStartup.trustedHosts, ...ctx.webServer.connectionTrustedHosts])]'
33
33
 
34
34
  # Reuse the official browser directory picker.
35
35
  - id: directory-picker
package/dist/index.js CHANGED
@@ -2635,10 +2635,12 @@ var AuthRemoteWebServer = class extends GuardedWebServer {
2635
2635
  if (!this.authService) throw new Error("dsh-auth-remote: authentication is not initialized");
2636
2636
  return this.authService;
2637
2637
  }
2638
- /** Public authorities needed by native Connection for preserved routes. */
2638
+ /** Declare the finalized bridge and any public authorities used by preserved routes. */
2639
2639
  get connectionTrustedHosts() {
2640
- if (this.resolved.preserveOriginPaths.length === 0) return [];
2641
- return this.resolved.originPolicy.registeredOrigins.map((entry) => entry.host);
2640
+ const hosts = [this.resolved.nativeAuthority];
2641
+ if (this.resolved.preserveOriginPaths.length > 0)
2642
+ hosts.push(...this.resolved.originPolicy.registeredOrigins.map((entry) => entry.host));
2643
+ return [...new Set(hosts)];
2642
2644
  }
2643
2645
  };
2644
2646
  var src_default = AuthRemoteWebServer;