Skip to main content

Provides easy integration of the HMAC signatures for your REST Django Applications.

Project description


|circle| |downloads| |version| |license| |docs|

This module provides a middleware for HMAC signature Django views. It's simply
designed to check that a client is entitled to access routes, based on the fact
that it must possess a copy of the secret key.

Key features:
- HMAC Middleware
- HMAC View decorators
- Multiple keys for more services
- Service restricted access

Small example

.. sourcecode:: python

class SignedView(View):

def get(self, request):
return HttpResponse("for all services")

def post(self, request):
return HttpResponse("Only for user service")


To run all tests

.. sourcecode::

docker run -it -v $PWD:/src -w /src ikalnitsky/pythonista tox

.. |circle| image::

.. |downloads| image::

.. |version| image::

.. |license| image::

.. |docs| image::

Change Log

- Fix - unicode key

- Get rid of brackets in decorator
- Bugfix: valid signature for resticted view passed validation

- Merge validation of multiple and single signature to single method
- Replace middleware classes to one single class HmacMiddleware

- Decorators

- Fix: Django HTTP headers

- Fix: use base64.b64encode instead of base64.urlsafe_b64encode

- Fix: HMAC_SECRET should be optional
- `GlobalHmacMiddleware` and `MultipleHmacMiddleware`

- Initial release including the core feature set

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

djangohmac-1.3.2.tar.gz (4.6 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