{ "info": { "author": "Department for International Trade", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# directory-proxy\n\n[![code-climate-image]][code-climate]\n[![circle-ci-image]][circle-ci]\n[![codecov-image]][codecov]\n\nProxy for rejecting non-whitelisted IP addresses.\n\n---\n\nProxy sets a [Hawk](https://github.com/hueniverse/hawk) signature header that the upstream service can check, rejecting requests that do not have a valid signature.\n\n## Installation\n\n`pip install directory-proxy`\n\n## Usage\n\nProxy can be ran as a standalone service or as a WSGI worker running alongside the upstream service.\n\n### WSGI worker\n\nThe proxy can be run on the same box as the upstream service. Install proxy on the same box as the upstream service then run the WSGI worker:\n\n```sh\nDJANGO_SETTINGS_MODULE=directory_proxy.conf.settings \\\ngunicorn directory_proxy.conf.wsgi --bind 0.0.0.0:$UPSTREAM_PORT\n```\n\n### Standalone service\n\nIf you're unable to run the WSGI worker on the same box as the upstream service then the proxy can be ran as a standlone service.\n\n\n### Configuration\n\nSet the following environment variables to configure the proxy:\n\n| Environment variable | Details |\n| ------------------------------------- | --------------------------------------- |\n| IP_RESTRICTOR_ALLOWED_ADMIN_IPS | Allow IP addresses. Command delimited |\n| IP_RESTRICTOR_ALLOWED_ADMIN_IP_RANGES | Allow IP ranges. Command delimited |\n| IP_RESTRICTOR_SKIP_CHECK_ENABLED | Skip IP check. Check cookie instead |\n| IP_RESTRICTOR_SKIP_CHECK_SECRET | Shared secret for checking cookie |\n| UPSTREAM_DOMAIN | Domain of upstream service |\n| UPSTREAM_SIGNATURE_SECRET | Hawk shared secret for upstream request |\n| UPSTREAM_SIGNATURE_SENDER_ID | Hawk sender ID for upstream request |\n\n\n## Local installation\n\n $ git clone https://github.com/uktrade/directory-proxy\n $ cd directory-proxy\n\n## Debugging\n\n### Setup debug environment\n\n $ make debug\n\n### Run debug webserver\n\n $ make debug_webserver\n\n### Run debug tests\n\n $ make debug_test\n\n\n[code-climate-image]: https://codeclimate.com/github/uktrade/directory-proxy/badges/issue_count.svg\n[code-climate]: https://codeclimate.com/github/uktrade/directory-proxy\n\n[circle-ci-image]: https://circleci.com/gh/uktrade/directory-proxy/tree/master.svg?style=svg\n[circle-ci]: https://circleci.com/gh/uktrade/directory-proxy/tree/master\n\n[codecov-image]: https://codecov.io/gh/uktrade/directory-proxy/branch/master/graph/badge.svg\n[codecov]: https://codecov.io/gh/uktrade/directory-proxy\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/uktrade/directory-proxy", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "directory-proxy", "package_url": "https://pypi.org/project/directory-proxy/", "platform": "", "project_url": "https://pypi.org/project/directory-proxy/", "project_urls": { "Homepage": "https://github.com/uktrade/directory-proxy" }, "release_url": "https://pypi.org/project/directory-proxy/0.1.0/", "requires_dist": [ "django (<2.0a1,>=1.11.15)", "django-revproxy (<1.0.0,>=0.9.15)", "django-environ (<1.0.0,>=0.4.5)", "gunicorn (<20.0.0,>=19.9.0)", "raven (<7.0.0,>=6.10.0)", "sigauth (<5.0.0,>=4.0.1)", "directory-components (<4.0.0,>=3.5.0)", "pytest (==4.0.2) ; extra == 'test'", "pytest-cov (==2.6.0) ; extra == 'test'", "pytest-sugar (==0.9.2) ; extra == 'test'", "pytest-django (==3.4.4) ; extra == 'test'", "flake8 (==3.6.0) ; extra == 'test'", "codecov (==2.0.15) ; extra == 'test'", "requests-mock (==1.5.2) ; extra == 'test'", "twine (<2.0.0,>=1.11.0) ; extra == 'test'", "wheel (<1.0.0,>=0.31.0) ; extra == 'test'", "setuptools (<39.0.0,>=38.6.0) ; extra == 'test'" ], "requires_python": "", "summary": "Proxy", "version": "0.1.0" }, "last_serial": 4676517, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a2e6654b2bda8ff2bf146938ba7688d5", "sha256": "7ac96030ac9c2bac48c03f1e82249de318de939e2ac5d74ae8241595014c19f8" }, "downloads": -1, "filename": "directory_proxy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a2e6654b2bda8ff2bf146938ba7688d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7116, "upload_time": "2019-01-03T11:10:56", "url": "https://files.pythonhosted.org/packages/0b/b0/aa374ddb2d6ab25a9ac11b1edcfed68ffd3011a4523e0215c4844953f3c3/directory_proxy-0.1.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2e6654b2bda8ff2bf146938ba7688d5", "sha256": "7ac96030ac9c2bac48c03f1e82249de318de939e2ac5d74ae8241595014c19f8" }, "downloads": -1, "filename": "directory_proxy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a2e6654b2bda8ff2bf146938ba7688d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7116, "upload_time": "2019-01-03T11:10:56", "url": "https://files.pythonhosted.org/packages/0b/b0/aa374ddb2d6ab25a9ac11b1edcfed68ffd3011a4523e0215c4844953f3c3/directory_proxy-0.1.0-py3-none-any.whl" } ] }