fix(plugins): trust official signing keys for offline installation

This commit is contained in:
t8y2 committed 2026-09-17 18:03:47 +08:00
1 parent 65b820e6a9
commit fb25a66d7a
5 files changed
+146 -9

No files matched your search

+20
View File
@@ -454,6 +454,26 @@ describe("backend error translation", () => {
expect(translateBackendError(t, error, "ClickHouse error: table analytics.events does not exist")).toBe(`${t("backendErrors.legacy")}\n\nClickHouse error: table analytics.events does not exist`);
});
test("renders plugin signature failures without exposing the JSON error envelope", () => {
const detail = "Plugin package is signed by untrusted key 'dbx-store-release-2026'";
const error = JSON.stringify({
version: 1,
code: "DBX-LEGACY-0001",
messageKey: "backendErrors.legacy",
messageParams: {},
source: "legacyBackend",
origin: { subsystem: "backend", adapter: "legacy" },
operationOutcome: "unknown",
detail,
});
for (const locale of ["zh-CN", "en"] as const) {
const t = translatorFor(locale);
expect(translateBackendError(t, error)).toBe(`${t("backendErrors.legacy")}\n\n${detail}`);
expect(translateBackendError(t, new Error(error))).toBe(`${t("backendErrors.legacy")}\n\n${detail}`);
}
});
test("does not append the generic transport fallback to a structured error", () => {
const t = translatorFor("zh-CN");
const error = {