mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
fix: harden the plugin runtime after the 2.9.0 security review
This commit is contained in:
1 parent
2961297989
commit
c6a44b7ff3
69 files changed
+4613
-312
No files matched your search
@@ -271,20 +271,25 @@ describe("withHostPluginSettings", () => {
|
||||
});
|
||||
|
||||
describe("writeHostPluginSettings", () => {
|
||||
it("JSON-stringifies each value under the plugin's own namespace", async () => {
|
||||
await writeHostPluginSettings("docker", 7, {
|
||||
it("writes each value through the settings service, under the plugin's own namespace", async () => {
|
||||
await writeHostPluginSettings(DOCKER, 7, {
|
||||
enableDocker: true,
|
||||
socketPath: null,
|
||||
socketPath: "/var/run/docker.sock",
|
||||
});
|
||||
|
||||
expect(setCalls).toEqual([
|
||||
["docker", "host", "7", "enableDocker", "true"],
|
||||
["docker", "host", "7", "socketPath", "null"],
|
||||
["docker", "host", "7", "socketPath", '"/var/run/docker.sock"'],
|
||||
]);
|
||||
});
|
||||
|
||||
it("refuses a key the manifest does not declare", async () => {
|
||||
await writeHostPluginSettings(DOCKER, 7, { injected: "x" });
|
||||
expect(setCalls).toEqual([]);
|
||||
});
|
||||
|
||||
it("skips a field whose value is undefined", async () => {
|
||||
await writeHostPluginSettings("docker", 7, {
|
||||
await writeHostPluginSettings(DOCKER, 7, {
|
||||
enableDocker: true,
|
||||
socketPath: undefined,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user