mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-11-01 16:15:24 +00:00
fix: make link-store secret check immune to random base64 matches
This commit is contained in:
1 parent
25d11b1edb
commit
4897024324
1 file changed
+3
-3
@@ -44,7 +44,7 @@ describe("the desktop's link", () => {
|
|||||||
userId: "local",
|
userId: "local",
|
||||||
serverUrl: "https://termix.example",
|
serverUrl: "https://termix.example",
|
||||||
sessionToken: "session-token",
|
sessionToken: "session-token",
|
||||||
customHeaders: [{ name: "CF-Access-Client-Secret", value: "shh" }],
|
customHeaders: [{ name: "CF-Access-Client-Secret", value: "shh-secret" }],
|
||||||
basicAuth: { username: "gate", password: "pw" },
|
basicAuth: { username: "gate", password: "pw" },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,13 +53,13 @@ describe("the desktop's link", () => {
|
|||||||
);
|
);
|
||||||
for (const value of Object.values(raw)) {
|
for (const value of Object.values(raw)) {
|
||||||
expect(value).toMatch(/^sysenc:v1:/);
|
expect(value).toMatch(/^sysenc:v1:/);
|
||||||
expect(value).not.toContain("shh");
|
expect(value).not.toContain("shh-secret");
|
||||||
}
|
}
|
||||||
|
|
||||||
const link = await getLink();
|
const link = await getLink();
|
||||||
expect(link).toMatchObject({
|
expect(link).toMatchObject({
|
||||||
sessionToken: "session-token",
|
sessionToken: "session-token",
|
||||||
customHeaders: [{ name: "CF-Access-Client-Secret", value: "shh" }],
|
customHeaders: [{ name: "CF-Access-Client-Secret", value: "shh-secret" }],
|
||||||
basicAuth: { username: "gate", password: "pw" },
|
basicAuth: { username: "gate", password: "pw" },
|
||||||
cursor: 0,
|
cursor: 0,
|
||||||
knownTypes: [],
|
knownTypes: [],
|
||||||
|
|||||||
Reference in new issue
Block a user