@lizimin/dsh-session-search 1.4.1 → 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 +5 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/index.js +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ 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
|
+
|
|
7
12
|
## [1.4.1] - 2026-11-18
|
|
8
13
|
|
|
9
14
|
### Documentation / 文档
|
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
|
|
|
@@ -131,7 +131,7 @@ Search operates locally in the current DSH profile. It does not edit, resume, re
|
|
|
131
131
|
|
|
132
132
|
### HTTP route security
|
|
133
133
|
|
|
134
|
-
Every HTTP route (`/api/local-session-search`, `/api/local-session-search-highlight`, `/api/local-session-search-settings`)
|
|
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
135
|
|
|
136
136
|
- DSH's Host/Origin fence refuses DNS-rebinding and cross-site requests (`403`).
|
|
137
137
|
- A request must carry the host's signed browser-session cookie or a signed API credential; anonymous requests get `401`.
|
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
|
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
|
|
130
130
|
### HTTP 路由安全
|
|
131
131
|
|
|
132
|
-
每个 HTTP 路由(`/api/local-session-search`、`/api/local-session-search-highlight`、`/api/local-session-search-settings
|
|
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
133
|
|
|
134
134
|
- DSH 的 Host/Origin 防栏拒绝 DNS 重绑定与跨站请求(`403`)。
|
|
135
135
|
- 请求必须携带宿主签名的浏览器会话 Cookie 或签名 API 凭据;匿名请求得到 `401`。
|
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",
|