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

Function cleanup_master_password

web/pgadmin/utils/master_password.py:115–136  ·  view source on GitHub ↗

Remove the master password and saved passwords from DB which are encrypted using master password. Also remove the encrypted text

()

Source from the content-addressed store, hash-verified

113
114
115def cleanup_master_password():
116 """
117 Remove the master password and saved passwords from DB which are
118 encrypted using master password. Also remove the encrypted text
119 """
120
121 # also remove the master password check string as it will help if master
122 # password entered/enabled again
123 set_masterpass_check_text('', clear=True)
124
125 from pgadmin.browser.server_groups.servers.utils \
126 import remove_saved_passwords
127 remove_saved_passwords(current_user.id)
128
129 current_app.keyManager.hard_reset()
130
131 from pgadmin.utils.driver import get_driver
132 driver = get_driver(config.PG_DEFAULT_DRIVER)
133
134 for server in Server.query.filter_by(user_id=current_user.id).all():
135 manager = driver.connection_manager(server.id)
136 manager.update(server)
137
138
139def delete_local_storage_master_key():

Callers 2

reset_master_passwordFunction · 0.90

Calls 6

remove_saved_passwordsFunction · 0.90
get_driverFunction · 0.90
hard_resetMethod · 0.80
connection_managerMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected