Skip to content

Commit 34b618d

Browse files
authored
add support for password_auth_requested (#103)
1 parent 084690b commit 34b618d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dvc_ssh/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,16 @@ async def kbdint_challenge_received(
124124
p = await _getpass(f"{prompt_prefix}{prompt}")
125125
response.append(p.rstrip())
126126
return response
127+
128+
async def password_auth_requested(self) -> str:
129+
assert self._conn is not None
130+
options = self._conn._options
131+
prompt = "Password: "
132+
addr = "@".join(filter(None, (options.username, options.host)))
133+
if addr:
134+
prompt = f"{addr}'s password: "
135+
136+
# NOTE: we write an extra line otherwise the prompt will be written on
137+
# the same line as any active tqdm progress bars
138+
sys.stderr.write(os.linesep)
139+
return await _getpass(prompt)

0 commit comments

Comments
 (0)