dsh-auth-remote 0.1.7 → 0.1.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../src/http/gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAgClD,wFAAwF;AACxF,qBAAa,QAAS,YAAW,OAAO;IAEpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAJX,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,eAAe;IAG/C,KAAK,IAAI,OAAO;IAIV,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDzF,OAAO,CACX,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,MAAM,EACd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AAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AA4ED,oGAAoG;AACpG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CAgC3E;AAkDD,oFAAoF;AACpF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,cAAc,GACtB,oBAAoB,GAAG,IAAI,CAyD7B"}
@@ -0,0 +1,3 @@
1
+ /** Only exact, read-only PWA resources bypass session authentication. */
2
+ export declare function isPublicPwaAsset(method: string | undefined, pathname: string): boolean;
3
+ //# sourceMappingURL=public-assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-assets.d.ts","sourceRoot":"","sources":["../../../src/http/public-assets.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEtF"}
@@ -10,7 +10,7 @@ Install the published package into the default `web` profile:
10
10
 
11
11
  ```sh
12
12
  dsh --version
13
- dsh plugin --profile web add dsh-auth-remote@0.1.7
13
+ dsh plugin --profile web add dsh-auth-remote@0.1.8
14
14
  dsh plugin --profile web list
15
15
  dsh web --no-open --port 13090
16
16
  ```
@@ -113,6 +113,8 @@ Back up the old patch before upgrading. Replace a single item with `publicUrl: h
113
113
 
114
114
  Admission is the one effective public origin plus literal loopback authorities. The URL's root path has no deployment prefix. Requests need one valid Host; mutations and WebSocket upgrades require a matching Origin, and cross-site or mismatched Fetch Metadata is rejected. An old public origin is no longer registered after replacement. `Forwarded` and `X-Forwarded-*` never decide admission or Cookie Secure. CLI `--trusted-host` configures native Connection only and does not enlarge this outer policy.
115
115
 
116
+ Anonymous GET/HEAD requests to exactly `/manifest.webmanifest`, `/favicon.svg`, and `/favicon-dark.svg` pass through to DSH's static server without a session. These PWA metadata and icons retain the same Host, Origin, Fetch Metadata, and readiness checks; HEAD on these paths accepts an absent Origin just like GET. The sign-in page links the manifest and allows it in CSP, so browsers can read application metadata before sign-in. Business pages, APIs, other assets, other methods, and WebSocket upgrades remain protected. Browser installation also depends on the upstream manifest and the browser's own requirements.
117
+
116
118
  Plugin cookies follow the validated external origin and are host-only, HttpOnly and SameSite; HTTPS sets Secure. Native bridge credentials stay server-side and follow the native listener protocol, including HTTPS cookie audience/Secure when a public HTTP proxy fronts native HTTPS. Ports do not isolate browser cookies.
117
119
 
118
120
  Standard `/api` routes work with `preserveOriginPaths: []`; there is no need to list `/api`. The plugin always declares its finalized native bridge authority in Connection's `trustedHosts`, using the actual bound port (including `--port 0`), so downstream plugins that read this list can recognize the bridge without an extra trusted-host flag. Explicit CLI trusted hosts are merged and deduplicated; they do not expand the outer public-origin policy. Add a prefix only when a downstream route needs the original public Host. The plugin forwards an Origin only when the request supplied one, and preflights and declares the selected public authority for preserved paths. No separate Connection row is needed. Ordinary alpha.2 routes use the normalized native bind authority; older Connection retains its internal HTTP loopback bridge. Both paths still require a full session. Revocation, Connection loss or storage failure closes active uploads, streams and upgrades and withdraws business admission. Readiness does not mean the account is initialized.
@@ -10,7 +10,7 @@
10
10
 
11
11
  ```sh
12
12
  dsh --version
13
- dsh plugin --profile web add dsh-auth-remote@0.1.7
13
+ dsh plugin --profile web add dsh-auth-remote@0.1.8
14
14
  dsh plugin --profile web list
15
15
  dsh web --no-open --port 13090
16
16
  ```
@@ -113,6 +113,8 @@ alpha.2 的 IPv6 回环 HTTPS 可合并以下完整认证条目,使用自己
113
113
 
114
114
  准入为唯一生效公开来源加字面回环 authority;URL 根路径不支持部署前缀。请求须有唯一合法 Host,修改请求和 WebSocket 升级须有匹配 Origin;跨站或不匹配 Fetch Metadata 被拒绝。替换后旧公开来源不再登记。`Forwarded`、`X-Forwarded-*` 不决定准入或 Cookie Secure;CLI `--trusted-host` 只配置原生 Connection,不扩大外层策略。
115
115
 
116
+ 匿名 GET/HEAD 请求仅在精确匹配 `/manifest.webmanifest`、`/favicon.svg`、`/favicon-dark.svg` 时,无需会话即可交给 DSH 静态服务处理。这些 PWA 元数据与图标仍受 Host、Origin、Fetch Metadata 和就绪检查约束;这些路径的 HEAD 与 GET 一样允许缺少 Origin。登录页引用 manifest 并在 CSP 中允许加载,浏览器可在登录前读取应用信息。业务页面、API、其他资源、其他方法和 WebSocket 升级仍受鉴权保护;实际安装还取决于上游 manifest 与浏览器自身条件。
117
+
116
118
  插件 Cookie 跟随已验证外部来源,限主机、HttpOnly、SameSite,HTTPS 设置 Secure。原生桥接凭据仅保留服务端,跟随原生监听协议;公开 HTTP 代理接入原生 HTTPS 时,其原生 Cookie audience/Secure 仍按 HTTPS。浏览器 Cookie 不通过端口隔离。
117
119
 
118
120
  标准 `/api` 路由在 `preserveOriginPaths: []` 下即可工作,无需列 `/api`。插件始终将定稿的原生桥接 authority 登记到 Connection 的 `trustedHosts`,使用实际绑定端口(包含 `--port 0`),读取该列表的下游插件无需额外 trusted-host 参数即可识别桥接地址。显式 CLI trusted hosts 合并去重,不扩大外层公开来源策略。仅在下游需要原始公网 Host 时加入前缀;Origin 仅在请求已有时透传,保留路径预检并登记所选公开 authority。无需单独 Connection 条目。alpha.2 普通路径使用归一化原生 bind authority,旧 Connection 保留内部 HTTP 回环桥接;两类路径均需完整会话。撤销、Connection 丢失或存储故障会关闭活跃上传、流和升级连接,撤回业务准入。ready 不表示账号已初始化。
@@ -14,7 +14,7 @@ pnpm pack:local
14
14
  pnpm smoke
15
15
  ```
16
16
 
17
- `pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.1.7.tgz` after static checks; it does not publish. `pnpm smoke` installs that archive into an isolated DSH home, starts the pinned DSH runtime briefly, checks readiness, anonymous redirection/denial and an online CLI status, then stops it.
17
+ `pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.1.8.tgz` after static checks; it does not publish. `pnpm smoke` installs that archive into an isolated DSH home, starts the pinned DSH runtime briefly, checks readiness, anonymous redirection/denial and an online CLI status, then stops it.
18
18
 
19
19
  ## Use the isolated development profile
20
20
 
@@ -16,7 +16,7 @@ pnpm pack:local
16
16
  pnpm smoke
