Handles authorization for Django by using puppetdb users
django-pypuppetdb is a library that handles authentication by using the PuppetDB’s REST API to get Users that are registrated in PuppetDB. It is implemented using the requests library.
- To use this library you will need:
- Python 2.7+
- Python 3.3+
- Django 1.8
You can install this package from source or from PyPi.
$ pip install django-pypuppetdb
$ git clone https://github.com/nedap/django-pypuppetdb $ python setup.py install
To let django connect to puppetdb in order to get your user add the following line to you settings.
- add “django_pypuppetdb” to INSTALLED_APPS.
- add “django_pypuppetdb.django_authentication.PuppetDBAuthentication” to AUTHENTICATION_BACKENDS
- add the followin settings
PUPPETDB_HOST = 'localhost', PUPPETDB_PORT = 8080, PUPPETDB_NODE = 'node', PUPPETDB_KEY = None, PUPPETDB_CERT = None, PUPPETDB_SSL_VERIFY = False PUPPETDB_ADMIN_GROUP = 'admins'
If you are using tastypie as API framework and want to use pypuppetdb to validate the user you can add the following line to your resource file
from django_pypuppetdb.tastypie_authentication import PuppetDBAuthentication in your class Meta add: authentication = PuppetDBAuthentication()
if you would like to use multiple authentications you can use
authentication = MultiAuthentication(ApiKeyAuthentication(), PuppetDBAuthentication())
Initial release. Implements most of authorization for django.
Separating Django and Tastypie dependency.
Renaming Django authenticaton and updated all tests Renaming Tastyie authentication and updated all tests
Django and Tastypie fully tested
Adding check for puppet group that will check if the user is in the group defined in PUPPETDB_ADMIN_GROUP. This will give the user admin rights allowing the user to login django-admin.
Updating files to make it django 1.8 compatible.
Updating requirements file to newest versions.