craig-rueda commented on code in PR #21912:
URL: https://github.com/apache/superset/pull/21912#discussion_r1046323588


##########
superset/models/core.py:
##########
@@ -368,14 +372,37 @@ def get_sqla_engine_with_context(
         schema: Optional[str] = None,
         nullpool: bool = True,
         source: Optional[utils.QuerySource] = None,
+        override_ssh_tunnel: Optional["SSHTunnel"] = None,
     ) -> Engine:
-        yield self._get_sqla_engine(schema=schema, nullpool=nullpool, 
source=source)
+        ssh_params = {}
+        from superset.databases.dao import (  # pylint: 
disable=import-outside-toplevel
+            DatabaseDAO,
+        )
+
+        if ssh_tunnel := override_ssh_tunnel or DatabaseDAO.get_ssh_tunnel(
+            database_id=self.id
+        ):
+            # if ssh_tunnel is available build engine with information
+            url = make_url_safe(self.sqlalchemy_uri_decrypted)

Review Comment:
   This block should be managed by a `SSHManager` that is configured via 
app_config. It's currently not possible for other folks to update the behavior 
of the tunneling mechanism



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to