Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Password Exec properties not included in import/export servers #6258

@markdonohue

Description

@markdonohue

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:

  1. Set "Password exec command" and "Password exec expiration (seconds)" for a server
  2. Click on "Tools", "Import/Export Servers..."
  3. Export the server
  4. 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)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions