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

fix(ssh-tunnel): update fields for open tunnel with private + private key passwords #22764

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions superset/extensions/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def create_tunnel(
elif ssh_tunnel.private_key:
private_key_file = StringIO(ssh_tunnel.private_key)
private_key = RSAKey.from_private_key(private_key_file)
params["private_key"] = private_key
params["private_key_password"] = ssh_tunnel.private_key_password
params["ssh_pkey"] = private_key
params["ssh_private_key_password"] = ssh_tunnel.private_key_password

Choose a reason for hiding this comment

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

Oh! I was reading the docs here: https://sshtunnel.readthedocs.io/en/latest/ thanks!
Also, not a blocker for these changes, but probably worth mentioning we should make sure that when updating a tunnel, if we send a password or private_key/private_key_password, we remove the other login method from the tunnel (the UI is doing it already), otherwise, it will get into the if all the time if both are present, even if password is not the latest login method of the tunnel.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's cut a ticket for this as well on our end


return open_tunnel(**params)

Expand Down