Skip to content

Commit

Permalink
SSHHook expose auth_timeout parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gyandeeps committed Oct 16, 2024
1 parent 75b2294 commit 5064bfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/src/airflow/providers/ssh/hooks/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5064bfa

Please sign in to comment.