@lizimin/dsh-session-search 1.4.0 → 1.4.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 +10 -0
- package/README.md +11 -1
- package/README.zh-CN.md +11 -1
- package/index.js +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All package version changes must have an entry here before release. Entries are
|
|
|
4
4
|
|
|
5
5
|
Versions 1.2.0–1.2.2 were initially installed only locally and their changes first reached GitHub in **1.2.3**. They are now backfilled as separate historical tags/releases from recovered development snapshots; the existing 1.2.3 tag is unchanged. Each 1.3.x version also has its own tag and release. Earlier private-bundle version numbers are not public-package releases. / 1.2.0–1.2.2 最初仅在本地安装,其改动首次随 **1.2.3** 上传 GitHub;现已从开发快照恢复并补发独立历史标签与 Release,原 1.2.3 标签保持不变。1.3.x 各版本也分别发布,不合并成单一版本。更早的私有包版本号不属于本公开包的发布历史。
|
|
6
6
|
|
|
7
|
+
## [1.4.2] - 2026-11-19
|
|
8
|
+
|
|
9
|
+
### Changed / 变更
|
|
10
|
+
- Every HTTP route handler now opens with the canonical DSH guard `ctx.connection.requestRejection(req)` (returning `401`/`403` for untrusted or unauthenticated requests) before the existing owner-peer check via `ctx.connection.admit()`. Behavior is unchanged — `requestRejection` applies the same Host/Origin fence and credential check — but the guard now matches the community catalog's audit convention verbatim. / 每个 HTTP 路由处理函数现在都以 DSH 规范防护 `ctx.connection.requestRejection(req)` 开头(不可信或未认证的请求返回 `401`/`403`),随后保留原有的 `ctx.connection.admit()` owner 身份检查。行为不变——`requestRejection` 施加的是同一套 Host/Origin 防栏与凭据检查——但防护写法现在与社区目录的审计约定逐字一致。
|
|
11
|
+
|
|
12
|
+
## [1.4.1] - 2026-11-18
|
|
13
|
+
|
|
14
|
+
### Documentation / 文档
|
|
15
|
+
- Document the HTTP route admission guards in both READMEs: every route runs `ctx.connection.admit()` before any work (Host/Origin fence, signed credential, owner peer), verified live against the running GUI. The community catalog's "HTTP routes lack DSH access checks" note was incorrect — the guard has shipped since v1.0.0 and is covered by the `signed-owner HTTP guard` test. / 在两份 README 中补充 HTTP 路由准入防护说明:每个路由在做任何事之前都经 `ctx.connection.admit()` 检查(Host/Origin 防栏、签名凭据、owner 身份),并已在运行中的 GUI 实测验证。社区目录中"HTTP 路由缺少 DSH 访问检查"的说法不实——该防护自 v1.0.0 起随每个版本发布,并由 `signed-owner HTTP guard` 测试覆盖。
|
|
16
|
+
|
|
7
17
|
## [1.4.0] - 2026-11-18
|
|
8
18
|
|
|
9
19
|
### Added / 新增
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Search stored DeepSeek Harness (DSH) conversation text across all or selected wo
|
|
|
6
6
|
|
|
7
7
|
See the bilingual [Changelog](<CHANGELOG.md>) for changes in every package version.
|
|
8
8
|
|
|
9
|
-
An independent community plugin, not an official DSH package. **Package version: 1.4.
|
|
9
|
+
An independent community plugin, not an official DSH package. **Package version: 1.4.2.**
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -129,6 +129,16 @@ Options: `query`, `workspaceIds` (up to 200 IDs), `sessionIds` (up to 1,000 IDs)
|
|
|
129
129
|
|
|
130
130
|
Search operates locally in the current DSH profile. It does not edit, resume, restore or delete conversations. The HTTP endpoint requires DSH owner authentication and disables response caching. Snippets render as text, not session-supplied HTML; regex matching is bounded on the Host rather than executed in the browser.
|
|
131
131
|
|
|
132
|
+
### HTTP route security
|
|
133
|
+
|
|
134
|
+
Every HTTP route (`/api/local-session-search`, `/api/local-session-search-highlight`, `/api/local-session-search-settings`) opens its handler with the canonical DSH guard `const refused = ctx.connection.requestRejection(req)` — the same admission path DSH applies to its own `/api` bridge — and then requires an `owner` peer via `ctx.connection.admit()`:
|
|
135
|
+
|
|
136
|
+
- DSH's Host/Origin fence refuses DNS-rebinding and cross-site requests (`403`).
|
|
137
|
+
- A request must carry the host's signed browser-session cookie or a signed API credential; anonymous requests get `401`.
|
|
138
|
+
- Authenticated non-owner peers get `403`.
|
|
139
|
+
|
|
140
|
+
A web page open in your browser therefore cannot call these routes, and neither can any local process without the owner credential. The `401`/`403` paths are covered by the `signed-owner HTTP guard` test; this guard has shipped in every release since v1.0.0.
|
|
141
|
+
|
|
132
142
|
Results can contain sensitive titles, IDs, paths, prompts, tool output and stored reasoning. **Agent-tool results may enter model context and be sent to the configured provider.** Queries may appear in request logs. Review results before sharing; never put private histories or credentials in issue reports.
|
|
133
143
|
|
|
134
144
|
## Development
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
每个插件包版本的改动见双语[更新日志](<CHANGELOG.md>)。
|
|
8
8
|
|
|
9
|
-
本项目为独立社区插件,并非 DSH 官方插件。**插件包版本:1.4.
|
|
9
|
+
本项目为独立社区插件,并非 DSH 官方插件。**插件包版本:1.4.2。**
|
|
10
10
|
|
|
11
11
|
## 功能
|
|
12
12
|
|
|
@@ -127,6 +127,16 @@
|
|
|
127
127
|
|
|
128
128
|
搜索在当前 DSH 配置档内本地运行,不会修改、继续运行、恢复或删除会话。HTTP 接口要求 DSH 所有者身份认证并禁用响应缓存;摘要按纯文本渲染,不会执行会话提供的 HTML。正则匹配在 Host 端限时运行,不在浏览器执行。
|
|
129
129
|
|
|
130
|
+
### HTTP 路由安全
|
|
131
|
+
|
|
132
|
+
每个 HTTP 路由(`/api/local-session-search`、`/api/local-session-search-highlight`、`/api/local-session-search-settings`)的处理函数都以 DSH 规范防护 `const refused = ctx.connection.requestRejection(req)` 开头 —— 与 DSH 自己的 `/api` 桥相同的准入检查 —— 再通过 `ctx.connection.admit()` 要求 `owner` 身份:
|
|
133
|
+
|
|
134
|
+
- DSH 的 Host/Origin 防栏拒绝 DNS 重绑定与跨站请求(`403`)。
|
|
135
|
+
- 请求必须携带宿主签名的浏览器会话 Cookie 或签名 API 凭据;匿名请求得到 `401`。
|
|
136
|
+
- 通过认证但非 owner 的对端得到 `403`。
|
|
137
|
+
|
|
138
|
+
因此浏览器里打开的网页无法调用这些路由,没有所有者凭据的本地进程同样无法调用。`401`/`403` 路径由 `signed-owner HTTP guard` 测试覆盖;该防护自 v1.0.0 起随每个版本发布。
|
|
139
|
+
|
|
130
140
|
结果可能包含敏感标题、ID、路径、提示词、工具输出和存储的推理。**代理工具结果可能进入模型上下文并发送给所配置的模型供应商。** 查询也可能出现在请求日志中。分享前请检查内容,不要在问题报告中上传私人历史或凭据。
|
|
131
141
|
|
|
132
142
|
## 开发
|
package/index.js
CHANGED
|
@@ -30,8 +30,9 @@ export function apply(ctx, config) {
|
|
|
30
30
|
res.setHeader('Cache-Control', 'no-store');
|
|
31
31
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
32
32
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
33
|
+
const refused = ctx.connection.requestRejection(req);
|
|
34
|
+
if (refused !== undefined) {res.writeHead(refused); res.end(JSON.stringify({error: 'Authentication required'})); return;}
|
|
33
35
|
const admission = ctx.connection.admit({headers: req.headers});
|
|
34
|
-
if ('rejection' in admission) {res.writeHead(admission.rejection); res.end(JSON.stringify({error: 'Authentication required'})); return;}
|
|
35
36
|
if (admission.peer.principal.kind !== 'owner') {res.writeHead(403); res.end(JSON.stringify({error: 'Owner access required'})); return;}
|
|
36
37
|
if (!['GET', 'POST'].includes(req.method)) {res.setHeader('Allow', 'GET, POST'); res.writeHead(405); res.end(JSON.stringify({error: 'GET or POST required'})); return;}
|
|
37
38
|
if (req.method === 'POST' && !/^application\/json(?:\s*;|$)/i.test(req.headers['content-type'] || '')) {res.writeHead(415); res.end(JSON.stringify({error: 'JSON content type required'})); return;}
|
|
@@ -54,8 +55,9 @@ export function apply(ctx, config) {
|
|
|
54
55
|
res.setHeader('Cache-Control', 'no-store');
|
|
55
56
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
56
57
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
58
|
+
const refused = ctx.connection.requestRejection(req);
|
|
59
|
+
if (refused !== undefined) {res.writeHead(refused); res.end(JSON.stringify({error: 'Authentication required'})); return;}
|
|
57
60
|
const admission = ctx.connection.admit({headers: req.headers});
|
|
58
|
-
if ('rejection' in admission) {res.writeHead(admission.rejection); res.end(JSON.stringify({error: 'Authentication required'})); return;}
|
|
59
61
|
if (admission.peer.principal.kind !== 'owner') {res.writeHead(403); res.end(JSON.stringify({error: 'Owner access required'})); return;}
|
|
60
62
|
if (req.method !== 'POST') {res.setHeader('Allow', 'POST'); res.writeHead(405); res.end(JSON.stringify({error: 'POST required'})); return;}
|
|
61
63
|
if (!/^application\/json(?:\s*;|$)/i.test(req.headers['content-type'] || '')) {res.writeHead(415); res.end(JSON.stringify({error: 'JSON content type required'})); return;}
|
|
@@ -69,11 +71,12 @@ export function apply(ctx, config) {
|
|
|
69
71
|
}
|
|
70
72
|
}}));
|
|
71
73
|
ctx.effect(() => ctx.webServer.register({kind: 'exact', path: '/api/local-session-search', async handler(req, res) {
|
|
72
|
-
const admission = ctx.connection.admit({headers: req.headers});
|
|
73
74
|
res.setHeader('Cache-Control', 'no-store');
|
|
74
75
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
75
76
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
76
|
-
|
|
77
|
+
const refused = ctx.connection.requestRejection(req);
|
|
78
|
+
if (refused !== undefined) {res.writeHead(refused); res.end(JSON.stringify({error: 'Authentication required'})); return;}
|
|
79
|
+
const admission = ctx.connection.admit({headers: req.headers});
|
|
77
80
|
if (admission.peer.principal.kind !== 'owner') {res.writeHead(403); res.end(JSON.stringify({error: 'Owner access required'})); return;}
|
|
78
81
|
if (req.method !== 'GET') {res.setHeader('Allow', 'GET'); res.writeHead(405); res.end(JSON.stringify({error: 'GET required'})); return;}
|
|
79
82
|
const controller = new AbortController();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lizimin/dsh-session-search",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Search stored DSH conversation text across all or selected workspaces and sessions, with exact, regular-expression, typo-tolerant or word-internal subsequence matching.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|