Tanker identity library
Project description
Tanker identity generation in Python for the Tanker SDK.
Installation
With pip:
$ pip install tankersdk-identity
Usage
import tankersdk_identity
def retrieve_identity(user_id):
""" Fetch a previously stored identity """
...
def store_identity(user_id, identity):
""" Store a previously generated identity """
...
def check_auth(user_id):
""" Check the user is authenticated """
...
def serve_user_identity(user_id):
""" Called during sign/up sign in of your users.
Send a user identity, generated if necessary,
but only to authenticated users
"""
authorized = check_auth(user_id)
if not authorized:
raise UnAuthorizedError()
token = retrieve_user_identity(user_id)
if not identity:
identity = tankersdk_identity.create_identity(trustchain_id, trustchain_private_key, user_id)
store_user_identity(user_id, identity)
return identity
Going further
Read more about identities in the Tanker guide.
Check the examples folder for usage examples.
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
Built Distribution
File details
Details for the file tankersdk-identity-1.1.0.tar.gz
.
File metadata
- Download URL: tankersdk-identity-1.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bebfe316fd8f56edf2f7c04edffba78b71d6ca5a74e5cde227f6004c3bc8151 |
|
MD5 | 38e5937b024c9dd717f24fdc8859de18 |
|
BLAKE2b-256 | ca36c27625afde39bf0131396283a10a4d909df34f992f56460f95da2df8dd2f |
File details
Details for the file tankersdk_identity-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: tankersdk_identity-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8142bc497f72221168e07ffb9adf5996558de6afacfc7caa7c7b520db5e5834a |
|
MD5 | ec8de491576ff5cd197669a4f1eba13a |
|
BLAKE2b-256 | cb74a1c464d8a581f5428669369768cfc350955ca3f556b8fbe4e947cd6fced6 |