Plugin API 2.3.0. Needs Termix 26.11.2.
Added
ctx.ssh.prepare,ctx.ssh.openTransportandctx.ssh.jumpChainwork in a plugin process. Your own ssh2 client runs over a stream Termix opens, and Termix keeps the host key checkforwardOut,forwardIn,unforwardInand thetcp connectionevent on clients fromctx.ssh.connect,withConnectionandjumpChainin a plugin process. AforwardOutchannel or any other stream works assockforctx.ssh.connectctx.desktop.localworks in a plugin process, with streams forfs.openRead,fs.openDownload,pluginFetchandpty.spawn- Manifest
sandbox.workerslets a plugin process start worker threads. Each worker keeps the process's limits, and workers from code strings are refused validatewarns whenpackage.jsonbuilds workers but the manifest has nosandbox.workersctx.network.lookup(name, { family })looks up a host name on the Termix server and answers the first address or null. Needsnetwork:probe. A plugin process can't look names up itself withoutnetwork:socketscreateMockCtx({ resolve })answersctx.network.lookup
Changed
- Login methods, keyboard-interactive handlers and
ctx.auth.completeRedirectLoginwork in a plugin process. A login method gets a plain copy of the request, andrequest.res.cookie/clearCookieonly set cookies namedtmxp_<id>_* - An SSH auth provider's
onBannerandonKeyboardInteractive, a keyboard-interactive handler'sdetectandautoAnswerPasswords, andonBannerfromctx.ssh.preparemay return a Promise. Await them. An answer that takes over 5 seconds counts as none - An SSH auth provider in a plugin process may also set the socket
timeout - A sync entity's
shouldSyncmay return a Promise. Termix waits for it, so one from a plugin process works - A plugin process gets
VERSION,TERMIX_DEPLOYMENT(desktop,dockerorserver) andTERMIX_SANDBOX_PLUGIN(its id) from Termix, andvalidateno longer warns about reading them createMockCtx({ sandbox: true })takesssh.preparewith your own client and socket, asockforssh.connect,ssh.openTransport,ssh.jumpChainanddesktop.local, and itsssh.prepareconfig names the hostctx.asUserin a plugin process gives back exactly what its callback returned or threw, so a live object such as an SSH connection and your own error classes workPluginAuthPolicyProvider.allowRememberDevicemay return a PromisecreateMockCtx({ sandbox: true })takes login methods, keyboard-interactive handlers,completeRedirectLoginand async banner hooks, and refuses a login method cookie outsidetmxp_<id>_*
Fixed
createMockCtx({ sandbox: true })no longer refuses anAbortSignalinctx.fetchor Drizzle queries inctx.db.batch; a plugin process takes both- The test setup no longer fails a test now and then with "server closed before listening" when a test server first lands on a port fetch refuses