rusackas opened a new pull request, #40139: URL: https://github.com/apache/superset/pull/40139
### SUMMARY This is a **test-only PR** opened as a TDD-style validation of issue #24180. #24180 (filed 2023-05) reports that SSH tunnel setup only accepts RSA keys; ed25519 (and other modern key types) fail with \`unpack requires 4 bytes\`. The user pinpointed the cause: \`superset/extensions/ssh.py:75\` calls \`RSAKey.from_private_key()\` unconditionally, regardless of the key type the user pasted. This PR adds two tests on \`SSHManager.create_tunnel\`: 1. **\`test_create_tunnel_accepts_ed25519_private_key\`** — generates a fresh ed25519 PEM in-memory and asserts \`create_tunnel\` parses it without raising. \`sshtunnel.open_tunnel\` is patched so no network connection happens. 2. **\`test_create_tunnel_accepts_rsa_private_key_unchanged\`** — companion that pins the historically-supported RSA path, so a fix for ed25519 doesn't regress RSA. Both tests generate keys at runtime via \`cryptography\` (already a Superset dependency); no static key fixtures are committed. ### How to interpret CI - **CI green** → ed25519 is now supported; merging closes #24180 and locks in the regression guards. - **CI red** → bug is still live. Likely fix in \`superset/extensions/ssh.py:75\`: replace \`RSAKey.from_private_key(...)\` with a polymorphic loader (\`paramiko.PKey.from_private_key(...)\` in modern paramiko, or a try-each-type fallback chain that supports \`Ed25519Key\`, \`ECDSAKey\`, \`RSAKey\`). ### TESTING INSTRUCTIONS \`\`\`bash pytest tests/unit_tests/extensions/ssh_test.py::test_create_tunnel_accepts_ed25519_private_key -v pytest tests/unit_tests/extensions/ssh_test.py::test_create_tunnel_accepts_rsa_private_key_unchanged -v \`\`\` ### ADDITIONAL INFORMATION - [ ] Has associated issue: closes #24180 - [ ] Required feature flags: \`SSH_TUNNELING\` - [ ] Changes UI - [ ] Includes DB Migration - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
