You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/29 18:59:09 UTC

[GitHub] [superset] craig-rueda commented on a diff in pull request #22201: feat(ssh-tunnel): ssh manager config + feature flag

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


##########
superset/config.py:
##########
@@ -471,8 +471,46 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
     "DRILL_TO_DETAIL": False,
     "DATAPANEL_CLOSED_BY_DEFAULT": False,
     "HORIZONTAL_FILTER_BAR": False,
+    # Allow users to enable ssh tunneling when creating a DB.
+    # Users must check whether the DB engine supports SSH Tunnels
+    # otherwise enabling this flag won't have any effect on the DB.
+    "SSH_TUNNELING": False,
 }
 
+# ------------------------------
+# SSH Tunnel
+# ------------------------------
+# Allow users to set the host used when connecting to the SSH Tunnel
+# as localhost and any other alias (0.0.0.0)
+# ----------------------------------------------------------------------
+#                             |
+# -------------+              |    +----------+
+#     LOCAL    |              |    |  REMOTE  | :22 SSH
+#     CLIENT   | <== SSH ========> |  SERVER  | :8080 web service
+# -------------+              |    +----------+
+#                             |
+#                          FIREWALL (only port 22 is open)
+
+# ----------------------------------------------------------------------
+# class SSHManager:
+#      def validate(self, ssh_tunnel_params: Dict[str, Any]) -> None:
+#          # validation on CREATE + UPDATE on SSHTunnel Model
+#          # to block a request this function most raise an exception
+#          raise NotImplemented()
+
+#      def mutator(self, ssh_tunnel_params: Dict[str, Any]) -> Dict[str, Any]:
+#          # override any ssh tunnel configuration object
+#          raise NotImplemented()
+
+#      @property
+#      def local_bind_address(self):
+#          # set the local binding address for the local client
+#          # the port will be dynamically configured by the sshtunnel.SSHTunnelForwarder
+#         # `server` return value
+#         return "127.0.0.1"
+
+SSH_TUNNEL_MANAGER = None

Review Comment:
   Should we provide a default impl here?



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org