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 Distribution
tokko_auth_lite-0.0.1.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for tokko_auth_lite-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de04ec5ce1b348323a57a925f0c3377d498524e9189ef21330a1a6be0cbdc3e8 |
|
MD5 | 56131ec1121534828c72285e410e4cb7 |
|
BLAKE2b-256 | 524246da41183d031188adef8dba08bf4cb13295fe5df47d0af8e99bda1e466f |