Skip to content

Commit 5db808c

Browse files
committed
Revert "Read password from PassFile when connecting."
This reverts commit 7c9be2d.
1 parent 7c9be2d commit 5db808c

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

web/pgadmin/utils/driver/psycopg3/connection.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import secrets
1818
import datetime
1919
import asyncio
20+
import copy
2021
from collections import deque
21-
from pathlib import Path
2222
import psycopg
2323
from flask import g, current_app
2424
from flask_babel import gettext
@@ -281,6 +281,7 @@ def connect(self, **kwargs):
281281
password, encpass, is_update_password = \
282282
self._check_user_password(kwargs)
283283

284+
passfile = kwargs['passfile'] if 'passfile' in kwargs else None
284285
tunnel_password = kwargs['tunnel_password'] if 'tunnel_password' in \
285286
kwargs else ''
286287

@@ -312,15 +313,6 @@ def connect(self, **kwargs):
312313
if is_error:
313314
return False, errmsg
314315

315-
# Retrieve password from passfile, if one has not been set yet.
316-
passfile = Path(kwargs['passfile']) if 'passfile' in kwargs else None
317-
if not password and passfile:
318-
try:
319-
password = passfile.read_text(encoding='utf-8').strip()
320-
except (OSError, UnicodeDecodeError) as e:
321-
error = _("Failed to read PassFile.\nError: {0}").format(str(e))
322-
return False, error
323-
324316
# If no password credential is found then connect request might
325317
# come from Query tool, ViewData grid, debugger etc tools.
326318
# we will check for pgpass file availability from connection manager

0 commit comments

Comments
 (0)