From 4d5e43540f8ed2bf2575c2391a58b23a7d97bf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Wed, 5 Feb 2025 11:28:38 +0545 Subject: [PATCH] add support for password_auth_requested --- dvc_ssh/client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dvc_ssh/client.py b/dvc_ssh/client.py index 451edfe..88cbc44 100644 --- a/dvc_ssh/client.py +++ b/dvc_ssh/client.py @@ -124,3 +124,16 @@ async def kbdint_challenge_received( p = await _getpass(f"{prompt_prefix}{prompt}") response.append(p.rstrip()) return response + + async def password_auth_requested(self) -> str: + assert self._conn is not None + options = self._conn._options + prompt = "Password: " + addr = "@".join(filter(None, (options.username, options.host))) + if addr: + prompt = f"{addr}'s password: " + + # NOTE: we write an extra line otherwise the prompt will be written on + # the same line as any active tqdm progress bars + sys.stderr.write(os.linesep) + return await _getpass(prompt)