Open metropolis-ameer opened 1 year ago
Can confirm the issue.
A couple of questions: • Is this still an issue in Superset 3.x or newer? • Is there documentation saying what forms of key Superset does or doesn't take (i.e. could a docs change clear this up)? • Is this a bug, or a feature request? I'm on the fence here :)
CC @eschutho
Answers:
Answers aside, it looks like it could be a relatively easy fix based on what I see here: https://github.com/apache/superset/blob/master/superset/extensions/ssh.py#L68
Plus the fact that
paramiko.RSAKey.from_private_key_file
reads RSA keys
paramiko.Ed25519Key.from_private_key_file
reads ED25519 keys
So many another elif based on the key type?
This thing still exists in 4.0.0 and annoys a lot. Adding rsa key is working, but modern keys don't work
SSH only accepts RSA keys. Using ed25519 key fails with Error unpack requires 4 bytes.
How to reproduce the bug
Generate ed25519 key.
ssh-keygen -t ed25519 -C "your_email@example.com"
Create new database connection in Superset UI.
Use the key with an SSH connection.
Expected results
Connection Success
Actual results
Error: unpack requires 4 bytes.
Screenshots
Environment
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
Looking at like 64 of ssh.py I see I referencing RSAKey.from_private_key.
I don't know enough about python or SSH to fix this myself unfortunately as how do you identify a key type from a pasted value? Is this something where you try each type and hope one succeeds or provide a dropdown to identify the key type?