diff --git a/dvc/config_schema.py b/dvc/config_schema.py index 13590cf97..16033cb38 100644 --- a/dvc/config_schema.py +++ b/dvc/config_schema.py @@ -180,6 +180,8 @@ SCHEMA = { "user": str, "password": str, "ask_password": Bool, + "passphrase": str, + "ask_passphrase": Bool, "keyfile": str, "timeout": Coerce(int), "gss_auth": Bool, diff --git a/setup.cfg b/setup.cfg index 199e80540..2921816d2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -95,11 +95,11 @@ hdfs = dvc-hdfs==2.19.0; python_version < '3.11' oss = dvc-oss==2.19.0 s3 = dvc-s3==2.20.1 -ssh = dvc-ssh==2.19.0 +ssh = dvc-ssh==2.20.0 # gssapi should not be included in all_remotes, because it doesn't have wheels # for Linux, so it will fail to compile if user doesn't have all the # requirements, including kerberos itself. -ssh_gssapi = dvc-ssh[gssapi]==2.19.0 +ssh_gssapi = dvc-ssh[gssapi]==2.20.0 webdav = dvc-webdav==2.19.0 webhdfs = dvc-webhdfs==2.19.0 # requests-kerberos requires krb5 & gssapi, which does not provide wheels Linux @@ -109,7 +109,7 @@ testing = pytest-test-utils==0.0.8 tests = %(terraform)s - dvc-ssh==2.19.0 + dvc-ssh==2.20.0 # Test requirements pytest==7.1.3 pytest-cov==4.0.0 diff --git a/tests/unit/fs/test_ssh.py b/tests/unit/fs/test_ssh.py index 1a379ad08..512327ae0 100644 --- a/tests/unit/fs/test_ssh.py +++ b/tests/unit/fs/test_ssh.py @@ -34,18 +34,25 @@ def test_get_kwargs_from_urls(): def test_init(): fs = SSHFileSystem( - user="test", host="12.34.56.78", port="1234", password="xxx" + user="test", + host="12.34.56.78", + port="1234", + password="xxx", + passphrase="yyy", ) assert fs.fs_args["username"] == "test" assert fs.fs_args["host"] == "12.34.56.78" assert fs.fs_args["port"] == "1234" - assert fs.fs_args["password"] == fs.fs_args["passphrase"] == "xxx" + assert fs.fs_args["password"] == "xxx" + assert fs.fs_args["passphrase"] == "yyy" -def test_ssh_ask_password(mocker): +@pytest.mark.parametrize("option", ("password", "passphrase")) +def test_ssh_ask_password(mocker, option): mocker.patch("dvc_ssh.ask_password", return_value="fish") - fs = SSHFileSystem(user="test", host="2.2.2.2", ask_password=True) - assert fs.fs_args["password"] == fs.fs_args["passphrase"] == "fish" + args = {f"ask_{option}": True} + fs = SSHFileSystem(user="test", host="2.2.2.2", **args) + assert fs.fs_args[option] == "fish" mock_ssh_config = """