github Termix-SSH/Termix sdk-v2.3.0
Plugin SDK v2.3.0

latest release: sdk-v2.4.0
one hour ago

Plugin API 2.3.0. Needs Termix 26.11.2.

Added

  • ctx.ssh.prepare, ctx.ssh.openTransport and ctx.ssh.jumpChain work in a plugin process. Your own ssh2 client runs over a stream Termix opens, and Termix keeps the host key check
  • forwardOut, forwardIn, unforwardIn and the tcp connection event on clients from ctx.ssh.connect, withConnection and jumpChain in a plugin process. A forwardOut channel or any other stream works as sock for ctx.ssh.connect
  • ctx.desktop.local works in a plugin process, with streams for fs.openRead, fs.openDownload, pluginFetch and pty.spawn
  • Manifest sandbox.workers lets a plugin process start worker threads. Each worker keeps the process's limits, and workers from code strings are refused
  • validate warns when package.json builds workers but the manifest has no sandbox.workers
  • ctx.network.lookup(name, { family }) looks up a host name on the Termix server and answers the first address or null. Needs network:probe. A plugin process can't look names up itself without network:sockets
  • createMockCtx({ resolve }) answers ctx.network.lookup

Changed

  • Login methods, keyboard-interactive handlers and ctx.auth.completeRedirectLogin work in a plugin process. A login method gets a plain copy of the request, and request.res.cookie/clearCookie only set cookies named tmxp_<id>_*
  • An SSH auth provider's onBanner and onKeyboardInteractive, a keyboard-interactive handler's detect and autoAnswerPasswords, and onBanner from ctx.ssh.prepare may 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 shouldSync may return a Promise. Termix waits for it, so one from a plugin process works
  • A plugin process gets VERSION, TERMIX_DEPLOYMENT (desktop, docker or server) and TERMIX_SANDBOX_PLUGIN (its id) from Termix, and validate no longer warns about reading them
  • createMockCtx({ sandbox: true }) takes ssh.prepare with your own client and socket, a sock for ssh.connect, ssh.openTransport, ssh.jumpChain and desktop.local, and its ssh.prepare config names the host
  • ctx.asUser in 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 work
  • PluginAuthPolicyProvider.allowRememberDevice may return a Promise
  • createMockCtx({ sandbox: true }) takes login methods, keyboard-interactive handlers, completeRedirectLogin and async banner hooks, and refuses a login method cookie outside tmxp_<id>_*

Fixed

  • createMockCtx({ sandbox: true }) no longer refuses an AbortSignal in ctx.fetch or Drizzle queries in ctx.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

Don't miss a new Termix release

NewReleases is sending notifications on new releases.