-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
beiboot: Handle ssh host key prompts
Stop treating host key prompts as generic conversation messages. We want the UI to handle them properly, with some verbiage/buttons and the recipe for validating host keys, instead of letting the user type "yes". The login page recognizes these through the presence of the `host-key` authorize field (and irritatingly, an extra `default` field with the actual value). We can't use ferny's builtin `do_hostkey()` responder for this, as that requires `ferny.Session(handle_host_key=True)`, and that API is not flexible enough to handle our ssh command modifications and the extra beiboot_helper handler. This needs some bigger redesign, see #19668. So just recognize and parse SSH's host key prompts, and rely on our integration tests to spot breakage in future distro releases. This enables the login page's host key localstorage mechanism, so adjust TestLogin.testLoginSshBeiboot to only expect the host key on the first login attempt.
- Loading branch information
1 parent
823f375
commit c022968
Showing
4 changed files
with
48 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,8 +107,9 @@ Command = /usr/bin/env python3 -m cockpit.beiboot | |
b.wait_not_visible("#recent-hosts-list") | ||
b.set_val("#server-field", "10.111.113.2") | ||
b.click("#login-button") | ||
b.wait_in_text("#conversation-group", "authenticity of host '10.111.113.2") | ||
b.set_val("#conversation-input", "yes") | ||
# accept unknown host key | ||
b.wait_in_text("#hostkey-message-1", "10.111.113.2") | ||
b.wait_in_text("#hostkey-fingerprint", "SHA256:") | ||
b.click("#login-button") | ||
b.wait_text("#conversation-prompt", "[email protected]'s password: ") | ||
b.set_val("#conversation-input", "foobar") | ||
|
This file contains 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