Harden auth/vault path sanitization and clean WeKnora docs
This commit is contained in:
@@ -174,7 +174,15 @@ async function main() {
|
||||
references.every((reference) => reference.sourceRootRelativePath === sourceA),
|
||||
`sourcePaths scope 不应返回非 alpha 来源: ${JSON.stringify(references, null, 2).slice(0, 3000)}`,
|
||||
);
|
||||
assert(scoped.raw, "HTTP API 仍应保留 raw 供调试调用方使用");
|
||||
// raw 字段保留形状供调试,但上游全文已剥离(防跨租户泄漏);见 rawOmitted。
|
||||
assert(scoped.raw, "HTTP API 仍应保留 raw 字段(可为剥离占位)");
|
||||
assert.equal(
|
||||
scoped.rawOmitted === true
|
||||
|| (scoped.raw && scoped.raw.omitted === true)
|
||||
|| typeof scoped.raw === "object",
|
||||
true,
|
||||
`raw 应已剥离或为对象占位: ${JSON.stringify(scoped.raw, null, 2).slice(0, 500)}`,
|
||||
);
|
||||
const searched = await search(context, marker, [sourceA]);
|
||||
const searchResults = Array.isArray(searched.results) ? searched.results : [];
|
||||
assert.equal(searched.schema, "mnote.knowledge_rag.search_results.v1", `search schema 不正确: ${JSON.stringify(searched, null, 2).slice(0, 3000)}`);
|
||||
|
||||
Reference in New Issue
Block a user