mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-25 21:51:12 +00:00
* fix(migrate): update Hermes importer contracts * refactor(migrate): split Hermes importer modules * fix(migrate): remove duplicate MCP helper * docs(plugin-sdk): refresh migration API baseline * chore(migrate): keep release note in PR
29 lines
956 B
TypeScript
29 lines
956 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
createMigrationConfigPatchItem,
|
|
redactMigrationPlan,
|
|
summarizeMigrationItems,
|
|
} from "./migration.js";
|
|
|
|
describe("migration sensitive value redaction", () => {
|
|
it("masks positional values inside sensitive config items", () => {
|
|
const item = createMigrationConfigPatchItem({
|
|
id: "config:mcp-positional-value",
|
|
target: "mcp.servers.example",
|
|
path: ["mcp", "servers"],
|
|
value: { example: { command: "server", args: ["--value", "opaque-positional-placeholder"] } },
|
|
message: "Import MCP server.",
|
|
sensitive: true,
|
|
});
|
|
const redacted = redactMigrationPlan({
|
|
providerId: "hermes",
|
|
source: "fixture",
|
|
summary: summarizeMigrationItems([item]),
|
|
items: [item],
|
|
});
|
|
|
|
expect(JSON.stringify(redacted)).not.toContain("opaque-positional-placeholder");
|
|
expect(redacted.items[0]?.details?.value).toBe("[redacted]");
|
|
});
|
|
});
|