Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically updating servers from without overwriting them #7426

Open
maxnitze opened this issue Apr 25, 2024 · 5 comments
Open

Programmatically updating servers from without overwriting them #7426

maxnitze opened this issue Apr 25, 2024 · 5 comments

Comments

@maxnitze
Copy link

I installed pgadmin in Kubernetes and added a sidecar to auto-import servers created as configmaps in the pgadmin namespace (using https://github.com/kiwigrid/k8s-sidecar).

To get the servers into pgadmin I compile them all into one servers.json (making sure they are all Shared) and call setup.py load-servers --replace servers.json in the main pgadmin container with the admin user.

This works quite well in general. All servers are created, updated and deleted from the list for all users (the users login with Keycloak/Oauth2).

BUT: Every time something changed (server was added, changed, deleted) and the load-servers command ran, the saved passwords of all users are gone. My guess is, that the --replace deletes the reference somehow.

I already tried to use stable keys in the servers.json and removing the --replace hpoing, that this will update the existing entries. But it seems to just add new entries then.

Is there the possibility to update all servers without loosing the saved passwords for all users?

Thanks in advance!

@khushboovashi
Copy link
Contributor

Hi @maxnitze,

That's the behaviour of the feature; --replace removes the old server entries and adds them again.
We can think of an enhancement that will update the existing servers on some mapping ( which needs to be identified).

@maxnitze
Copy link
Author

Is there another way to update an existing server programmatically?

@khushboovashi
Copy link
Contributor

Apart from GUI, there is no other way to do it now.

@maxnitze
Copy link
Author

Okay. So from my perspective there are multiple ways to solve my specific problem:

  • provide an API to update existing servers
  • update exiwting servers in replace mode (based on connection string?)
  • bind saved passwords to connection strings instead of servers (security implications?)

What do you think?

@cbandy
Copy link

cbandy commented Apr 26, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants