diff --git a/web/config.py b/web/config.py index 68d86036c..611cd2adb 100644 --- a/web/config.py +++ b/web/config.py @@ -909,6 +909,14 @@ AUTO_DISCOVER_SERVERS = True ############################################################################# SERVER_HEARTBEAT_TIMEOUT = 30 # In seconds +############################################################################# +# ENABLE_SERVER_PASS_EXEC_CMD is used to enable/disable Password exec command +# field in server properties. This is used to specify a shell command to be +# executed to retrieve a password to be used for server authentication. +# This setting is applicable only for server mode. +############################################################################# +ENABLE_SERVER_PASS_EXEC_CMD = False + ############################################################################# # Patch the default config with custom config and other manipulations ############################################################################# diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py index 8c5bd777d..90c42b935 100644 --- a/web/pgadmin/browser/__init__.py +++ b/web/pgadmin/browser/__init__.py @@ -568,6 +568,7 @@ def utils(): shared_storage_list=shared_storage_list, restricted_shared_storage_list=[] if current_user.has_role( "Administrator") else restricted_shared_storage_list, + enable_server_passexec_cmd=config.ENABLE_SERVER_PASS_EXEC_CMD, ), 200, {'Content-Type': MIMETYPE_APP_JS}) diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js index ecbf7cfbf..3f640d457 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js @@ -347,7 +347,7 @@ export default class ServerSchema extends BaseUISchema { id: 'passexec_cmd', label: gettext('Password exec command'), type: 'text', group: gettext('Advanced'), controlProps: {maxLength: null}, mode: ['properties', 'edit', 'create'], - disabled: pgAdmin.server_mode == 'True', + disabled: pgAdmin.server_mode == 'True' && pgAdmin.enable_server_passexec_cmd == 'False', }, { id: 'passexec_expiration', label: gettext('Password exec expiration (seconds)'), type: 'int', diff --git a/web/pgadmin/browser/templates/browser/js/utils.js b/web/pgadmin/browser/templates/browser/js/utils.js index b6f67956f..e0b338c83 100644 --- a/web/pgadmin/browser/templates/browser/js/utils.js +++ b/web/pgadmin/browser/templates/browser/js/utils.js @@ -71,6 +71,9 @@ define('pgadmin.browser.utils', /* Minimum password length */ pgAdmin['password_length_min'] = '{{password_length_min}}'; + /* Enable server password exec command */ + pgAdmin['enable_server_passexec_cmd'] = '{{enable_server_passexec_cmd}}'; + // Define list of nodes on which Query tool option doesn't appears let unsupported_nodes = pgAdmin.unsupported_nodes = [ 'server_group', 'server', 'coll-tablespace', 'tablespace',