Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
15b0575
tests - read from .env
commonism Jun 1, 2026
5425dd3
crypto - refactor
commonism Jun 7, 2026
0bf5843
models - using a WrapSerializer to encrypt values
commonism Jun 7, 2026
c53cda1
tests - create user & login
commonism Jun 7, 2026
8d0332e
crypto - embedding into models
commonism Jun 8, 2026
5db4e35
crypto - move to models
commonism Jun 8, 2026
751217d
crypto - cleanup
commonism Jun 8, 2026
46f39c8
crypto - cleanup user registration
commonism Jun 11, 2026
dfc2b3b
crypto - fix BinarySymmetricCipher
commonism Jun 11, 2026
a81847e
crypto - fold cctx management into models
commonism Jun 11, 2026
4b29522
tests - set env from ci.yml for local use
commonism Jun 11, 2026
6cc9d54
tests - disable db changing tests
commonism Jun 11, 2026
42c7e82
tests - disable rename org
commonism Jun 11, 2026
8c925ac
tests - disable failing tests
commonism Jun 11, 2026
bcdda77
typing - Self f. py3.10
commonism Jun 11, 2026
47d615b
crypto - use CryptoContext instead of dict for ser/des
commonism Jun 11, 2026
1fa747a
rebase - fixes for no-mail authentication
commonism Jun 11, 2026
fe7f343
fix - Self on py3.10
commonism Jun 11, 2026
60e9738
tests - fix bitwarden ref
commonism Jun 11, 2026
ed4f86b
models - PascalCase some attributes
commonism Jun 14, 2026
36deab5
tests - re-enable
commonism Jun 14, 2026
eb03377
ciphers - implement matching
commonism Jun 14, 2026
89bf134
tests - writing user & items
commonism Jun 16, 2026
352fed3
pyproject - include pytest
commonism Jun 16, 2026
40383e8
pyproject/pytest - warnings as errors
commonism Jun 19, 2026
92fae24
models - migrate to model_config
commonism Jun 19, 2026
317f9f1
models - use ValidationInfo
commonism Jun 19, 2026
9c27022
tests - close client connections
commonism Jun 19, 2026
fc98f27
crypto - encode to bytes by default
commonism Jun 19, 2026
d5cfb3c
tests - search/edit items
commonism Jun 19, 2026
971f053
tests/attachments - fixes & tests
commonism Jun 23, 2026
0627c10
models - use serialize_by_alias
commonism Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,49 @@ client.set_user_enabled(user.Id, enabled=True)

### Bitwarden client

#### Login/… creation & lookup
```python
import urllib.parse
import secrets
from vaultwarden.models.bitwarden import Login, LoginData, UriMatch, UriMatchDetection
from vaultwarden.clients.bitwarden import BitwardenAPIClient

bitwarden_client = BitwardenAPIClient(url="http://127.0.0.1",
email="test-account@example.com",
password="test-account",
client_id="user.a8be340c-856b-481f-8183-2b7712995da2",
client_secret="ag66paVUq4h7tBLbCbJOY5tJkQvUuT",
device_id="e54ba5f5-7d58-4830-8f2b-99194c70c14f")
bitwarden_client.sync()

# create
uri = urllib.parse.urlparse(url:="http://username:password@login.example.org")
key = secrets.token_bytes(64)

data = LoginData.model_construct(
name=uri.hostname,
password=uri.username,
username=uri.password,
uris = [UriMatch.model_construct(match = UriMatchDetection.HOST, uri=url)]
)
item = Login.model_construct(
name=f"{uri.username}@{uri.hostname}",
login=data,
data=data,
key=key,
)

bitwarden_client.create_item(item, None, None)

# refresh cache
bitwarden_client.sync(force_refresh=True)

# lookup
print(list(bitwarden_client.search_items(name="login.example.")))
print(list(bitwarden_client.search_items(uri="http://login.example.org")))
```

#### User / Org / Collection Management
```python
from vaultwarden.clients.bitwarden import BitwardenAPIClient
from vaultwarden.models.bitwarden import Organization, OrganizationCollection, get_organization
Expand Down Expand Up @@ -89,6 +132,7 @@ if my_user:

```


## Compatibility

This library is compatible with vaultwarden 1.32.0 and above.
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ test = [
"pytest~=8.3",
]

[tool.pytest.ini_options]
filterwarnings = [
"error"
]

[tool.hatch.version]
path = "src/vaultwarden/__version__.py"

Expand All @@ -68,6 +73,7 @@ packages = [
[tool.hatch.envs.test]
dependencies = [
"coverage",
"pytest"
]

[tool.hatch.envs.test.scripts]
Expand Down
Loading
Loading