Added configurable parameter to enable support for PasswordExecCommand in server mode. #6792

This commit is contained in:
Yogesh Mahajan 2024-01-12 04:04:40 -08:00 committed by GitHub
parent b28df5874e
commit 2d08b0dd13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -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
#############################################################################

View File

@ -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})

View File

@ -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',

View File

@ -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',