mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add Password exec command and Expiration time to server export JSON and also allow them to import. #6258
This commit is contained in:
@@ -178,7 +178,9 @@ The following example shows both a minimally defined and a fully defined server:
|
||||
"TunnelHost": "192.168.1.253",
|
||||
"TunnelPort": 22,
|
||||
"TunnelUsername": "username",
|
||||
"TunnelAuthentication": 0
|
||||
"TunnelAuthentication": 0,
|
||||
"PasswordExecCommand": "echo 'test'",
|
||||
"PasswordExecExpiration": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,6 +309,7 @@ export default class ServerSchema extends BaseUISchema {
|
||||
id: 'passexec_cmd', label: gettext('Password exec command'), type: 'text',
|
||||
group: gettext('Advanced'),
|
||||
mode: ['properties', 'edit', 'create'],
|
||||
disabled: pgAdmin.server_mode == 'True',
|
||||
},
|
||||
{
|
||||
id: 'passexec_expiration', label: gettext('Password exec expiration (seconds)'), type: 'int',
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
"TunnelHost": "192.168.1.253",
|
||||
"TunnelPort": "22",
|
||||
"TunnelUsername": "username",
|
||||
"TunnelAuthentication": 0
|
||||
"TunnelAuthentication": 0,
|
||||
"PasswordExecCommand": "echo 'test'",
|
||||
"PasswordExecExpiration": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,6 +486,13 @@ def dump_database_servers(output_file, selected_servers,
|
||||
add_value(attr_dict, "ConnectionParameters",
|
||||
server.connection_params)
|
||||
|
||||
# if desktop mode
|
||||
if not current_app.config['SERVER_MODE']:
|
||||
add_value(attr_dict, "PasswordExecCommand",
|
||||
server.passexec_cmd)
|
||||
add_value(attr_dict, "PasswordExecExpiration",
|
||||
server.passexec_expiration)
|
||||
|
||||
servers_dumped = servers_dumped + 1
|
||||
|
||||
server_dict[servers_dumped] = attr_dict
|
||||
@@ -711,6 +718,12 @@ def load_database_servers(input_file, selected_servers,
|
||||
|
||||
new_server.kerberos_conn = obj.get("KerberosAuthentication", None)
|
||||
|
||||
# if desktop mode
|
||||
if not current_app.config['SERVER_MODE']:
|
||||
new_server.passexec_cmd = obj.get("PasswordExecCommand", None)
|
||||
new_server.passexec_expiration = obj.get(
|
||||
"PasswordExecExpiration", None)
|
||||
|
||||
db.session.add(new_server)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user