Added support to use standard OS secret store to save server/ssh tunnel passwords instead of master password in pgAdmin desktop mode. #5123

This commit is contained in:
Nikhil Mohite
2023-05-22 11:08:29 +05:30
committed by GitHub
parent e2b27da2ef
commit 736879567f
12 changed files with 317 additions and 91 deletions
+10
View File
@@ -9,6 +9,7 @@
import os
import sys
import keyring
# User configs loaded from config_local, config_distro etc.
custom_config_settings = {}
@@ -114,4 +115,13 @@ def evaluate_and_patch_config(config: dict) -> dict:
# Enable PSQL in Desktop Mode.
config['ENABLE_PSQL'] = True
if config.get('SERVER_MODE'):
config.setdefault('DISABLED_LOCAL_PASSWORD_STORAGE', True)
else:
k_name = keyring.get_keyring().name
if k_name == 'fail Keyring':
config.setdefault('DISABLED_LOCAL_PASSWORD_STORAGE', True)
else:
config.setdefault('DISABLED_LOCAL_PASSWORD_STORAGE', False)
return config