File tree Expand file tree Collapse file tree
web/pgadmin/utils/driver/psycopg3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import asyncio
2020import copy
2121from collections import deque
22+ from pathlib import Path
2223import psycopg
2324from flask import g , current_app
2425from flask_babel import gettext
@@ -281,7 +282,6 @@ def connect(self, **kwargs):
281282 password , encpass , is_update_password = \
282283 self ._check_user_password (kwargs )
283284
284- passfile = kwargs ['passfile' ] if 'passfile' in kwargs else None
285285 tunnel_password = kwargs ['tunnel_password' ] if 'tunnel_password' in \
286286 kwargs else ''
287287
@@ -313,6 +313,11 @@ def connect(self, **kwargs):
313313 if is_error :
314314 return False , errmsg
315315
316+ # Retrieve password from passfile if one has not been set yet.
317+ passfile = Path (kwargs ['passfile' ]) if 'passfile' in kwargs else None
318+ if not password and passfile :
319+ password = passfile .read_text ()
320+
316321 # If no password credential is found then connect request might
317322 # come from Query tool, ViewData grid, debugger etc tools.
318323 # we will check for pgpass file availability from connection manager
You can’t perform that action at this time.
0 commit comments