API Bouncer is a simple Django app to provide an API Gateway for micro-services.
It's heavily inspired by Kong
- Python (3.5, 3.6)
- Django (1.10, 1.11)
- Django Rest Framework (3.6)
- PostgreSQL (9.4+)
- psycopg2 (2.5.4+)
Add "api_bouncer" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
# all other Django apss you have...
'api_bouncer',
]
Activate the key-auth
plugin by adding the middleware on your settings.py:
MIDDLEWARE = [
# all other middleware...
'api_bouncer.middleware.bouncer.BouncerMiddleware', # required
'api_bouncer.middleware.key_auth.KeyAuthMiddleware',
]
Important!
Note that you need to include BouncerMiddleware
before the rest of plugin
middleware. Otherwise it will not work.
Include the api_bouncer URLconf in your project urls.py like this:
url(r'^', include('api_bouncer.urls', namespace='api_bouncer')),
Run python manage.py migrate
to create the api_bouncer models.
- Key authentication: Add key authentication to your API
- ACL: Control which consumers have access to your API
- IP restriction: Blacklist or whilelist IPs that can access your API
- Request termination: Terminate all request with a specific response.
Documentation can be found in the docs
directory or here