nailo2c commented on code in PR #69191:
URL: https://github.com/apache/airflow/pull/69191#discussion_r3548548464
##########
providers/ssh/src/airflow/providers/ssh/hooks/ssh.py:
##########
@@ -88,16 +88,16 @@ class SSHHook(BaseHook):
"""
# List of classes to try loading private keys as, ordered (roughly) by
most common to least common
+ # Note: DSSKey (DSA) support was removed in paramiko 4.0+, so it is no
longer offered here.
+ # Users relying on DSA keys must migrate to RSA, ECDSA, or Ed25519 keys.
_pkey_loaders: Sequence[type[paramiko.PKey]] = (
paramiko.RSAKey,
paramiko.ECDSAKey,
paramiko.Ed25519Key,
- paramiko.DSSKey,
)
_host_key_mappings = {
"rsa": paramiko.RSAKey,
- "dss": paramiko.DSSKey,
Review Comment:
Also, add a small regression test might be better I think :)
##########
providers/ssh/src/airflow/providers/ssh/hooks/ssh.py:
##########
@@ -88,16 +88,16 @@ class SSHHook(BaseHook):
"""
# List of classes to try loading private keys as, ordered (roughly) by
most common to least common
+ # Note: DSSKey (DSA) support was removed in paramiko 4.0+, so it is no
longer offered here.
+ # Users relying on DSA keys must migrate to RSA, ECDSA, or Ed25519 keys.
_pkey_loaders: Sequence[type[paramiko.PKey]] = (
paramiko.RSAKey,
paramiko.ECDSAKey,
paramiko.Ed25519Key,
- paramiko.DSSKey,
)
_host_key_mappings = {
"rsa": paramiko.RSAKey,
- "dss": paramiko.DSSKey,
Review Comment:
I think we should add a handler or document to avoid regression. For
example, if users configured `ssh-dss` in `host_key` and then upgrade the ssh
provider, this can fail with a `KeyError`.
e.g.
A connection like this:
```python
Connection(
conn_id="ssh_with_dss_host_key",
host="localhost",
conn_type="ssh",
extra=json.dumps({"host_key": "ssh-dss AAAAB3NzaC1kc3MAAAAA"}),
)
```
would fail here because `dss` has been removed from `_host_key_mappings`:
https://github.com/apache/airflow/blob/4d56e6c93dd8c0ff69c603789a837abcea77f7d8/providers/ssh/src/airflow/providers/ssh/hooks/ssh.py#L229-L232
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]