Files
orca/src/main/ssh/runtime-ssh-access-verification.ts
T
Neil 3a0e9a27d0 refactor: organize backend runtime by defining owner (#39625)
* refactor(main): organize runtime implementation owners

* test: retire wall-clock CLI title recovery case

* refactor: route new folder mutation to runtime store owner

* test: import folder mutation store contract from its owner
2026-11-07 22:24:34 -08:00

24 lines
1.0 KiB
TypeScript

import type { KnownRuntimeEnvironment } from '../../shared/remote-runtime/host-catalog/runtime-environments'
import { verifyRuntimeEnvironmentIdentity } from '../runtime/hosts/identity/runtime-environment-identity-verification'
import type { PairedRuntimeConnection } from '../../shared/remote-runtime/pairing/paired-runtime-connection'
import type { RuntimeStatus } from '../../shared/runtime-types'
export async function verifyRuntimeEnvironmentSshTunnel(
environment: KnownRuntimeEnvironment,
localPort: number,
signal?: AbortSignal
): Promise<{
verifiedConnection: PairedRuntimeConnection
verifiedRuntimeId: string
runtimeStatus: RuntimeStatus
}> {
if (!Number.isInteger(localPort) || localPort < 1 || localPort > 65_535) {
throw new Error('The SSH tunnel did not provide a valid local port.')
}
// The tunnel targets the native listener, not the public reverse proxy; E2EE still pins its key.
return verifyRuntimeEnvironmentIdentity(environment, {
endpoint: `ws://127.0.0.1:${localPort}`,
signal
})
}