Skip to main content

Per API client token authentication Module for django rest framework.

Project description

Get Support

For urgent issues and priority support, visit https://xscode.com/eshaan7/django-rest-durin.

Django-Rest-Durin

django-rest-durin on pypi Build Status codecov CodeFactor Language grade: Python

Per API client token authentication Module for Django REST Framework.

The idea is to provide one library that does token auth for multiple Web/CLI/Mobile API clients via one interface but allows different token configuration for each client.

Durin authentication is token based, similar to the TokenAuthentication built in to DRF. However, it adds some extra sauce:

  • Durin allows multiple tokens per user. But only one token each user per API client.
  • Each user token is associated with an API Client.
    • These API Clients are configurable via Django's Admin Interface.
    • Includes permission enforcing to allow only specific clients to make authenticated requests to certain APIViews or vice-a-versa.
    • Configure Rate-Throttling per User <-> Client pair.
  • Durin provides an option for a logged in user to remove all tokens that the server has - forcing them to re-authenticate for all API clients.
  • Durin tokens can be renewed to get a fresh expiry.
  • Durin provides a CachedTokenAuthentication backend as well which uses memoization for faster look ups.

More information can be found in the Documentation. I'd also recommend going through the example_project/ included in this repository.

Django Compatibility Matrix

PyPi versions - Python

If your project uses an older verison of Django or Django Rest Framework, you can choose an older version of this project.

This Project Python Version Django Version Django Rest Framework
0.1.* 3.5 - 3.9 2.2, 3.0, 3.1, 3.2 3.7>=

Make sure to use at least DRF 3.10 when using Django 3.0 or newer.

Changelog / Releases

All releases should be listed in the releases tab on GitHub.

See CHANGELOG for a more detailed listing.

License

This project is published with the MIT License. See https://choosealicense.com/licenses/mit/ for more information about what this means.

Credits

Durin is inpired by the django-rest-knox and django-rest-multitokenauth libraries and adopts some learnings, docs and code from both.

Project details


Download files

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

Source Distribution

django-rest-durin-0.2.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

django_rest_durin-0.2.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file django-rest-durin-0.2.0.tar.gz.

File metadata

  • Download URL: django-rest-durin-0.2.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django-rest-durin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 89e8f3f973c6c466bd766102d5aeda01f50238547d6952a2487ee90d0157e16a
MD5 b0d24647fda8499ee2f5ed2a8a3cdbe6
BLAKE2b-256 8d4c7d5d511f5e89c85dc28549f09712869f2a37b03d66d8c0e0dd7a13e19ca8

See more details on using hashes here.

File details

Details for the file django_rest_durin-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_rest_durin-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django_rest_durin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8dd565d4ea4c8adc382fcbec578bc028966a8e09654e3fb74a1781f5f8ef05
MD5 72a295f11c502a73a67f33bccbf20d35
BLAKE2b-256 feca88f2bb08732ec475663e5818eb47e3967587d2327a4ff56ec3b4ac6d42ff

See more details on using hashes here.

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