fix(source-sftp-bulk): support non-RSA private key types (Ed25519, ECDSA, DSS)#75967
fix(source-sftp-bulk): support non-RSA private key types (Ed25519, ECDSA, DSS)#75967devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
Conversation
…DSA, DSS) Co-Authored-By: bot_apk <apk@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit 3206048. |
airbyte-integrations/connectors/source-sftp-bulk/unit_tests/client_test.py
Fixed
Show fixed
Hide fixed
|
Co-Authored-By: bot_apk <apk@cognition.ai>
|
/publish-connectors-prerelease
|
|
↪️ Triggering Reason: Fix PR for source-sftp-bulk non-RSA key auth. AI triage score 5/5 green, fix created same day. |
|
Fix Validation EvidenceOutcome: Fix/Feature Proven Successfully Evidence SummaryRegression tests passed successfully, confirming no regressions for existing RSA-key-based connections when using the pre-release version ( Next Steps
Connector & PR DetailsConnector: Evidence PlanProving CriteriaRegression tests pass showing no regressions against existing RSA-key-based connections, AND/OR a live connection test completes successfully after pinning to the pre-release. Disproving Criteria
Cases Attempted
Pre-flight Checks
Design Intent Note: The original code hardcoded Detailed Evidence Log2026-04-01 11:42 UTC — Session started, began context gathering Note: Connection IDs and detailed logs are recorded in the linked private issue. |
What
Resolves https://github.com/airbytehq/oncall/issues/11838:
The connector hardcodes
paramiko.RSAKey.from_private_key()for SSH private key parsing, which fails withstruct.error: unpack requires a buffer of 4 byteswhen users provide Ed25519, ECDSA, or DSS keys. This is a known paramiko limitation (paramiko/paramiko#2482, paramiko/paramiko#2065).How
Replaced the hardcoded
RSAKeycall inclient.pywith a_parse_private_key()helper that tries each paramiko key class in order (RSAKey → Ed25519Key → ECDSAKey → DSSKey), catching onlyparamiko.SSHExceptionandValueError. If all fail, raisesAirbyteTracedExceptionwithFailureType.config_error.Review guide
source_sftp_bulk/client.py— Core fix. Review the_KEY_CLASSESlist, exception types caught, and error message quality.unit_tests/client_test.py— New tests. The parametrized test (test_parse_private_key_auto_detects_key_type) uses manual patch start/stop in a loop — verify the patch lifecycle is correct, especially for thersa_keycase wherefailing_classes=[].Human review checklist
paramiko.SSHExceptionandValueErrorare sufficient to catch all key-parse failures in paramiko 3.4.0. The original bug manifests asstruct.error; paramiko typically wraps this inSSHExceptionduringfrom_private_key(), but if a code path raises rawstruct.error, it would propagate uncaught.rsa_keycase (failing_classes=[], single patch in list).User Impact
Users can now authenticate to SFTP servers using Ed25519, ECDSA, and DSS private keys, not just RSA. Users with unsupported key formats receive a clear
config_errormessage instead of a crypticstruct.error.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/da46a26c9ffa4191a54bcc7439ccee46