Skip to main content

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


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

tokko_auth_lite-0.0.2-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page