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

Is the SSH user name accessible by the ChannelHandler? #57

Open
jimstudt opened this issue Nov 25, 2020 · 3 comments · May be fixed by #125
Open

Is the SSH user name accessible by the ChannelHandler? #57

jimstudt opened this issue Nov 25, 2020 · 3 comments · May be fixed by #125
Labels
kind/enhancement Improvements to existing feature.

Comments

@jimstudt
Copy link

jimstudt commented Nov 25, 2020

A server may care about which user has connected. I'm not seeing a path to connect the SSH user name to any of my handler code. I'm not even seeing it saved and available in SSHChildChannel or anything hanging off of it.

Unless I've missed something this will take some doing to add. Options include:

  • Adding a SSHChannelRequestEvent with a description of the user name which is sent first.

  • NIOSSHHandler() could get a new initializer which passes authentication information into the inboundChildChannelInitializer: equivalent.

Either of these presuppose that the user name is saved somewhere.

@Lukasa Lukasa added the kind/enhancement Improvements to existing feature. label Nov 26, 2020
@Lukasa
Copy link
Contributor

Lukasa commented Nov 26, 2020

Right now we avoid putting a structure on how the user authentication credentials are passed. This is managed entirely by the user authentication delegate, and we persist no state to that effect.

However, I think it’s a good idea to persist the logged in username, yeah. The proper API design is likely to store the auth information on the NIOSSHHandler, and then expose it to child channels via a new channel option. Users can get that channel option to request the information, which we’ll then load from the NIOSSHHandler.

Is this a patch you’re interested in making?

@jimstudt
Copy link
Author

I write one up.

@tannerdsilva
Copy link

+1 would love to see this feature added to the framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants