Skip to content

refactor(agent): Move SSH server into agentssh package #7004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use s logger
  • Loading branch information
mafredri committed Apr 4, 2023
commit 126813f029765d9bf6606d7cbcaee40a40ad845f
6 changes: 3 additions & 3 deletions agent/agentssh/agentssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ func NewServer(ctx context.Context, logger slog.Logger, maxTimeout time.Duration
"session": ssh.DefaultSessionHandler,
},
ConnectionFailedCallback: func(_ net.Conn, err error) {
logger.Info(ctx, "ssh connection ended", slog.Error(err))
s.logger.Info(ctx, "ssh connection ended", slog.Error(err))
},
Handler: s.sessionHandler,
HostSigners: []ssh.Signer{randomSigner},
LocalPortForwardingCallback: func(ctx ssh.Context, destinationHost string, destinationPort uint32) bool {
// Allow local port forwarding all!
logger.Debug(ctx, "local port forward",
s.logger.Debug(ctx, "local port forward",
slog.F("destination-host", destinationHost),
slog.F("destination-port", destinationPort))
return true
Expand All @@ -105,7 +105,7 @@ func NewServer(ctx context.Context, logger slog.Logger, maxTimeout time.Duration
},
ReversePortForwardingCallback: func(ctx ssh.Context, bindHost string, bindPort uint32) bool {
// Allow reverse port forwarding all!
logger.Debug(ctx, "local port forward",
s.logger.Debug(ctx, "local port forward",
slog.F("bind-host", bindHost),
slog.F("bind-port", bindPort))
return true
Expand Down