You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2022/10/21 16:38:44 UTC

[superset] branch create-sshtunnelconfig-tbl updated: created schema and rename

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch create-sshtunnelconfig-tbl
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/create-sshtunnelconfig-tbl by this push:
     new f78df83746 created schema and rename
f78df83746 is described below

commit f78df837462871971790852432b44b29b5256793
Author: hughhhh <hu...@gmail.com>
AuthorDate: Fri Oct 21 09:38:08 2022 -0700

    created schema and rename
---
 superset/databases/models.py  |  4 ++--
 superset/databases/schemas.py | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/superset/databases/models.py b/superset/databases/models.py
index f1dfe5f1aa..f13c04350f 100644
--- a/superset/databases/models.py
+++ b/superset/databases/models.py
@@ -60,9 +60,9 @@ class SSHTunnelCredentials(
     )
 
     # password protected pkey authentication
-    pkey = sa.Column(
+    private_key = sa.Column(
         sa.EncryptedType(sa.String, app_config["SECRET_KEY"]), nullable=True
     )
-    private_key = sa.Column(
+    private_key_password = sa.Column(
         sa.EncryptedType(sa.String, app_config["SECRET_KEY"]), nullable=True
     )
diff --git a/superset/databases/schemas.py b/superset/databases/schemas.py
index dafd1ba7fc..bb1153b76d 100644
--- a/superset/databases/schemas.py
+++ b/superset/databases/schemas.py
@@ -676,6 +676,26 @@ class EncryptedDict(EncryptedField, fields.Dict):
     pass
 
 
+class DatabaseSSHTunnelCredentials(Schema):
+    id = fields.Integer()
+    database_id = fields.Integer()
+
+    server_address = fields.String()
+    server_port = fields.Integer()
+    username = fields.String()
+
+    # Basic Authentication
+    password = fields.String(required=False)
+
+    # password protected private key authentication
+    private_key = fields.String(required=False)
+    private_key_password = fields.String(required=False)
+
+    # remote binding port
+    bind_host = fields.String()
+    bind_port = fields.Integer()
+
+
 def encrypted_field_properties(self, field: Any, **_) -> Dict[str, Any]:  # type: ignore
     ret = {}
     if isinstance(field, EncryptedField):