Code Monkey home page Code Monkey logo

bitwarden-keyring's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitwarden-keyring's Issues

ImportError: cannot import name ‘properties’ from ‘keyring.util’

I'm not using bitwarden, but on the computer of a friend, there is

  File “/usr/local/lib/python3.11/site-packages/bitwarden_keyring/__init__.py”, line 8, in <module> from keyring.util import properties
ImportError: cannot import name ‘properties’ from ‘keyring.util’

This module was indeed removed

jaraco/keyring@b8ee1bd

I don't know what it does, so I cannot recommand anything to fix this, but according to the deprecation warning that this commit removed

warnings.warn(
    "Properties from keyring.util are no longer supported. "
    "Use jaraco.classes.properties instead.",
    DeprecationWarning,
)

I don't know what jaraco is, but I assume you can simply replace the problematic import with from jaraco.classes import properties

test_bitwarden_keyring.py failing the test

  • This is centos 7.6 with python36.
[me@centos7 tests]$ /usr/local/bin/pytest
======================================================================== test session starts =========================================================================
platform linux -- Python 3.6.8, pytest-5.1.1, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python3.6
cachedir: .pytest_cache
rootdir: /home/tjyang/github/bitwarden-keyring, inifile: setup.cfg
plugins: cov-2.7.1
collected 0 items / 1 errors
Coverage.py warning: Module bitwarden_keyring was never imported. (module-not-imported)
Coverage.py warning: No data was collected. (no-data-collected)
WARNING: Failed to generate report: No data to report.

/usr/local/lib/python3.6/site-packages/pytest_cov/plugin.py:229: PytestWarning: Failed to generate report: No data to report.

  self.cov_controller.finish()

=============================================================================== ERRORS ===============================================================================
__________________________________________________________ ERROR collecting tests/test_bitwarden_keyring.py __________________________________________________________
ImportError while importing test module '/home/tjyang/github/bitwarden-keyring/tests/test_bitwarden_keyring.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.6/site-packages/_pytest/python.py:501: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/local/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
/usr/local/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:140: in exec_module
    exec(co, module.__dict__)
test_bitwarden_keyring.py:8: in <module>
    import bitwarden_keyring as bwkr
E   ModuleNotFoundError: No module named 'bitwarden_keyring'

----------- coverage: platform linux, python 3.6.8-final-0 -----------
Name    Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================== 1 error in 0.34s ==========================================================================
[me@centos7 tests]$
/home/me/github/bitwarden-keyring/tests
[me@centos7 tests]$

Get password

I can create a new item:

$ keyring set hello world
Password for 'world' in 'hello':
Created.

The bitwarden-cli shows the new item as expected: $ bw get item hello

But keyring get hello world doesn't return anything. (It doesn't raise an error either.)

I'm on Win10 with bitwarden-cli version 2023.5.0. Could you help me to troubleshoot the issue? I don't know where to start.

TypeError: a bytes-like object is required, not 'str'

I was getting the following error when trying to run it. I noticed the issue was caused by line 93-95 in init.py. Could be due to me using Windows/Python3.7.

I was able to fix the issue by setting encoding for subprocess and removing encoding for stdout.

rashed-c@11d624e

However, I am still a bit confused about how to pull credentials properly. Can you please give me an example on how you would use bitwarden-keyring?

Thanks.

Feature Request: Add session passing to functions

Hey Joachim,

Thanks for the module, I have been using it to build out a utility to allow me to easily search and copy my bitwarden passwords to clipboard with fzf for search.

I ran into a small issue while using the module where I want to built a username/password cache using the bw() function, then using those results I call the get_password() func. The issue I am having is it is repeatedly calling for a new session on each function call (which asks me for password each time to unlock), and there doesn't seem to be a way to pass the session to the get_password, set_password, or del_password functions.

I am proposing the following, add a function input session=None, then add a small check inside the function. If session == None, it will grab the session from users password, else it will use the session passed to it.

I have created #4 with the additions, tests, and minor version bump. Wanted to write my thoughts out here as well.

Let me know if you know a better way.

  • Sam

Who to setup bw to be used by python keyring?

Because of this, it's likely that your setup and my setup are nothing alike. Keyring supports a configuration file with an option allowing to explicitely define the path to a backend. You may need that for your installation, or maybe not.

What exactly should I to write in config to specified keyring backend in python keyrign?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.