Skip to main content

Django Rest Framework Library to control Client Apps over APIs

Project description

djangorestframework-apicontrol

This is an App intended to control Clients Apps access over REST APIs.

Notice

Please be carefull with the use of this package, and remember to backup your database before apply each migration.

Permission Usage (APIKey)

you only has to import the permission and use it in your rest_framework views, or in your settings.py file, as you prefer. e.g:

"""Contact views."""
from rest_framework import viewsets
from rest_framework_apicontrol.permissions import HasApiKeyPermission
from .models import (
    ContactInfo
)
from .serializers import (
    ContactInfoSerializer
)


class ContactInfoViewSet(viewsets.ModelViewSet):
    queryset = ContactInfo.objects.all()
    serializer_class = ContactInfoSerializer
    permission_classes = [HasApiKeyPermission]
    authentication_classes = []

All the calls to this endpoint MUST HAVE a header called Api-Key with the value of an App(App model in Django admin site)

Models

This app comes with several models & mixins which provide useful common fields & functions, the models it provides are the following:

models diagram

To add those models to your app the only you need to do is add rest_framework_apicontrol to your project INSTALLED_APPS setting & then migrate your app.

INSTALLED_APPS = [
    # Django default modules
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Security & multi-app management
    'rest_framework_apicontrol',
    # Your project apps
    '...',
]

Notice: This project's models needs PostgreSQL as database because the use of JSONField in some of it's model fields.

Donate

If this project is useful for you, please donate some dollars to help me improve this & others projects.

My Paypal - http://paypal.me/mcuetodeveloper

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

rest_framework_apicontrol-0.8.0.tar.gz (22.1 kB view details)

Uploaded Source

File details

Details for the file rest_framework_apicontrol-0.8.0.tar.gz.

File metadata

  • Download URL: rest_framework_apicontrol-0.8.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for rest_framework_apicontrol-0.8.0.tar.gz
Algorithm Hash digest
SHA256 488a8b9afbc7f07390ddcf159775194981bf6eca9489e5e94288a7a034f1a754
MD5 83c8d678c1a22c87c2c539248236b40b
BLAKE2b-256 bbd7fea45604e5a25d06bac0a5527a587ed7c521d7c931ccf55990f2f38b6d2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page