This module supports the Bitwarden CLI Vault Management
API, available via
Bitwarden CLI's bw serve
command.
If you're looking for Bitwarden's public api (for organizational tools and stuff) that API is here.
Please note that this module won't be supporting email and master password login to start with. It's not the most secure method, but pull requests are welcome. Also, SSO support is low on the todo list, as the author doesn't use it.
XXX: TBD
-
Python 3.10+
-
- Instructions can be found here
This module expects the user of this module to manage the configuration and
setup of the bw serve
server. Documentation is
here.
These authentication steps are required for the bw
cli tool regardless of
how it's being used. I'm including the basic steps you'll need to use this
module here for completeness. Be sure to read the
documentation.
- Check status
- unauthenticated, need to run
bw login --apikey
- locked, need to run
bw unlock
- unlocked, nothing needs to be done
- unauthenticated, need to run
Environment variables (both required):
- BW_CLIENTID
- BW_CLIENTSECRET
- --passwordenv <ENVIRONMENT_VARIABLE>
- --passwordfile /path/to/file
- prompt for password
Capture BW_SESSION and set it.
In bash, only bash scripts can be sourced, so we can't set the environment variable outside of the script. Provide an option for the user to be to do something like the following.
BW_SESSION="$(bw-serve-client unlock [--passwordenv|--passwordfile|prompt])"
So they aren't stomping all over themselves when using both the command line and this module.
There is a --session option for each command, but I'm not supporting that.
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/harleypig/bw-serve-client.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/harleypig/bw-serve-client.git
)
Then import the package:
import bw_serve_client
Execute pytest
to run the tests.
XXX: TBD
XXX: TBD
XXX: TBD