Skip to content

Commit

Permalink
增加新支持
Browse files Browse the repository at this point in the history
支持Argon2Id算法
支持解密组织数据
预留API登录接口(但没卵用)
  • Loading branch information
BoringCat committed Dec 28, 2023
1 parent 9beea80 commit 6dd36dc
Show file tree
Hide file tree
Showing 8 changed files with 931 additions and 251 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@

## 依赖要求
注:requirement.txt 附带的版本号为开发使用的版本
- python >= 3
请根据 pycrypto 支持情况自行决定Python版本
- python>=3
- requests>=2.31.0
- passlib>=1.7.4
- hkdf>=0.0.3
- cryptography>=41.0.5
- argon2-cffi>=23.1.0

## 使用方法
```python
from api import VaultwardenAPI
vapi = VaultwardenAPI(baseUrl, email, masterPassword) # 配置服务器与账号消息
vapi.fullLogin() # 登录
vapi.sync(86400) # 如果与上次同步间隔小于86400秒(一天)则不同步
alist = vapi.searchByName('somename') # 模糊搜索
blist = vapi.searchByName('JustThisName', equal = True) # 全匹配搜索
allItemInFolders = vapi.getListByFolder('somefoldername') # 模糊搜索目录
allItemInOneFolder = vapi.getListByFolder('JustThisFolder', equal = True) # 全匹配目录
allCiphers = vapi.decryptedCiphers # 拿所有解密后的 Ciphers
allFolders = vapi.decryptedFolders # 拿所有解密后的 Folders
from vaultwarden import * # VaultwardenAPI, UriMatchType
with VaultwardenAPI(baseUrl, email, masterPassword) as vapi: # 配置服务器与账号消息
vapi.fullLogin() # 登录
vapi.sync(86400) # 如果与上次同步间隔小于86400秒(一天)则不同步
alist = list(vapi.searchCiphers(name = 'somename')) # 模糊搜索
blist = list(vapi.searchCiphers(name = 'JustThisName', equal = True)) # 全匹配搜索
blist = list(vapi.searchCiphers(domain = 'http://github.com', domain_type = UriMatchType.Host))
# 匹配域名查询
allItemInFolders = list(vapi.searchFolders(name = 'somefoldername')) # 模糊搜索目录
allItemInOneFolder = list(vapi.searchFolders(name = 'JustThisFolder', equal = True))
# 全匹配目录
allCiphers = vapi.Ciphers # 拿所有解密后的 Ciphers
allFolders = vapi.Folders # 拿所有解密后的 Folders
```
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
requests>=2.31.0
passlib>=1.7.4
hkdf>=0.0.3
cryptography>=41.0.5
cryptography>=41.0.5
argon2-cffi>=23.1.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="python-vaultwarden",
version="0.0.3",
version="0.0.4",
author="BoringCat",
author_email="[email protected]",
description="Simple VaultWarden API for Python",
Expand All @@ -17,6 +17,7 @@
'passlib>=1.7.4',
'hkdf>=0.0.3',
'cryptography>=41.0.5',
'argon2-cffi>=23.1.0',
],
python_requires='>=3',
)
4 changes: 4 additions & 0 deletions vaultwarden/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .api import VaultwardenAPI
from .types import UriMatchType

__all__ = ['VaultwardenAPI', 'UriMatchType']
Loading

0 comments on commit 6dd36dc

Please sign in to comment.