dbt-sqlserver icon indicating copy to clipboard operation
dbt-sqlserver copied to clipboard

feat: adding support for bastion / jumpbox support

Open hugoJuhel opened this issue 4 years ago • 2 comments

Objective

The PR aims at adding supports for Jump / Bastions servers to the connector so that connecting to a server behind a VPN would be possible.

Proposed modifications

  • The code modifies the way the connection is opened by the adapter.
  • If provided with ssh_tunnel_host, ssh_tunnel_port, ssh_tunnel_username and one of either ssh_tunnel_password or ssh_tunnel_ssh_key_path, the adapter first establishes a sshtunnel to the jump host before connecting to the server.
  • The code uses sshtunnel to handles the tunnel creation.
  • A dataclass is introduced to bind the pyodbc.Connection.close method to the SSHTunnelForwarder.close method.
  • The dataclass is preferred over registering a callback in pyodbc since pyodbc.close attribute is not settable.

hugoJuhel avatar Jan 29 '22 22:01 hugoJuhel

Should be rebased on current master so that there are no formatting changes anymore

sdebruyn avatar May 22 '22 10:05 sdebruyn

@sdebruyn Hi,

I have just pushed a commits with everything rebased on master.

hj

hugoJuhel avatar Jun 13 '22 15:06 hugoJuhel

I'm not sure support for SSH tunneling should be a feature of this adapter that we would want to maintain, as well as an extra dependency that would not be needed for 99% of the users. Closing this for now.

sdebruyn avatar Sep 10 '22 20:09 sdebruyn