Skip to main content

A Python client to fetch data from Bitwarden and Vaultwarden

Project description

Python Bitwarden/Vaultwarden client

Python http client to fetch data Bitwarden or Vaultwarden.

Current limitations

  • Supports only AES encoding (type: 2)
  • Supports only fetching data, totally not a CRUD API

Installation

pip install bit-vault-warden-client

Usage

from bit_vault_warden_client import (
    WardenConfiguration, WardenAuthData,
    WardenClient, WardenCacheMode
)

# Define authentication data
auth_data = WardenAuthData(
    scope='api offline_access',
    client_id='web',
    grant_type='password',
    deviceType=9,
    deviceName='Bitwarden-Web-API'
)

# Create Warden client configuraion
config = WardenConfiguration(
    url='https://bitwarden.domain.tld',
    username='username@domain.tld',
    password='verysecure',
    auth_data=auth_data,
    cache_mode=WardenCacheMode.FALLBACK,
)

# Instantiate client and fetch data
client = WardenClient(config)
result = client.fetch_credentials('credentials item name')

WardenConfiguration options

cache_ttl=int
  • Cache expiration timer in seconds

cache_mode=WardenCacheMode.FALLBACK  
cache_mode=WardenCacheMode.AGGRESSIVE
  • WardenCacheMode.FALLBACK for using cache only when remote is not available. In this mode client will try to use cache even if it is expired with logged warning.
  • WardenCacheMode.AGGRESSIVE cache will be used firsthand, and remote will be queried only if cache doesn't exist or is expired

cache_filename='bitwarden.rpx.cache',
  • Cache filename, by default it is bitwarden.cache and is always placed in system temporary directory
  • Must not start with /, \ or ..

http_proxy='socks5h://127.0.0.1:1082',
http_proxy='http://127.0.0.1:1082',
https_proxy='socks5h://127.0.0.1:1082',
https_proxy='https://127.0.0.1:1082',
  • Proxy configuration, http and socks proxies are supported

https_verify=True,
  • Certification authority verification, set False to be like curl --insecure

https_cafile='./customCA.crt',
  • Relative or absolute path to self-signed custom CA file (in PEM format) to verify server against
  • Will throw FileNotFoundError upon initialization if specified file has not been found

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bit_vault_warden_client-1.0.0.tar.gz (14.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bit_vault_warden_client-1.0.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file bit_vault_warden_client-1.0.0.tar.gz.

File metadata

File hashes

Hashes for bit_vault_warden_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 005bcf506d81cf5df606d9e001feb3a877a2f00a6d9d5ae15884b8da853187b9
MD5 bc6e908577a315f05d78eecbd8033882
BLAKE2b-256 63ed4d10f767312897d57b404cd189ab62b7a4bb954d47b49cd2728d108b98e4

See more details on using hashes here.

File details

Details for the file bit_vault_warden_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bit_vault_warden_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcea77477e867efdb1371ba974ead06f2e6daabb05963bd5d346d2412c053b5c
MD5 c0b2462d94fb21f0cb27d869eeafef84
BLAKE2b-256 b42c7e1484822a266b9f64241e385ffd29282f42759ae18f81ba97746c1a5b20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page