thisissoon / djangohmac Goto Github PK
View Code? Open in Web Editor NEWDjango HMAC middleware class
License: The Unlicense
Django HMAC middleware class
License: The Unlicense
Middleware protects all whole except django admin. I would be nice to have a hmac decorators based on django auth decorators.
@hmac.auth(only=["foo"])
def view(..):
...
PR should have tests with Django rest framework because it uses different permission approach.
sign.py calls get_signature(request)
and passes it to validate_multiple_signatures()
, which calls make_hmac_for(key, body)
. Unfortunately, the signature from get_signature
is a string, whilst the signature from make_hmac_for()
is a byte array.
The workaround is to cast them both to byte arrays with six.b()
right before the comparison, otherwise they comparison always fails.
Library is loaded when django app starts and populate all configuration method using get_attr
from settings. One of those things bypass test decorator override_settings
.
It would be cool if we could configure the status code we send in responses for requests that fail. The SOON_ API Spec defines it should be a 400
since 401
and 403
are reserved for use with user authentication.
I propose a HMAC_REJECT_CODE
which is defaulted to 403
What do you think @radeklos?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.