Tokko Auth2 flavor.
Project description
Installation
pip3 install tokko_auth_lite
sudo -H pip3 install tokko_auth_lite
Usage
from tokko_auth_lite.core import Token
from tokko_auth_lite.tools.testing import TokenFabrik
_jwt = TokenFabrik(permission=["companies:read_branches", "spacex:launch_rockets"])
token = Token.from_header({"Authorization": f"Bearer {_jwt}"})
print(token)
print(token.is_valid())
print(token.permissions)
print(token.has_permission("companies:read_branches", "spacex:launch_rockets"))
print(token.has_permission("spacex:launch_rockets"))
print(token.has_permission("companies:read_branches", "spacex:launch_rockets", require_all=True))
print(token.user_id)
Tutorials
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file tokko_auth_lite-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: tokko_auth_lite-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89997c515c2d4d8ecbb60d42aba58a1300fd9dcff8a54c3757173deea8f3a45c |
|
MD5 | 568505c7f1bc9e7093f7a587b0bb87c3 |
|
BLAKE2b-256 | 6b3423a4b7fa88a2c22882cec4700c9a8b40bdb9b76fc3bdeac134f6e1cf2fb1 |