From 5064bfa656e5d22530ec6449269a1c3643659f37 Mon Sep 17 00:00:00 2001 From: Gyandeep Singh Date: Tue, 15 Oct 2024 12:54:51 -0500 Subject: [PATCH] SSHHook expose auth_timeout parameter --- providers/src/airflow/providers/ssh/hooks/ssh.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/providers/src/airflow/providers/ssh/hooks/ssh.py b/providers/src/airflow/providers/ssh/hooks/ssh.py index e5ce9ec27cfe5..ecd3990d06b9a 100644 --- a/providers/src/airflow/providers/ssh/hooks/ssh.py +++ b/providers/src/airflow/providers/ssh/hooks/ssh.py @@ -74,6 +74,7 @@ class SSHHook(BaseHook): iterable of algorithm identifiers, which will be disabled for the lifetime of the transport :param ciphers: list of ciphers to use in order of preference + :param auth_timeout: timeout (in seconds) for the attempt to authenticate with the remote_host """ # List of classes to try loading private keys as, ordered (roughly) by most common to least common @@ -121,6 +122,7 @@ def __init__( banner_timeout: float = 30.0, disabled_algorithms: dict | None = None, ciphers: list[str] | None = None, + auth_timeout: int | None = None, ) -> None: super().__init__() self.ssh_conn_id = ssh_conn_id @@ -138,6 +140,7 @@ def __init__( self.disabled_algorithms = disabled_algorithms self.ciphers = ciphers self.host_proxy_cmd = None + self.auth_timeout = auth_timeout # Default values, overridable from Connection self.compress = True @@ -332,6 +335,7 @@ def get_conn(self) -> paramiko.SSHClient: "sock": self.host_proxy, "look_for_keys": self.look_for_keys, "banner_timeout": self.banner_timeout, + "auth_timeout": self.auth_timeout, } if self.password: