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 2023/01/05 21:22:01 UTC

[GitHub] [superset] hughhhh commented on a diff in pull request #22513: feat(ssh_tunnel): SQLAlchemy Form UI

hughhhh commented on code in PR #22513:
URL: https://github.com/apache/superset/pull/22513#discussion_r1062906759


##########
superset/databases/ssh_tunnel/dao.py:
##########
@@ -24,3 +26,27 @@
 
 class SSHTunnelDAO(BaseDAO):
     model_cls = SSHTunnel
+
+    @classmethod
+    def update(
+        cls,
+        model: SSHTunnel,
+        properties: Dict[str, Any],
+        commit: bool = True,
+    ) -> SSHTunnel:
+        """
+        Unmask ``password``, ``private_key`` and ``private_key_password`` before updating.
+
+        When a database is edited the user sees a masked version of
+        the aforementioned fields.
+
+        The masked values should be unmasked before the ssh tunnel is updated.
+        """
+        if properties.get("password") == PASSWORD_MASK:
+            properties["password"] = model.password

Review Comment:
   we should move this logic to the frontend, basically if the field hasn't been updated we shouldn't send it in the payload



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