Skip to content
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

Add hostlogin to proxy config for windows desktop #12775

Merged
merged 3 commits into from
May 20, 2022
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
1 change: 1 addition & 0 deletions lib/web/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func proxyClient(ctx context.Context, sessCtx *SessionContext, addr string) (*cl
if err := cfg.ParseProxyHost(addr); err != nil {
return nil, trace.Wrap(err)
}
cfg.HostLogin = sessCtx.user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically HostLogin should be the user on the target host, which we have in the username variable we pull from the query string on line 92.

It doesn't really matter, as this is only used when using the ProxyClient to connect to an SSH node, but we do have more accurate information so we might as well use it.

I would also add a comment here:

// HostLogin must be specified in order to avoid defaulting to 
// the local Unix user, which will fail in some environments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: I had time and realized it would be several hours before you're awake, so I went ahead and made the change. Let me know what you think!

tc, err := client.NewClient(cfg)
if err != nil {
return nil, trace.Wrap(err)
Expand Down