feat: add auth extension points and one ssh connect pipeline

This commit is contained in:
LukeGus committed 2026-09-23 00:44:33 -05:00
1 parent d3c209af13
commit d774df8b41
159 files changed
+43243 -7451

No files matched your search

+32 -1
View File
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/react";
import { render, screen, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { ElectronLoginForm } from "../../auth/ElectronLoginForm";
@@ -23,4 +23,35 @@ describe("ElectronLoginForm", () => {
expect(permissions).toContain("publickey-credentials-get");
expect(permissions).toContain("publickey-credentials-create");
});
it.each([
"auth_component",
"totp_auth_component",
"passkey_auth_component",
"method_auth_component",
])("accepts a login hand-off from %s", async (source) => {
const onAuthSuccess = vi.fn();
render(
<ElectronLoginForm
serverUrl="https://termix.example.com"
onAuthSuccess={onAuthSuccess}
onChangeServer={vi.fn()}
/>,
);
const frame = screen.getByTitle(
"Server Authentication",
) as HTMLIFrameElement;
window.dispatchEvent(
new MessageEvent("message", {
source: frame.contentWindow,
data: {
type: "AUTH_SUCCESS",
platform: "desktop",
source,
token: "jwt-1",
},
}),
);
await waitFor(() => expect(onAuthSuccess).toHaveBeenCalledWith("jwt-1"));
});
});