Skip to content

Implementation of resuelve-auth in python

License

Notifications You must be signed in to change notification settings

resuelve/resuelve-auth-python

Repository files navigation

Resuelve auth

A python implementation of resuelve-auth

Install

Using pip:

pip install git+https://github.com/resuelve/resuelve-auth-python.git

Using poetry

poetry add git+https://github.com/resuelve/resuelve-auth-python.git

Usage

Validate a existing token.

ttl can be used to define the quantity of seconds that token will be valid.

from resuelve_auth import auth
from resuelve_auth.exceptions import ResuelveAuthError

SECRET = "some secret key"
try:
    metadata = auth.validate_token(SECRET, "a token", ttl=10)
except ResuelveAuthError as ex:
    # TODO: handle error here

Build a new token with some data inside of it

from resuelve_auth import auth

SECRET = "some secret key"
meta = {"some": "data"}
token = auth.build_token(SECRET, meta)

Enjoy 🎉

About

Implementation of resuelve-auth in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages