mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import test from 'node:test';
|
|
|
|
const source = readFileSync(new URL('./KeychainExportPanel.tsx', import.meta.url), 'utf8');
|
|
|
|
test('key export forwards the selected host SSH connection timeouts', () => {
|
|
assert.match(source, /resolveHostSshConnectionTimeouts\(effectiveExportHost\)/);
|
|
assert.match(source, /sshTcpConnectTimeoutMs: connectionTimeouts\.tcpConnectTimeoutSeconds \* 1000/);
|
|
assert.match(source, /sshAuthReadyTimeoutMs: connectionTimeouts\.authReadyTimeoutSeconds \* 1000/);
|
|
});
|
|
|
|
test('key export preserves imported identity files when the system SSH agent is enabled', () => {
|
|
assert.match(
|
|
source,
|
|
/fallbackIdentityFilePaths: \(!effectiveExportHost\.useSshAgent && exportAuth\.authMethod === "password"\) \|\| exportAuth\.keyId/,
|
|
);
|
|
});
|
|
|
|
test('key export passes the selected vault key to agent filtering', () => {
|
|
assert.match(source, /resolveBridgeSshAgentAuth\(\s*effectiveExportHost,\s*exportAuth\.key,\s*\)/);
|
|
});
|