-
Notifications
You must be signed in to change notification settings - Fork 808
Description
Describe the bug
When you use "Tools", "Import/Export Servers..." to export servers to a json file, the server properties "Password exec command" and "Password exec expiration (seconds)" (server.passexec_* fields) are not included in the export file (and likewise are not imported).
To Reproduce
Steps to reproduce the behavior:
- Set "Password exec command" and "Password exec expiration (seconds)" for a server
- Click on "Tools", "Import/Export Servers..."
- Export the server
- Notice those fields are missing in the json
Expected behavior
Fields should be included in the json file on export, and likewise set on import.
Desktop (please complete the following information):
- OS: Windows 10
- Version: 7.1
- Mode: Desktop
Additional context
This is useful to hand configurations for server landscapes to new colleagues in cases where external password management is used and integrated into pgAdmin (e.g. Hashicorp Vault).
An example on how to potentially fix this, in "web/pgadmin/utils/init.py", if you add the following lines, the fields are included on import/export...
Add to dump_database_servers:
add_value(attr_dict, "PasswordExecCommand", server.passexec_cmd)
add_value(attr_dict, "PasswordExecExpiration", server.passexec_expiration)
Add to load_database_servers:
new_server.passexec_cmd = obj.get("PasswordExecCommand", None)
new_server.passexec_expiration = obj.get("PasswordExecExpiration", None)