django-front-door


Namedjango-front-door JSON
Version 0.10.0 PyPI version JSON
download
home_pagehttps://github.com/saxix/django-front-door
Summary
upload_time2022-12-23 10:08:49
maintainer
docs_urlNone
authorsax
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            django-front-door
===================


Simple, easy to use, middleware to lock access to any django app based on request attributes.

Quick Start
===========

Add `FrontDoorMiddleware` to your `settings.MIDDLEWARE` as first as possible.

    MIDDLEWARE = (
         'front_door.middleware.FrontDoorMiddleware',
         'django.contrib.sessions.middleware.SessionMiddleware',
         'django.middleware.common.CommonMiddleware',
         'django.middleware.csrf.CsrfViewMiddleware',
         'django.contrib.auth.middleware.AuthenticationMiddleware',
         'django.contrib.messages.middleware.MessageMiddleware',
    )
    FRONT_DOOR_ALLOWED_IPS=[],  # allowed ips
    FRONT_DOOR_ALLOWED_PATHS=[],  # url paths regex list always allowed
    FRONT_DOOR_COOKIE_NAME=None,
    FRONT_DOOR_COOKIE_PATTERN=None,
    FRONT_DOOR_LOG_LEVEL=0 #
    FRONT_DOOR_DEFAULT_POLICY=FORBID,
    FRONT_DOOR_ENABLED=False,  # FrontDoor enable/disable
    FRONT_DOOR_ERROR_CODE=404,  # status code if access denied
    FRONT_DOOR_FORBIDDEN_PATHS=[],  # url paths regex list always denied
    FRONT_DOOR_HEADER=None,  # special header name without HTTP- prefix
    FRONT_DOOR_REDIR_URL="",  # HttpResponseRedirect(REDIR_URL) if access denied
    FRONT_DOOR_ROUTER="front_door.router.DefaultRouter",
    FRONT_DOOR_RULES=[
            "front_door.rules.internal_ip",  # grant access to settings.INTERNAL_IPS
            "front_door.rules.forbidden_path",  # DENY access to FORBIDDEN_PATHS
            "front_door.rules.allowed_ip",  # grant access to FORBIDDEN_PATHS
            "front_door.rules.allowed_path",  # grant access to ALLOWED_PATHS
            "front_door.rules.special_header",  # grant access if request has Header[HEADER] == TOKEN
            "front_door.rules.has_header",  # grant access if request has HEADER
            "front_door.rules.cookie_value",  # grant access if request.COOKIES[COOKIE_NAME]
            "front_door.rules.cookie_exists",  # grant access ir COOKIE_NAME in request.COOKIES
        ],
    FRONT_DOOR_TOKEN=None,  # custom header value
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/saxix/django-front-door",
    "name": "django-front-door",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "sax",
    "author_email": "s.apostolico@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/95/0c/b8df400373338ef2ef0a795d26210186b41df73b83ce079251453e023433/django-front-door-0.10.0.tar.gz",
    "platform": "any",
    "description": "django-front-door\n===================\n\n\nSimple, easy to use, middleware to lock access to any django app based on request attributes.\n\nQuick Start\n===========\n\nAdd `FrontDoorMiddleware` to your `settings.MIDDLEWARE` as first as possible.\n\n    MIDDLEWARE = (\n         'front_door.middleware.FrontDoorMiddleware',\n         'django.contrib.sessions.middleware.SessionMiddleware',\n         'django.middleware.common.CommonMiddleware',\n         'django.middleware.csrf.CsrfViewMiddleware',\n         'django.contrib.auth.middleware.AuthenticationMiddleware',\n         'django.contrib.messages.middleware.MessageMiddleware',\n    )\n    FRONT_DOOR_ALLOWED_IPS=[],  # allowed ips\n    FRONT_DOOR_ALLOWED_PATHS=[],  # url paths regex list always allowed\n    FRONT_DOOR_COOKIE_NAME=None,\n    FRONT_DOOR_COOKIE_PATTERN=None,\n    FRONT_DOOR_LOG_LEVEL=0 #\n    FRONT_DOOR_DEFAULT_POLICY=FORBID,\n    FRONT_DOOR_ENABLED=False,  # FrontDoor enable/disable\n    FRONT_DOOR_ERROR_CODE=404,  # status code if access denied\n    FRONT_DOOR_FORBIDDEN_PATHS=[],  # url paths regex list always denied\n    FRONT_DOOR_HEADER=None,  # special header name without HTTP- prefix\n    FRONT_DOOR_REDIR_URL=\"\",  # HttpResponseRedirect(REDIR_URL) if access denied\n    FRONT_DOOR_ROUTER=\"front_door.router.DefaultRouter\",\n    FRONT_DOOR_RULES=[\n            \"front_door.rules.internal_ip\",  # grant access to settings.INTERNAL_IPS\n            \"front_door.rules.forbidden_path\",  # DENY access to FORBIDDEN_PATHS\n            \"front_door.rules.allowed_ip\",  # grant access to FORBIDDEN_PATHS\n            \"front_door.rules.allowed_path\",  # grant access to ALLOWED_PATHS\n            \"front_door.rules.special_header\",  # grant access if request has Header[HEADER] == TOKEN\n            \"front_door.rules.has_header\",  # grant access if request has HEADER\n            \"front_door.rules.cookie_value\",  # grant access if request.COOKIES[COOKIE_NAME]\n            \"front_door.rules.cookie_exists\",  # grant access ir COOKIE_NAME in request.COOKIES\n        ],\n    FRONT_DOOR_TOKEN=None,  # custom header value",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "0.10.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "1f947f59f6c8eaa5ee2018ecee3e085d",
                "sha256": "6c169a829b86d2a8e4bb1365af8a04d54cd5ef1787b0e9c720231c0bdb51abf1"
            },
            "downloads": -1,
            "filename": "django-front-door-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1f947f59f6c8eaa5ee2018ecee3e085d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8707,
            "upload_time": "2022-12-23T10:08:49",
            "upload_time_iso_8601": "2022-12-23T10:08:49.143196Z",
            "url": "https://files.pythonhosted.org/packages/95/0c/b8df400373338ef2ef0a795d26210186b41df73b83ce079251453e023433/django-front-door-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-23 10:08:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "saxix",
    "github_project": "django-front-door",
    "lcname": "django-front-door"
}
        
sax
Elapsed time: 0.05256s