Devices: match the host in ssh's login line case-insensitively (review round 23)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-29 01:01:29 +10:00
1 parent b779376f5b
commit 22863f2f87
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -316,6 +316,8 @@ class Connecting(unittest.TestCase):
opts = ["-o", "HostName=10.0.0.5"]
self.assertFalse(fl.Link.is_target('Authenticated to bastion ([1.2.3.4]:22) using "publickey".', opts, "frame"))
self.assertTrue(fl.Link.is_target('Authenticated to 10.0.0.5 ([10.0.0.5]:22) using "publickey".', opts, "frame"))
self.assertTrue(fl.Link.is_target('Authenticated to frame.local ([10.0.0.5]:22) using "publickey".',
["-o", "HostName=FRAME.LOCAL"], "frame"))
def test_a_forward_the_jump_host_couldnt_open_tries_the_next_address(self):
said = ["Authenticated to bastion ([1.2.3.4]:22) using \"publickey\".",
+2 -1
View File
@@ -906,7 +906,8 @@ class Link:
(ssh -v passes its verbosity on to ProxyJump's own ssh)."""
host = next((o.split("=", 1)[1].replace("%%", "%") for o in opts if o.startswith("HostName=")), alias)
m = re.search(r"Authenticated to (\S+)", line)
return not m or m.group(1) in (host, alias) or "Authentication succeeded" in line
# OpenSSH lower-cases host names (FRAME.LOCAL logs as frame.local).
return not m or m.group(1).lower() in (host.lower(), alias.lower()) or "Authentication succeeded" in line
def failed(self, step, said, mismatch, alias):
text = "\n".join(said).strip()