Skip to main content

Tokko Auth2 flavor.

Project description


Install DjangoPlugin Package

pip install -e

Import & Configure dj-plugin


# Add app to installed apps

# Also add declare app's middleware
    # Has request JWT?
    # JWT has required NAMESPACE?
    # Fill "request.user" attribute

# Finally, declare your AUTH0_DOMAIN




# API required NAMESPACE
AUTH_API_NAMESPACE = 'my-service-namespace'

View & Mutation required SCOPES

Resticciones de acceso basado en scopes para la view some_ufo_secrets.

from authorization.decorators import has_permission

# Require todos los scopes
@has_permission('x-files:agent', 'alien:believer', has_all=True)
def some_ufo_secrets(request):

# Al menos un scope
@has_permission('scully:agent', 'mulder:agent', at_least_one=True)
def some_ufo_secrets(request):


Environment Vars

Esta aplicación observa un conjunto de variables de entorno configurables, las cuales pueden modificar drásticamente su funcionamiento.


Name Description Type Default
AUTH0_DOMAIN Auth0 Domain. Ej: {my-project} Si esta variable no esta correctamente configurada, se emitirá un exception EnvVarNotInitialized String -


Name Description Type Default
AUTH_FAIL_SAFE_ENABLE Remueve errores de validación Boolean False
AUTH_USERINFO_ENABLE Agrega /userinfo data al request.user Boolean False
AUTH_API_NAMESPACE Scopes requeridos a nivel API, estos se validaran en cada request List [ ]
AUTH_BEAUTIFY_ERROR_RESPONSE Formatea los errors a JSONResponse, se auto-deshabilita sobre GQL Boolean False
AUTH_FULL_DISABLED Desactiva validacion de Auth Boolean False
AUTH_ALLOW_PRODUCTIVE_SHUTDOWN Permite desactivar la validacion de Auth en productivo Boolean False
SAMPLES_ARE_ENABLE Agrega Views, Mutation & Queries de ejemplo Boolean True


Local environment

Unit Test

python test authorization.tests.unit

Service Test

python test authorization.tests.service

Docker environment

Unit Test

# Require: docker-compose up [-d] [--build]
docker-compose exec app bash -c "python test authorization.tests.unit"

Service Test

# Require: docker-compose up [-d] [--build]
docker-compose exec app bash -c "python test authorization.tests.service"



Please read for details on our code of conduct, and the process for submitting pull requests to project.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-tokko-auth, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size django-tokko-auth-0.0.3.tar.gz (12.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page