Skip to content

Commit

Permalink
add support for password_auth_requested (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Feb 5, 2025
1 parent 084690b commit 34b618d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dvc_ssh/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 34b618d

Please sign in to comment.