MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / _password_check

Function _password_check

web/pgadmin/browser/server_groups/servers/utils.py:238–249  ·  view source on GitHub ↗
(server, manager, old_key, new_key)

Source from the content-addressed store, hash-verified

236
237
238def _password_check(server, manager, old_key, new_key):
239 # Check if old password was stored in pgadmin4 sqlite database.
240 # If yes then update that password.
241 if server.password is not None:
242 password = decrypt(server.password, old_key)
243
244 if isinstance(password, bytes):
245 password = password.decode()
246
247 password = encrypt(password, new_key)
248 setattr(server, 'password', password)
249 manager.password = password
250
251
252def migrate_passwords_from_os_secret_storage(servers, enc_key):

Callers 1

Calls 3

decryptFunction · 0.90
encryptFunction · 0.90
decodeMethod · 0.80

Tested by

no test coverage detected