From ea5aaeb32446649434be863949295fe830132751 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 7 Mar 2026 23:09:54 +0000 Subject: [PATCH] ssh/tailssh: add DCTP hooks Updates tailscale/corp#24454 --- ssh/tailssh/tailssh.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ssh/tailssh/tailssh.go b/ssh/tailssh/tailssh.go index debad2b5c..fabbe6035 100644 --- a/ssh/tailssh/tailssh.go +++ b/ssh/tailssh/tailssh.go @@ -106,6 +106,23 @@ func (srv *server) now() time.Time { return time.Now() } +type dctpHooks struct{} // see tailscale/corp#24454 + +// DCTP contains hooks for an external project. +// See tailscale/corp#24454. +var DCTP dctpHooks + +// NewServer returns an SSH connection handler for the given backend. +// The backend must implement the ipnLocalBackend interface defined in +// this package. +func (dctpHooks) NewServer(logf logger.Logf, lb any) func(net.Conn) error { + srv := &server{ + logf: logf, + lb: lb.(ipnLocalBackend), + } + return srv.HandleSSHConn +} + func init() { ipnlocal.RegisterNewSSHServer(func(logf logger.Logf, lb *ipnlocal.LocalBackend) (ipnlocal.SSHServer, error) { tsd, err := os.Executable()