From fc1a1610a3006a1aabd161d267e23bf7bfb9aab0 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 20 Mar 2025 15:49:43 +0530 Subject: [PATCH] Ensure the newly added parameters in the server dialog are incorporated into the Import/Export Servers functionality. #8514 --- docs/en_US/import_export_servers.rst | 39 +++++++++++++++++----------- docs/en_US/release_notes_9_2.rst | 4 ++- web/pgadmin/utils/__init__.py | 18 +++++++++++++ 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/docs/en_US/import_export_servers.rst b/docs/en_US/import_export_servers.rst index c93b07ea8..ab2b27e15 100644 --- a/docs/en_US/import_export_servers.rst +++ b/docs/en_US/import_export_servers.rst @@ -148,41 +148,50 @@ The following example shows both a minimally defined and a fully defined server: "Port": 5432, "Username": "postgres", "Host": "localhost", - "SSLMode": "prefer", - "MaintenanceDB": "postgres" + "MaintenanceDB": "postgres", + "ConnectionParameters": { + "sslmode": "prefer", + "connect_timeout": 10 + } }, "2": { "Name": "Fully Defined Server", "Group": "Server Group 2", "Host": "host.domain.com", - "HostAddr": "192.168.1.2", "Port": 5432, "MaintenanceDB": "postgres", "Username": "postgres", "Role": "my_role_name", - "SSLMode": "require", "Comment": "This server has every option configured in the JSON", "DBRestriction": "live_db test_db", - "PassFile": "/path/to/pgpassfile", - "SSLCert": "/path/to/sslcert.crt", - "SSLKey": "/path/to/sslcert.key", - "SSLRootCert": "/path/to/sslroot.crt", - "SSLCrl": "/path/to/sslcrl.crl", - "SSLCompression": 1, "Shared": false, "SharedUsername": "postgres", "BGColor": "#ff9900", "FGColor": "#000000", "Service": "postgresql-10", - "Timeout": 60, "UseSSHTunnel": 1, "TunnelHost": "192.168.1.253", "TunnelPort": 22, "TunnelUsername": "username", - "TunnelAuthentication": 0, + "TunnelAuthentication": 1, + "TunnelIdentityFile": "/Users//.ssh/id_rsa.pub", + "TunnelKeepAlive": 30, "PasswordExecCommand": "echo 'test'", - "PasswordExecExpiration": 100 + "PasswordExecExpiration": 100, + "KerberosAuthentication": true, + "ConnectionParameters": { + "sslmode": "prefer", + "connect_timeout": 10, + "passfile": "/Users//.pgpass", + "sslcert": "/Users//.ssh/cert" + }, + "Tags": [ + { + "color": "#EC0BB4", + "text": "Development" + } + ], + "PostConnectionSQL": "set timezone='America/New_York'" } } - } - + } \ No newline at end of file diff --git a/docs/en_US/release_notes_9_2.rst b/docs/en_US/release_notes_9_2.rst index 6dc467ff6..094bc3926 100644 --- a/docs/en_US/release_notes_9_2.rst +++ b/docs/en_US/release_notes_9_2.rst @@ -40,4 +40,6 @@ Bug fixes | `Issue #8437 `_ - Fixed an issue where the PSQL terminal displays keyname for non alphanumeric keys. | `Issue #8462 `_ - Fixed an issue where geometries in the geometry viewer will render partially when the container was resized. | `Issue #8473 `_ - Change the stop/terminate icon at all the places for better UX. - | `Issue #8479 `_ - Fixed an issue where the Schema Diff was not displaying the difference query when a table had a UNIQUE NULLS NOT DISTINCT constraint. \ No newline at end of file + | `Issue #8479 `_ - Fixed an issue where the Schema Diff was not displaying the difference query when a table had a UNIQUE NULLS NOT DISTINCT constraint. + | `Issue #8514 `_ - Ensure the newly added parameters in the server dialog are incorporated into the Import/Export Servers functionality. + | `Issue #8546 `_ - Fixed an issue where updating the grantee was not correctly applying the privileges. \ No newline at end of file diff --git a/web/pgadmin/utils/__init__.py b/web/pgadmin/utils/__init__.py index 9c344f84c..4f2ebc432 100644 --- a/web/pgadmin/utils/__init__.py +++ b/web/pgadmin/utils/__init__.py @@ -522,11 +522,19 @@ def dump_database_servers(output_file, selected_servers, add_value(attr_dict, "TunnelUsername", server.tunnel_username) add_value(attr_dict, "TunnelAuthentication", server.tunnel_authentication) + add_value(attr_dict, "TunnelIdentityFile", + server.tunnel_identity_file) + add_value(attr_dict, "TunnelKeepAlive", + server.tunnel_keep_alive) add_value(attr_dict, "KerberosAuthentication", server.kerberos_conn), add_value(attr_dict, "ConnectionParameters", server.connection_params) add_value(attr_dict, "Tags", server.tags) + add_value(attr_dict, "PrepareThreshold", + server.prepare_threshold) + add_value(attr_dict, "PostConnectionSQL", + server.post_connection_sql) # if desktop mode or server mode with # ENABLE_SERVER_PASS_EXEC_CMD flag is True @@ -759,6 +767,12 @@ def load_database_servers(input_file, selected_servers, new_server.tunnel_authentication = \ obj.get("TunnelAuthentication", None) + new_server.tunnel_identity_file = \ + obj.get("TunnelIdentityFile", None) + + new_server.tunnel_keep_alive = \ + obj.get("TunnelKeepAlive", None) + new_server.shared = obj.get("Shared", None) new_server.shared_username = obj.get("SharedUsername", None) @@ -767,6 +781,10 @@ def load_database_servers(input_file, selected_servers, new_server.tags = obj.get("Tags", None) + new_server.prepare_threshold = obj.get("PrepareThreshold", None) + + new_server.post_connection_sql = obj.get("PostConnectionSQL", None) + # if desktop mode or server mode with # ENABLE_SERVER_PASS_EXEC_CMD flag is True if not current_app.config['SERVER_MODE'] or \