Skip to main content

Handles authorization for Django by using puppetdb users

Project description

https://api.travis-ci.org/nedap/django-pypuppetdb.png https://coveralls.io/repos/nedap/django-pypuppetdb/badge.png https://pypip.in/d/django_pypuppetdb/badge.png https://pypip.in/v/django_pypuppetdb/badge.png

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+

  • pypuppetdb

  • Django 1.6+

Installation

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

Django

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

Tastypie

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())

Getting Help

This project is still very new so most likely there will be issues you’ll run into.

For bug reports you can file an issue. If you need help with something feel free to hit up @eagllus by e-mail.

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_pypuppetdb-0.1.0.tar.gz (7.8 kB view hashes)

Uploaded Source

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