From 228156d0b6eb05e4779d886dafe7e0be63834f8f Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Wed, 29 Jan 2025 19:43:23 +0530 Subject: [PATCH] 1) Fixed an issue where the ad-hoc server with SSH Tunnel repeatedly prompted for the password. 2) Fixed an issue where the SSH Tunnel password was not being saved in the External Database if its encoded length exceeded 64 characters. 3) 'Save Password' check box should be hidden for SSH Tunnel password on the Welcome page. --- web/migrations/versions/255e2842e4d7_.py | 3 +++ web/migrations/versions/aa86fb60b73d_.py | 2 +- web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx | 1 + web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/migrations/versions/255e2842e4d7_.py b/web/migrations/versions/255e2842e4d7_.py index 1798dc25b27..23b0e9fea3e 100644 --- a/web/migrations/versions/255e2842e4d7_.py +++ b/web/migrations/versions/255e2842e4d7_.py @@ -32,6 +32,9 @@ def upgrade(): batch_op.alter_column('id', autoincrement=True) batch_op.add_column(sa.Column('is_adhoc', sa.Integer(), server_default='0')) + batch_op.alter_column('tunnel_password', + existing_type=sa.String(length=64), + type_=sa.String()) def downgrade(): diff --git a/web/migrations/versions/aa86fb60b73d_.py b/web/migrations/versions/aa86fb60b73d_.py index 28289144779..81faa2f3119 100644 --- a/web/migrations/versions/aa86fb60b73d_.py +++ b/web/migrations/versions/aa86fb60b73d_.py @@ -24,7 +24,7 @@ def upgrade(): - op.add_column('server', sa.Column('tunnel_password', sa.String(length=64))) + op.add_column('server', sa.Column('tunnel_password', sa.String())) def downgrade(): diff --git a/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx b/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx index b37e70fa06c..c9bda12427c 100644 --- a/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx +++ b/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx @@ -482,6 +482,7 @@ export default function AdHocConnection({mode}) { data={error.response?.data?.result} onOK={(okFormData)=>{ formData['password'] = okFormData.get('password'); + formData['tunnel_password'] = okFormData.get('tunnel_password'); onSaveClick(isNew, formData); }} hideSavePassword={true} diff --git a/web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx b/web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx index 762b58ef027..9696959cf74 100644 --- a/web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx +++ b/web/pgadmin/static/js/Dialogs/ConnectServerContent.jsx @@ -73,7 +73,7 @@ export default function ConnectServerContent({closeModal, data, onOK, setHeight, onTextChange(e, 'tunnel_password')} onKeyDown={(e)=>onKeyDown(e)} /> - + onTextChange(e.target.checked, 'save_tunnel_password')} disabled={!data.allow_save_tunnel_password} />