refactor(session): reduce function parameters
SonarQube Scan / SonarQube Trigger (push) Successful in 1m55s

This commit is contained in:
2026-01-23 15:52:27 +07:00
parent e522ffa44f
commit 169bc2358c
2 changed files with 30 additions and 10 deletions
+10 -1
View File
@@ -99,7 +99,16 @@ func (s *server) handleConnection(conn net.Conn) {
cancel()
}
log.Println("SSH connection established:", sshConn.User())
sshSession := session.New(s.randomizer, s.config, sshConn, forwardingReqs, chans, s.sessionRegistry, s.portRegistry, user)
sshSession := session.New(&session.Config{
Randomizer: s.randomizer,
Config: s.config,
Conn: sshConn,
InitialReq: forwardingReqs,
SshChan: chans,
SessionRegistry: s.sessionRegistry,
PortRegistry: s.portRegistry,
User: user,
})
err = sshSession.Start()
if err != nil {
log.Printf("SSH session ended with error: %s", err.Error())