mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
feat: store rdp, vnc and telnet logins in a generic per-protocol table
This commit is contained in:
1 parent
e0c30a4e6f
commit
bba06f7ff6
107 files changed
+18750
-1224
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
hostPayloadLegacy,
|
||||
normalizeImportedHost,
|
||||
userDefaultParams,
|
||||
} from "../../src/backend/host-settings.js";
|
||||
@@ -80,3 +81,38 @@ describe("userDefaultParams", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("hostPayloadLegacy", () => {
|
||||
it("puts each login back in its 2.8 flat shape for older clients", () => {
|
||||
expect(
|
||||
hostPayloadLegacy(
|
||||
{},
|
||||
{
|
||||
protocolAuth: {
|
||||
rdp: {
|
||||
authType: "direct",
|
||||
credentialId: null,
|
||||
username: "admin",
|
||||
fields: { domain: "CORP" },
|
||||
hasPassword: true,
|
||||
},
|
||||
vnc: { authType: "credential", credentialId: 4 },
|
||||
},
|
||||
},
|
||||
),
|
||||
).toEqual({
|
||||
rdpAuthType: "direct",
|
||||
rdpCredentialId: null,
|
||||
rdpUser: "admin",
|
||||
hasRdpPassword: true,
|
||||
rdpDomain: "CORP",
|
||||
domain: "CORP",
|
||||
vncAuthType: "credential",
|
||||
vncCredentialId: 4,
|
||||
});
|
||||
});
|
||||
|
||||
it("adds nothing for a host without logins", () => {
|
||||
expect(hostPayloadLegacy({}, {})).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -37,7 +37,7 @@ function target(
|
||||
authType: "direct",
|
||||
username: "admin",
|
||||
password: "secret",
|
||||
domain: "CORP",
|
||||
fields: { domain: "CORP" },
|
||||
...overrides,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user