mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: convert ssh tunnels into a plugin
This commit is contained in:
1 parent
c85c1fdb86
commit
1682861853
220 files changed
+36928
-11374
No files matched your search
@@ -661,6 +661,12 @@ export interface PluginSshConnectOptions {
|
||||
prompt?: PluginSshPromptChannel;
|
||||
/** Config fields to force, e.g. a longer readyTimeout. */
|
||||
overrides?: Record<string, unknown>;
|
||||
/**
|
||||
* An already-open stream to the host, such as a forwardOut channel through
|
||||
* another host. The transport step is skipped: no port knocking, proxy,
|
||||
* jump hosts or DNS lookup. Host key checks and auth still run.
|
||||
*/
|
||||
sock?: unknown;
|
||||
}
|
||||
|
||||
export interface PluginSshConnection<Client = unknown> {
|
||||
|
||||
@@ -22,6 +22,7 @@ import type {
|
||||
PluginLoginMethod,
|
||||
PluginSecondFactor,
|
||||
PluginSshAuthProvider,
|
||||
PluginSshConnectOptions,
|
||||
PluginSshHost,
|
||||
PluginHostSummary,
|
||||
PluginHostRecord,
|
||||
@@ -94,7 +95,11 @@ export interface FakePluginContext {
|
||||
/** Core settings readable through ctx.settings.readCore. */
|
||||
coreSettings: Map<string, string>;
|
||||
/** Every ctx.ssh.connect and withConnection call, in order. */
|
||||
sshConnections: Array<{ host: number | PluginSshHost; pool?: string }>;
|
||||
sshConnections: Array<{
|
||||
host: number | PluginSshHost;
|
||||
pool?: string;
|
||||
options?: PluginSshConnectOptions;
|
||||
}>;
|
||||
/** Every ctx.hosts.share call, in order. */
|
||||
hostShares: Array<{
|
||||
hostId: number;
|
||||
@@ -467,8 +472,8 @@ export function createFakeContext(
|
||||
},
|
||||
|
||||
ssh: {
|
||||
connect: async (host) => {
|
||||
sshConnections.push({ host });
|
||||
connect: async (host, connectOptions) => {
|
||||
sshConnections.push({ host, options: connectOptions });
|
||||
return {
|
||||
client: sshClient as never,
|
||||
jumpClient: null,
|
||||
|
||||
Reference in new issue
Block a user