Qotto/QottoAuthClient
Project description
Qotto Auth Client
The python package qotto-auth-client
is a client for the API qotto-auth
which will soon be open sourced.
It allows to manage a scoped permission and authentication system.
More information coming soon...
Quickstart
The QottoAuthService
class allows to interact with a qotto-auth
GraphQL server.
from qottoauth import *
# Initialize the service
qotto_auth_service = QottoAuthService(QottoAuthGqlApi(QOTTO_AUTH_URL))
# Register this application
application = qotto_auth_service.register_application(
name=APPLICATION_NAME,
description=APPLICATION_DESCRIPTION,
)
# Register permission
permission_1 = qotto_auth_service.register_permission(
name=PERMISSION_1_NAME,
description=PERMISSION_1_DESCRIPTION,
application=application,
)
# Fetch current user or member
def handle(request)
actor = qotto_auth_service.actor(
token=request.COOKIES.get(TOKEN_COOKIE_NAME),
secret=request.COOKIES.get(SECRET_COOKIE_NAME),
)
if qotto_auth_service.is_authorized(
actor=actor,
permission=permission_1,
):
# Do something
else:
# Do something else
You can instantiate a QottoAuthService
with a QottoAuthTestApi
for testing purposes. In that case you might want to
extend the test api class if you extended service using direct api calls.
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
qotto-auth-client-2.0.1a3.tar.gz
(16.4 kB
view hashes)
Built Distribution
Close
Hashes for qotto-auth-client-2.0.1a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a8c6fe0a2aef117a2d36efd2eecbe4c1be585efd1b47f46361aed7cc56d88b |
|
MD5 | 8123127a3660d6ecd169380ef0ffdfad |
|
BLAKE2b-256 | f61db7fdfd84936270a65d912a177de7999ff0cb05203f8acf9b00d85cc4fb52 |
Close
Hashes for qotto_auth_client-2.0.1a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f23e7f07bf7e5c47b455d17da31faee19a455423341ab3b31adb33ff72f9be9 |
|
MD5 | 0f0dae7452972b5f9f90c3931bdb630a |
|
BLAKE2b-256 | 19a9fdf3092cd423ee7b02e653bcb5b0e7a9a668cc84f2f540ca75816dc0082b |