Closed Red-M closed 3 years ago
Thanks for contribution. Comments inline.
Apologies, I missed a few pieces porting this back from my fork.
Needs more test coverage.
Suggest to add to test_session.py
:
def test_failed_keyboard_interactive_auth_valid_user(self):
self.assertRaises(
AuthenticationError,
self.session.userauth_keyboardinteractive, self.user, 'FAKE PASSWORD'
)
def test_failed_keyboard_interactive_auth_valid_user_no_pass(self):
self.assertRaises(
AuthenticationError,
self.session.userauth_keyboardinteractive, self.user, ''
)
Valid user wrong password should be enough to test all the written code. Authentication should still fail as we don't know the password.
Have made changes to this at #123
The callback was segfaulting - tests were not actually run as keyboard interactive auth was not allowed in the embedded server. Some other issues also resolved.
Would suggest getting tests running locally first before a PR - pytest tests
works. Have also updated contributing guide.
Because it cannot take a string as the password, it needs a callback function.
This fixes #58.