mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(ssh_tunnel): SQLAlchemy Form UI (#22513)
Co-authored-by: hughhhh <hughmil3s@gmail.com> Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
committed by
GitHub
parent
0908fd291b
commit
539936522f
@@ -18,6 +18,7 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
from superset.constants import PASSWORD_MASK
|
||||
from superset.databases.ssh_tunnel.models import SSHTunnel
|
||||
|
||||
|
||||
def mask_password_info(ssh_tunnel: Dict[str, Any]) -> Dict[str, Any]:
|
||||
@@ -28,3 +29,15 @@ def mask_password_info(ssh_tunnel: Dict[str, Any]) -> Dict[str, Any]:
|
||||
if ssh_tunnel.pop("private_key_password", None) is not None:
|
||||
ssh_tunnel["private_key_password"] = PASSWORD_MASK
|
||||
return ssh_tunnel
|
||||
|
||||
|
||||
def unmask_password_info(
|
||||
ssh_tunnel: Dict[str, Any], model: SSHTunnel
|
||||
) -> Dict[str, Any]:
|
||||
if ssh_tunnel.get("password") == PASSWORD_MASK:
|
||||
ssh_tunnel["password"] = model.password
|
||||
if ssh_tunnel.get("private_key") == PASSWORD_MASK:
|
||||
ssh_tunnel["private_key"] = model.private_key
|
||||
if ssh_tunnel.get("private_key_password") == PASSWORD_MASK:
|
||||
ssh_tunnel["private_key_password"] = model.private_key_password
|
||||
return ssh_tunnel
|
||||
|
||||
Reference in New Issue
Block a user