fix(plugins): trust official signing keys for offline installation
This commit is contained in:
5 files changed
+146
-9
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user