diff --git a/config/hwlab-hwpod-nodes.yaml b/config/hwlab-hwpod-nodes.yaml index df8eb567..6dbbbd31 100644 --- a/config/hwlab-hwpod-nodes.yaml +++ b/config/hwlab-hwpod-nodes.yaml @@ -52,7 +52,7 @@ targets: - "F:\\Work\\ConStart" defaultRoot: "F:\\Work\\ConStart" desktopConfig: - serverUrl: https://hwlab.pikapython.com + serverUrl: https://lab-dev-hwpod.hwpod.com/hwpods/devices autoConnect: true requireCredential: true updateEnabled: true diff --git a/config/hwlab-node-lanes.yaml b/config/hwlab-node-lanes.yaml index 83f6267e..d79b0ae0 100644 --- a/config/hwlab-node-lanes.yaml +++ b/config/hwlab-node-lanes.yaml @@ -218,10 +218,9 @@ lanes: autoCollapseTerminal: false hwpod: healthTimeoutMs: 6000 - runtimeApiUrl: https://lab-dev.hwpod.com - runtimeApiAuth: - sourceRef: hwlab/nc01-v03-admin.env - sourceKey: HWLAB_API_KEY + nodeAuth: + sourceRef: hwlab/nc01-v03-hwpod-node.env + sourceKey: HWLAB_HWPOD_NODE_WS_TOKEN specRegistry: database: sourceRef: hwlab/nc01-v03-cloud-api-db.env diff --git a/scripts/src/hwlab-native-development.test.ts b/scripts/src/hwlab-native-development.test.ts index 4a204f36..8689dda7 100644 --- a/scripts/src/hwlab-native-development.test.ts +++ b/scripts/src/hwlab-native-development.test.ts @@ -67,8 +67,13 @@ test("L1 HWPOD spec registry resolves PostgreSQL authority and frozen built-ins connectionTimeoutMs: 5000, }); expect(native!.healthTimeoutMs).toBe(6000); + expect(native!.nodeAuth).toEqual({ sourceRef: "hwlab/nc01-v03-hwpod-node.env", sourceKey: "HWLAB_HWPOD_NODE_WS_TOKEN" }); expect(native!.web.accessProfile).toEqual({ id: "hwpod-native-l1", allowedNavIds: ["admin.hwpodGroups"], startPath: "/hwpods/devices" }); const env = hwlabHwpodNativeDevelopmentEnvironment(native!); + expect(env.HWPOD_NODE_WS_TOKEN).toBeTruthy(); + expect(env.HWPOD_NODE_OPS_API_URL).toBe("http://127.0.0.1:6681"); + expect(env.HWPOD_RUNTIME_API_URL).toBeUndefined(); + expect(env.HWPOD_RUNTIME_API_AUTHORIZATION).toBeUndefined(); expect(JSON.parse(env.HWPOD_WEB_RUNTIME_CONFIG!)).toEqual(native!.web.runtimeConfig); expect(native!.web.runtimeConfig).toEqual(hwlabRuntimeLaneSpecForNode("v03", "NC01").nativeDevelopment!.workbench.web.runtimeConfig); expect(JSON.parse(env.HWPOD_WEB_ACCESS_PROFILE_JSON!)).toEqual(native!.web.accessProfile); diff --git a/scripts/src/hwlab-native-development.ts b/scripts/src/hwlab-native-development.ts index 558c9327..a2d7f4dd 100644 --- a/scripts/src/hwlab-native-development.ts +++ b/scripts/src/hwlab-native-development.ts @@ -301,11 +301,11 @@ function hwlabCaseRunNativeDevelopmentEnvironment(native: NonNullable): NodeJS.ProcessEnv { - const authorizationSource = readEnvSourceFile({ + const nodeAuthSource = readEnvSourceFile({ root: "/root/.unidesk/.state/secrets", - sourceRef: native.runtimeApiAuth.sourceRef, + sourceRef: native.nodeAuth.sourceRef, }); - const runtimeApiKey = requiredEnvValue(authorizationSource.values, native.runtimeApiAuth.sourceKey, native.runtimeApiAuth.sourceRef); + const nodeToken = requiredEnvValue(nodeAuthSource.values, native.nodeAuth.sourceKey, native.nodeAuth.sourceRef); const databaseSource = readEnvSourceFile({ root: "/root/.unidesk/.state/secrets", sourceRef: native.specRegistry.database.sourceRef, @@ -326,8 +326,7 @@ export function hwlabHwpodNativeDevelopmentEnvironment(native: NonNullable { const raw = asRecord(value, path); - const runtimeApiAuth = asRecord(raw.runtimeApiAuth, `${path}.runtimeApiAuth`); + const nodeAuth = asRecord(raw.nodeAuth, `${path}.nodeAuth`); const specRegistry = asRecord(raw.specRegistry, `${path}.specRegistry`); const database = asRecord(specRegistry.database, `${path}.specRegistry.database`); const temporal = asRecord(raw.temporal, `${path}.temporal`); @@ -1717,10 +1716,9 @@ function nativeHwpodConfig(value: unknown, path: string): NonNullable