quickauth:python的快速用户密码验证
quickauth的Python项目详细描述
python的快速用户密码验证。
安装
pip install quickauth
用法
fromquickauth.coreimportQuickAuthauthenticator=QuickAuth()print(authenticator.register())print(authenticator.authorize(key='fbdca934-34c0-11e9-8bb3-685b35d08286',value='579d0f25-aed1-40c4-afa8-61e11254f47e'))print(authenticator.update(key='fbdca934-34c0-11e9-8bb3-685b35d08286'))
输出:
{'key':'fbdca934-34c0-11e9-8bb3-685b35d08286','secret':'579d0f25-aed1-40c4-afa8-61e11254f47e'}True{'key':'fbdca934-34c0-11e9-8bb3-685b35d08286','secret':'974bc9bb-8839-4f0c-83b7-adc78cc3247d'}
从终端运行:
python3 -m quickauth.core [-h][--db DB][-k KEY][-s SECRET] OPERATION
位置参数:
OPERATION
注册、授权或更新
可选参数:
-h, --help | show this help message and exit |
--db DB | database file, default: auth.db |
-k KEY, --key KEY | |
key | |
-s SECRET, --secret SECRET | |
secret |