Remove the master password and saved passwords from DB which are encrypted using master password. Also remove the encrypted text
()
| 113 | |
| 114 | |
| 115 | def 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 | |
| 139 | def delete_local_storage_master_key(): |
no test coverage detected