pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Can not get or set password in keyring during connecting.

Open CHNB128 opened this issue 5 years ago • 0 comments

Description

I trying to use keyring integration in pgcli, pgcli take responsibility to seting and getting password during connection to database. I take a look into pgcli implementation, all seams ok, but in general getting password don't work. Then I tried to make same process by hand, and got that get_password function don't return anything. I thought that it was cause keyring haven't anything to return. I make set by hand, all seams ok, but get_password return nothing as well.

To Reproduce Steps to reproduce the behavior:

  1. pip install keyring
  2. pip install bitwarden-keyring
  3. yay -S bitwarden-cli
  4. pip install pgcli
  5. pgcli -h localhost -U postgres -W 5.1 then pgcli connection to bitwarden and ask master password to get password for connect 5.2 I provide master password. 5.3 Them pgcli request password, even if I have one in bw.
  6. I successfuly connected
  7. Make disconnect
  8. Connect again 8.1 Same steps as in step 5, so nothing saved and nothing getting from bw.

Your environment

➜ uname -a               
Linux gnome 5.6.12-arch1-1 #1 SMP PREEMPT Sun, 10 May 2020 10:43:42 +0000 x86_64 GNU/Linux
➜ pgcli -v                                                                        
Version: 3.0.0
➜ bw --version
1.9.1
➜ pip freeze                   
airdrop-ng==1.1
airgraph-ng==1.1
alabaster==0.7.12
appdirs==1.4.4
asn1crypto==1.3.0
attrs==19.3.0
Babel==2.8.0
backcall==0.1.0
backports.csv==1.0.7
bcrypt==3.1.7
beautifulsoup4==4.9.1
bitwarden-keyring==0.3.0
bleach==3.1.5
btrfsutil==1.2.0
CacheControl==0.12.6
cached-property==1.5.1
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cli-helpers==1.2.0
click==7.1.1
colorama==0.4.3
configobj==5.0.6
contextlib2==0.6.0.post1
cryptography==2.9.2
decorator==4.4.2
deepspeech==0.6.0
deepspeech-gpu==0.6.0
defusedxml==0.6.0
distlib==0.3.0
distro==1.5.0
docker==4.2.0
docker-compose==1.25.5
docker-pycreds==0.4.0
dockerpty==0.4.1
docopt==0.6.2
docutils==0.16
entrypoints==0.3
enum-compat==0.0.3
evdev==1.3.0
feedparser==5.2.1
filelock==3.0.12
future==0.18.2
greenlet==0.4.15
guake==3.7.0
html5lib==1.0.1
humanize==0.5.1
i3-workspace-groups==0.4.6
i3ipc==2.1.1
idna==2.9
imagesize==1.2.0
importlib-metadata==1.5.2
ipykernel==5.1.4
ipython==7.14.0
ipython-genutils==0.1.0
ipywidgets==7.5.1
jedi==0.16.0
jeepney==0.4.3
Jinja2==2.11.2
jsonschema==3.2.0
jupyter-client==6.0.0
jupyter-console==6.1.0
jupyter-core==4.6.3
keyboard==0.13.4
keyring==21.2.0
lockfile==0.12.2
lutris==0.5.6
lyricwikia==0.1.11
MarkupSafe==1.1.1
meson==0.54.1
mistune==0.8.4
more-itertools==8.2.0
msgpack==1.0.0
nbconvert==5.6.1
nbformat==4.4.0
notebook==6.0.3
numpy==1.17.4
ordered-set==3.1.1
packaging==20.3
pafy==0.5.5
pandocfilters==1.4.2
paramiko==2.7.1
parso==0.7.0
pbr==5.4.4
pep517==0.8.2
pexpect==4.8.0
pgcli==3.0.0
pgspecial==1.11.10
pickleshare==0.7.5
Pillow==6.2.1
pipenv==2018.11.27.dev0
playsound==1.2.2
ply==3.11
pocketsphinx==0.1.15
progress==1.5
prometheus-client==0.7.1
prompt-toolkit==3.0.5
psutil==5.6.7
psycopg2==2.8.5
ptyprocess==0.6.0
pyasn1==0.4.8
PyAudio==0.2.11
pycairo==1.19.1
pycparser==2.20
pycryptodome==3.9.7
Pygments==2.6.1
PyGObject==3.36.1
PyNaCl==1.3.0
pynvim==0.4.0
pyparsing==2.4.7
pyrsistent==0.16.0
pysmi==0.3.4
pysnmp==4.4.12
python-dateutil==2.8.1
python-forecastio==1.4.0
python-xlib==0.26
pytoml==0.1.21
pyttsx3==2.71
pytz==2020.1
pywatchman==1.4.0
PyYAML==5.3.1
pyzmq==19.0.0
requests==2.23.0
responses==0.10.9
retrying==1.3.3
routersploit==3.4.0
SecretStorage==3.1.2
Send2Trash==1.5.0
setproctitle==1.1.10
six==1.14.0
snowballstemmer==2.0.0
sounddevice==0.3.14
soupsieve==2.0.1
SpeechRecognition==3.8.1
Sphinx==3.0.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sqlparse==0.3.1
tabulate==0.8.7
td-cli==1.2.6
terminado==0.8.3
terminaltables==3.1.0
testpath==0.4.4
texttable==1.6.2
toml==0.10.0
tornado==6.0.4
traitlets==4.3.3
urllib3==1.25.9
virtualenv==20.0.18
virtualenv-clone==0.5.4
wcwidth==0.1.9
webencodings==0.5.1
websocket-client==0.57.0
widgetsnbextension==3.5.1
zipp==3.1.0

CHNB128 avatar May 27 '20 10:05 CHNB128