Compare commits

...

1 Commits

Author SHA1 Message Date
Vincent Koc
7a20de3fdf Tests: clean trusted-proxy pairing seed 2026-03-17 20:16:36 -07:00

View File

@ -251,7 +251,8 @@ export function registerControlUiAndPairingSuite(): void {
test("clears self-declared scopes for trusted-proxy control ui without device identity", async () => { test("clears self-declared scopes for trusted-proxy control ui without device identity", async () => {
await configureTrustedProxyControlUiAuth(); await configureTrustedProxyControlUiAuth();
const { publicKeyRawBase64UrlFromPem } = await import("../infra/device-identity.js"); const { publicKeyRawBase64UrlFromPem } = await import("../infra/device-identity.js");
const { requestDevicePairing } = await import("../infra/device-pairing.js"); const { rejectDevicePairing, requestDevicePairing } =
await import("../infra/device-pairing.js");
const { identity } = await createOperatorIdentityFixture("openclaw-control-ui-trusted-proxy-"); const { identity } = await createOperatorIdentityFixture("openclaw-control-ui-trusted-proxy-");
const pendingRequest = await requestDevicePairing({ const pendingRequest = await requestDevicePairing({
deviceId: identity.deviceId, deviceId: identity.deviceId,
@ -261,6 +262,7 @@ export function registerControlUiAndPairingSuite(): void {
clientId: CONTROL_UI_CLIENT.id, clientId: CONTROL_UI_CLIENT.id,
clientMode: CONTROL_UI_CLIENT.mode, clientMode: CONTROL_UI_CLIENT.mode,
}); });
try {
await withGatewayServer(async ({ port }) => { await withGatewayServer(async ({ port }) => {
const ws = await openWs(port, TRUSTED_PROXY_CONTROL_UI_HEADERS); const ws = await openWs(port, TRUSTED_PROXY_CONTROL_UI_HEADERS);
try { try {
@ -281,6 +283,9 @@ export function registerControlUiAndPairingSuite(): void {
ws.close(); ws.close();
} }
}); });
} finally {
await rejectDevicePairing(pendingRequest.request.requestId);
}
}); });
test("allows localhost control ui without device identity when insecure auth is enabled", async () => { test("allows localhost control ui without device identity when insecure auth is enabled", async () => {