fix(sftp): fix OpenSSH key auth and password fallback after asyncssh migration - #51
Closed
Orinks wants to merge 1 commit into
Closed
fix(sftp): fix OpenSSH key auth and password fallback after asyncssh migration#51Orinks wants to merge 1 commit into
Orinks wants to merge 1 commit into
Conversation
…migration Closes #49 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing — this PR introduces a regression where key-only auth (no password) stops working. Dev branch already handles key auth correctly. Issue #49 may be invalid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #49 — regular OpenSSH key authentication broken after asyncssh migration.
Three bugs in
SFTPClient.connect():passwordfield was always passed aspassphrasetoasyncssh.connect(), even for non-encrypted keys. Removed — passphrase is no longer set at all, letting asyncssh handle encrypted keys via its ownKeyImportErrorpath (already caught).passphrase=Noneexplicitly set: even when no password existed,passphrase=Nonewas passed in kwargs. Now omitted entirely per asyncssh best practice.elifpreventedpasswordfrom being passed alongsideclient_keys. Changed to separateifblocks so password auth works as fallback when key auth fails.Also added a distinct
PermissionDeniederror message for the key+password case.Test plan
test_connect_with_key_file— key-only: nopassphraseorpasswordin kwargstest_connect_with_key_and_password_fallback— key+password:passwordkwarg set, nopassphrasetest_connect_with_key_and_password_logs_both_methods— auth methods log includes bothtest_auth_failure_message_for_key_and_password— error message mentions password fallback🤖 Generated with Claude Code