mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* feat(auth): authenticate daemon clients through hello Give local CLI and desktop clients a per-run credential while remote clients send the host password inside the protocol. Keep relay passwordless admission for this mobile release so existing saved hosts keep working until the follow-up enforcement release. Move password recovery for saved hosts into host settings and keep pairing credentials in the add flow. Include isolated web QA evidence for both flows. * fix(auth): preserve Hub bootstrap and local credential expectations Hub-owned sockets already carry admission; keep their hello handling synchronous through session bootstrap while resolving credentials asynchronously for ordinary sockets. Keep the resolver out of lightweight configuration imports. Update CLI expectations for same-home credentials, let a rejected connection yield to another usable connection, and clear pairing secrets when add-flow targets change. * fix(pairing): retain passwords across edits to the same target Track the last valid pairing host while a URI is edited. This preserves an entered password for whitespace and partial edits but clears it when a different host becomes the target. * test(auth): align local credential checks across platforms Expect the CLI to authenticate through the credential in its selected home, and verify POSIX file modes only where Node exposes them. * feat(app): move host password into a settings row with a modal The host page rendered an always-visible password form above Name on every host. Replace it with a Password row under a Security section below Appearance; tapping it opens a modal with Save and, when a password is saved, Clear. The connection-error callout keeps its guidance and gains a Set password button that opens the same modal. Drop the unused pairing.hostPassword body/reopen/saveError strings. * chore: remove committed QA screenshots QA evidence stays out of the repository; the PR body describes it in words. * feat(app): keep the host password out of the host page The saved password is connection data, entered only when a host is added. A Password setting on the host page reads as the daemon's own password, so the row, modal, and callout button are gone. A rejected host shows the daemon's reason with guidance to remove the host and add it again with the password. useHostMutations no longer exposes setHostPassword; relay imports still set it inside the runtime. * feat(app): show host connection errors in an error alert HostConnectionError renders the existing Alert with the connection error as its title. Auth rejections add the re-add guidance as the description; other errors show the title only. The Overview and Connections pages share it. * style(app): soften alert borders to half-opacity accent * feat(app): size alerts on the button scale Alert takes a size prop (xs/sm/md/lg, default md) whose geometry lives next to the button's in control-geometry: one font size for title and description, the button icon size centered on the first text line, button padding and radius, and a one-line alert as tall as the button of the same size. Consumers pick sm among settings rows, cards, panels, and modals, and md when the alert is the whole page or sheet state. * style(app): roomier, rounder alerts with a tight title block Alert sm padding returns to the original 12/16 and every size is at least borderRadius.xl. Title and description sit a small gap apart with no line height override. The icon slot carries a zero-width text strut in the alert's font so the icon centers on the first line for titled, title-only, and description-only alerts. * refactor(app): align the alert icon with a centered lead row Drop the zero-width strut. The icon and the alert's first text (title, else description) share one row centered on each other; the description and actions sit below, indented by the icon slot width plus gap so they start at the lead text's left edge. * refactor(app): drop the unused Alert icon override
155 lines
5.9 KiB
TypeScript
155 lines
5.9 KiB
TypeScript
import { expect, test } from "../support/fixtures";
|
|
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
|
import { getE2EDaemonPort } from "../support/helpers/daemon-port";
|
|
import { TEST_HOST_LABEL } from "../support/helpers/daemon-registry";
|
|
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
|
|
import { getServerId } from "../support/helpers/server-id";
|
|
import {
|
|
expectSettingsHeader,
|
|
openSettingsHost,
|
|
openHostSection,
|
|
expectHostLabelDisplayed,
|
|
clickEditHostLabel,
|
|
expectHostLabelEditMode,
|
|
expectHostConnectionsCard,
|
|
expectHostInjectMcpCard,
|
|
expectHostActionCards,
|
|
expectHostProvidersCard,
|
|
expectHostNoDaemonLifecycleRow,
|
|
expectRetiredSidebarSectionsAbsent,
|
|
expectHostPageVisible,
|
|
seedSavedSettingsHosts,
|
|
selectSettingsHost,
|
|
expectHostRejectedWithReAddGuidance,
|
|
expectNoHostPasswordControls,
|
|
removeHostFromHostPage,
|
|
addDirectHostFromSettings,
|
|
expectHostOnlineWithoutError,
|
|
} from "../support/helpers/settings";
|
|
|
|
test.describe("Settings host page", () => {
|
|
test("visits host settings and opens the label editor", async ({ page }) => {
|
|
const serverId = getServerId();
|
|
const port = getE2EDaemonPort();
|
|
await gotoAppShell(page);
|
|
await openSettings(page);
|
|
await openSettingsHost(page, serverId);
|
|
await test.step("connections section shows the seeded connection endpoint", async () => {
|
|
await expectSettingsHeader(page, "Connections");
|
|
await expectHostConnectionsCard(page, port);
|
|
});
|
|
await test.step("agents section shows the inject MCP toggle", async () => {
|
|
await openHostSection(page, serverId, "agents");
|
|
await expectSettingsHeader(page, "Agents");
|
|
await expectHostInjectMcpCard(page);
|
|
});
|
|
await test.step("providers section shows the providers card", async () => {
|
|
await expectHostProvidersCard(page, serverId);
|
|
await expectSettingsHeader(page, "Providers");
|
|
});
|
|
await test.step("host section shows the host label and restart/remove action cards", async () => {
|
|
await openHostSection(page, serverId, "host");
|
|
await expectSettingsHeader(page, "Overview");
|
|
await expectHostLabelDisplayed(page);
|
|
await expectHostActionCards(page, serverId);
|
|
});
|
|
await test.step("clicking the label pencil reveals the inline editor", async () => {
|
|
await openHostSection(page, serverId, "host");
|
|
|
|
await expectHostLabelDisplayed(page);
|
|
await clickEditHostLabel(page);
|
|
await expectHostLabelEditMode(page, TEST_HOST_LABEL);
|
|
await page.keyboard.press("Escape");
|
|
});
|
|
await test.step("host section does not render daemon lifecycle controls for a remote daemon", async () => {
|
|
await openHostSection(page, serverId, "host");
|
|
|
|
await expectHostNoDaemonLifecycleRow(page);
|
|
});
|
|
await test.step("settings sidebar exposes the flat App and Host section rows", async () => {
|
|
await expectRetiredSidebarSectionsAbsent(page);
|
|
});
|
|
});
|
|
|
|
test("a failed remote daemon update remains visible in the host UI", async ({
|
|
page,
|
|
outdatedDaemon,
|
|
}) => {
|
|
await seedSavedSettingsHosts(page, [outdatedDaemon]);
|
|
await page.reload();
|
|
await openSettings(page);
|
|
await openSettingsHost(page, outdatedDaemon.serverId);
|
|
await openHostSection(page, outdatedDaemon.serverId, "host");
|
|
|
|
page.once("dialog", (dialog) => dialog.accept());
|
|
const updateButton = page.getByTestId("host-page-update-button");
|
|
await updateButton.click();
|
|
|
|
await expect(
|
|
updateButton.filter({ hasText: /Preparing update|Downloading packages|Installing/ }),
|
|
).toBeDisabled();
|
|
|
|
const updateFailure = page.getByTestId("host-page-update-error");
|
|
await expect(updateFailure).toBeVisible();
|
|
await expect(updateFailure).toContainText("Update failed");
|
|
await expect(updateFailure).toContainText("Failed to update the daemon:");
|
|
await expect(updateButton).toBeEnabled();
|
|
});
|
|
|
|
test("a host rejected for its password reconnects after being removed and added again with it", async ({
|
|
page,
|
|
}) => {
|
|
const password = "e2e host password";
|
|
const daemon = await startIsolatedHostDaemon("srv_e2e_password_host", {
|
|
environment: { ...process.env, PASEO_PASSWORD: password },
|
|
});
|
|
try {
|
|
await seedSavedSettingsHosts(page, [
|
|
{
|
|
serverId: getServerId(),
|
|
label: TEST_HOST_LABEL,
|
|
endpoint: `127.0.0.1:${getE2EDaemonPort()}`,
|
|
},
|
|
{
|
|
serverId: daemon.serverId,
|
|
label: "Password host",
|
|
endpoint: `127.0.0.1:${daemon.port}`,
|
|
},
|
|
]);
|
|
await page.reload();
|
|
await openSettings(page);
|
|
await selectSettingsHost(page, daemon.serverId);
|
|
await openHostSection(page, daemon.serverId, "host");
|
|
|
|
await test.step("the host page shows the reason and the re-add guidance, with no password UI", async () => {
|
|
await expectHostRejectedWithReAddGuidance(page, "Password required");
|
|
await expectNoHostPasswordControls(page);
|
|
});
|
|
|
|
await test.step("removing the host and adding it again with the password brings it online", async () => {
|
|
await removeHostFromHostPage(page, daemon.serverId);
|
|
await addDirectHostFromSettings(page, { host: "127.0.0.1", port: daemon.port, password });
|
|
await openHostSection(page, daemon.serverId, "host");
|
|
await expectHostOnlineWithoutError(page);
|
|
});
|
|
} finally {
|
|
await daemon.close();
|
|
}
|
|
});
|
|
|
|
test("navigating to /settings/hosts/[serverId] redirects to the connections section", async ({
|
|
page,
|
|
}) => {
|
|
const serverId = getServerId();
|
|
|
|
await gotoAppShell(page);
|
|
await page.goto(`/settings/hosts/${encodeURIComponent(serverId)}`);
|
|
|
|
await expectHostPageVisible(page, serverId);
|
|
await expectSettingsHeader(page, "Connections");
|
|
await openHostSection(page, serverId, "host");
|
|
await expectHostLabelDisplayed(page);
|
|
await expectHostActionCards(page, serverId);
|
|
});
|
|
});
|