Skip to content

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Aug 18, 2022

Add password_as_passphrase flag to indicate whether the old behavior should be preserved or not. Defaults to True to keep old behavior by default.

Introduce new options passphrase and ask_passphrase.

Depends on updating config_schema on dvc repo.

Comment on lines 82 to 86
if (
config.get("password_as_passphrase", True)
and login_info["passphrase"] is None
):
login_info["passphrase"] = login_info["password"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, do we really need this option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the cleanest way I found to don't break users relying on old behavior while still allowing users to opt-out (i.e. for fixing iterative/dvc#8137).

Felt better than alternatives:

  • Trying to come up with conditions were misusing the asyncssh API might work.
    Doesn't seem scalable or right. New edge cases might show in the future.

  • Completely dropping old behavior.
    Would be a breaking change for users relying on it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for elaborating! Indeed, all options feel like a bit of a compromise. Considering that providing password/passphrase in the config is a bad practice and we even considered removing support for it, we can probably just drop old behaviour for the sake of correctness.

Though, another thing to note is that ask_* options are a bit of a legacy thing coming from paramiko's limitations, and asyncssh might be raising proper exceptions that would allow us to distinguish when we need to ask password or a passphrase. If you could confirm that, maybe we can just make ask_password and password obsolete and not add new options at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply

Got it, thanks for elaborating! Indeed, all options feel like a bit of a compromise. Considering that providing password/passphrase in the config is a bad practice and we even considered removing support for it, we can probably just drop old behaviour for the sake of correctness.

Dropped the old behavior and the smelly flag.

Though, another thing to note is that ask_* options are a bit of a legacy thing coming from paramiko's limitations, and asyncssh might be raising proper exceptions that would allow us to distinguish when we need to ask password or a passphrase. If you could confirm that, maybe we can just make ask_password and password obsolete and not add new options at all.

Let's merge this and consider that a follow-up. I opened an issue for that

@pmrowla
Copy link
Contributor

pmrowla commented Sep 16, 2022

related: ronf/asyncssh#426

@efiop
Copy link
Contributor

efiop commented Sep 16, 2022

@pmrowla WDYT about this PR, still relevant/correct?

@pmrowla
Copy link
Contributor

pmrowla commented Sep 16, 2022

I think this PR is probably fine for now. It would be nice to get rid of the ask_ options in favor of using something like callbacks as described in the asyncssh issue, but I don't think it's worth prioritizing that for us.

@efiop
Copy link
Contributor

efiop commented Oct 5, 2022

@daavoo Could you take a look at my comment above, please? #3 (comment)

Introduce new options `passphrase` and `ask_passphrase`.

Depends on updating config_schema on `dvc` repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants