GithubHelp home page GithubHelp logo

menecio / django-api-bouncer Goto Github PK

View Code? Open in Web Editor NEW
18.0 0.0 3.0 251 KB

Simple Django app to provide API Gateways for micro-services

Home Page: http://www.menecio.me/django-api-bouncer/docs/

License: Apache License 2.0

Python 100.00%
api-gateway api-rest django python3 django-rest-framework kong-gateway kong microservices

django-api-bouncer's Introduction

API Bouncer

build-status-image coverage-image pypi-version

API Bouncer is a simple Django app to provide an API Gateway for micro-services.

It's heavily inspired by Kong

Requirements

  • Python (3.5, 3.6)
  • Django (1.10, 1.11)
  • Django Rest Framework (3.6)
  • PostgreSQL (9.4+)
  • psycopg2 (2.5.4+)

Quick start

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.

Available plugins

Authenticacion

  • Key authentication: Add key authentication to your API

Security

  • ACL: Control which consumers have access to your API
  • IP restriction: Blacklist or whilelist IPs that can access your API

Traffic Control

  • Request termination: Terminate all request with a specific response.

Documentation

Documentation can be found in the docs directory or here

django-api-bouncer's People

Contributors

menecio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-api-bouncer's Issues

Increase test coverage

Add enough test cases to validate a stable flow, from adding a new api, creating consumers, enabling plugins and handling simple api requests.

Goal: at least 80% of coverage

Create ACL plugin

Make a plugin that allows to define groups whitelists/blacklists and include consumers into groups

  1. An API can have a group whitelist or blacklist, not both
  2. Consumers can be added to groups
  3. As specified a consumer might or might not have access to an API based on the groups it belongs.

Request termination plugin

Allow to terminate incoming requests with a specified status code and message.

  • Temporary block an API

  • Temporary block a Consumer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.