@@ -42,7 +42,7 @@ type Server struct {
4242}
4343
4444// internal for now
45- type channelHandler func (srv * Server , conn * gossh.ServerConn , newChan gossh.NewChannel , ctx * sshContext )
45+ type channelHandler func (srv * Server , conn * gossh.ServerConn , newChan gossh.NewChannel , ctx Context )
4646
4747func (srv * Server ) ensureHostSigner () error {
4848 if len (srv .HostSigners ) == 0 {
@@ -55,7 +55,7 @@ func (srv *Server) ensureHostSigner() error {
5555 return nil
5656}
5757
58- func (srv * Server ) config (ctx * sshContext ) * gossh.ServerConfig {
58+ func (srv * Server ) config (ctx Context ) * gossh.ServerConfig {
5959 srv .channelHandlers = map [string ]channelHandler {
6060 "session" : sessionHandler ,
6161 "direct-tcpip" : directTcpipHandler ,
@@ -72,7 +72,7 @@ func (srv *Server) config(ctx *sshContext) *gossh.ServerConfig {
7272 }
7373 if srv .PasswordHandler != nil {
7474 config .PasswordCallback = func (conn gossh.ConnMetadata , password []byte ) (* gossh.Permissions , error ) {
75- ctx . applyConnMetadata (conn )
75+ applyConnMetadata (ctx , conn )
7676 if ok := srv .PasswordHandler (ctx , string (password )); ! ok {
7777 return ctx .Permissions ().Permissions , fmt .Errorf ("permission denied" )
7878 }
@@ -81,7 +81,7 @@ func (srv *Server) config(ctx *sshContext) *gossh.ServerConfig {
8181 }
8282 if srv .PublicKeyHandler != nil {
8383 config .PublicKeyCallback = func (conn gossh.ConnMetadata , key gossh.PublicKey ) (* gossh.Permissions , error ) {
84- ctx . applyConnMetadata (conn )
84+ applyConnMetadata (ctx , conn )
8585 if ok := srv .PublicKeyHandler (ctx , key ); ! ok {
8686 return ctx .Permissions ().Permissions , fmt .Errorf ("permission denied" )
8787 }
@@ -223,7 +223,7 @@ func (srv *Server) handleConn(newConn net.Conn) {
223223 defer srv .trackConn (sshConn , false )
224224
225225 ctx .SetValue (ContextKeyConn , sshConn )
226- ctx . applyConnMetadata (sshConn )
226+ applyConnMetadata (ctx , sshConn )
227227 go gossh .DiscardRequests (reqs )
228228 for ch := range chans {
229229 handler , found := srv .channelHandlers [ch .ChannelType ()]
0 commit comments