17
17
  ```
18
18
 
19
- `pnpm check` 依次执行类型、格式、构建、包/部署/文档检查,以及单元、集成、CLI 和浏览器测试。`pnpm pack:local` 在静态检查后写出 `artifacts/dsh-auth-remote-0.1.7.tgz`,不会发布。`pnpm smoke` 将包安装到隔离 DSH_HOME,短暂启动固定版本的 DSH,验证就绪、匿名重定向/拒绝和在线 CLI 状态,然后停止。
19
+ `pnpm check` 依次执行类型、格式、构建、包/部署/文档检查,以及单元、集成、CLI 和浏览器测试。`pnpm pack:local` 在静态检查后写出 `artifacts/dsh-auth-remote-0.1.8.tgz`,不会发布。`pnpm smoke` 将包安装到隔离 DSH_HOME,短暂启动固定版本的 DSH,验证就绪、匿名重定向/拒绝和在线 CLI 状态,然后停止。
20
20
 
21
21
  ## 使用隔离开发 profile
22
22
 
package/docs/releasing.md CHANGED
@@ -29,18 +29,18 @@ Use the version that is already on `master`:
29
29
  ```sh
30
30
  git switch master
31
31
  git pull --ff-only origin master
32
- git tag -a v0.1.7 -m "Release v0.1.7"
33
- git push origin v0.1.7
32
+ git tag -a v0.1.8 -m "Release v0.1.8"
33
+ git push origin v0.1.8
34
34
  ```
35
35
 
36
- Replace `0.1.7` in these commands with the intended version. The tag must point to a commit reachable from `master`. A mismatched tag, missing changelog entry, failed test, or mismatched existing npm archive stops the release.
36
+ Replace `0.1.8` in these commands with the intended version. The tag must point to a commit reachable from `master`. A mismatched tag, missing changelog entry, failed test, or mismatched existing npm archive stops the release.
37
37
 
38
38
  After the workflow completes, confirm the run, GitHub Release, and npm version:
39
39
 
40
40
  ```sh
41
41
  gh run list --workflow release.yml --limit 5
42
- gh release view v0.1.7
43
- npm view dsh-auth-remote@0.1.7 version dist.integrity
42
+ gh release view v0.1.8
43
+ npm view dsh-auth-remote@0.1.8 version dist.integrity
44
44
  ```
45
45
 
46
46
  The GitHub Release includes the `.tgz` and `SHA256SUMS`. Download them into the same directory and run `sha256sum -c SHA256SUMS` there to check the release asset. A failed workflow should be inspected in **Actions → Release** before retrying; npm versions are immutable, so the workflow only skips an existing version when its archive bytes match.
@@ -29,18 +29,18 @@ pnpm smoke:packed
29
29
  ```sh
30
30
  git switch master
31
31
  git pull --ff-only origin master
32
- git tag -a v0.1.7 -m "Release v0.1.7"
33
- git push origin v0.1.7
32
+ git tag -a v0.1.8 -m "Release v0.1.8"
33
+ git push origin v0.1.8
34
34
  ```
35
35
 
36
- 执行时把 `0.1.7` 换成目标版本。标签必须指向 `master` 可达的提交。标签版本不匹配、缺少更新日志条目、测试失败,或 npm 现存版本与本次压缩包字节不同,都会阻止发布。
36
+ 执行时把 `0.1.8` 换成目标版本。标签必须指向 `master` 可达的提交。标签版本不匹配、缺少更新日志条目、测试失败,或 npm 现存版本与本次压缩包字节不同,都会阻止发布。
37
37
 
38
38
  工作流结束后检查运行状态、GitHub Release 和 npm 版本:
39
39
 
40
40
  ```sh
41
41
  gh run list --workflow release.yml --limit 5
42
- gh release view v0.1.7
43
- npm view dsh-auth-remote@0.1.7 version dist.integrity
42
+ gh release view v0.1.8
43
+ npm view dsh-auth-remote@0.1.8 version dist.integrity
44
44
  ```
45
45
 
46
46
  GitHub Release 包含 `.tgz` 和 `SHA256SUMS`。把两者下载到同一个目录,在该目录运行 `sha256sum -c SHA256SUMS` 验证附件。工作流失败时先查看 **Actions → Release** 再重试;npm 版本不可覆盖,因此只有现存版本的压缩包字节与本次构建一致时,工作流才会跳过重复发布。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-auth-remote",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Single-user remote authentication for DeepSeek Harness: password, TOTP and revocable sessions.",
5
5
  "license": "MIT",
6
6
  "repository": {