mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 17:27:10 +00:00
[codex] Add telnet URL deep link support (#1988)
* Add telnet URL deep link support * Fix telnet deep link review issues * Keep ssh deep links independent from telnet registration * Address Codex telnet deep link feedback
This commit is contained in:
19 files changed
+769
-15
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import type { Host } from "../../domain/models";
|
||||
import { buildTelnetDeepLinkConnectionHost } from "../../domain/telnetDeepLink";
|
||||
import { createHostTerminalSession } from "./sessionFactories";
|
||||
|
||||
const host = (overrides: Partial<Host>): Host => ({
|
||||
id: "host-1",
|
||||
label: "Host",
|
||||
hostname: "example.com",
|
||||
username: "alice",
|
||||
port: 22,
|
||||
group: "",
|
||||
tags: [],
|
||||
os: "linux",
|
||||
protocol: "ssh",
|
||||
createdAt: 1,
|
||||
...overrides,
|
||||
});
|
||||
|
||||
test("createHostTerminalSession keeps telnet deep-link default port for ssh hosts with telnet enabled", () => {
|
||||
const connectionHost = buildTelnetDeepLinkConnectionHost(
|
||||
host({
|
||||
protocol: "ssh",
|
||||
telnetEnabled: true,
|
||||
telnetPort: undefined,
|
||||
}),
|
||||
);
|
||||
|
||||
const session = createHostTerminalSession("session-1", connectionHost);
|
||||
|
||||
assert.equal(session.protocol, "telnet");
|
||||
assert.equal(session.port, 23);
|
||||
});
|
||||
Reference in new issue
Block a user