{
"info": {
"author": "Carson Gee",
"author_email": "x@carsongee.com",
"bugtrack_url": null,
"classifiers": [
"Environment :: Web Environment",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "Flask-htpasswd\n--------------\n.. image:: https://img.shields.io/travis/carsongee/flask-htpasswd.svg\n :target: https://travis-ci.org/carsongee/flask-htpasswd\n.. image:: https://img.shields.io/coveralls/carsongee/flask-htpasswd.svg\n :target: https://coveralls.io/r/carsongee/flask-htpasswd\n.. image:: https://img.shields.io/github/issues/carsongee/flask-htpasswd.svg\n :target: https://github.com/carsongee/flask-htpasswd/issues\n.. image:: https://img.shields.io/pypi/dm/flask-htpasswd.svg\n :target: https://pypi.python.org/pypi/flask-htpasswd/0.1.0\n.. image:: https://img.shields.io/pypi/v/flask-htpasswd.svg\n :target: https://pypi.python.org/pypi/flask-htpasswd/0.1.0\n.. image:: https://img.shields.io/badge/license-BSD-blue.svg\n :target: https://github.com/carsongee/flask-htpasswd/blob/master/LICENSE\n\n\nFlask extension for providing basic digest and token authentication\nvia apache htpasswd files. So largely it fits between `Flask-Security\n`_ which has additional\ndependencies and `Flask-BasicAuth\n`_ which only\nallows you to have one user (and also puts the plain text password\ninto the configuration).\n\nSample usage is to first create an htpasswd file with the `apache tool `_:\n\n.. code-block:: bash\n\n htpasswd -c /path/to/.htpasswd my_username\n\nAdditional users can be added, or have their passwords changed, by running:\n\n.. code-block:: bash\n\n htpasswd /path/to/.htpasswd new_user\n htpasswd /path/to/.htpasswd user_I_want_to_change_passwords_for\n\nThen you just need to setup and configure your flask application, with\nsomething like:\n\n.. code-block:: python\n\n import flask\n from flask_htpasswd import HtPasswdAuth\n\n app = flask.Flask(__name__)\n app.config['FLASK_HTPASSWD_PATH'] = '/path/to/.htpasswd'\n app.config['FLASK_SECRET'] = 'Hey Hey Kids, secure me!'\n\n htpasswd = HtPasswdAuth(app)\n \n\n @app.route('/')\n @htpasswd.required\n def index(user):\n return 'Hello {user}'.format(user=user)\n\n app.run(debug=True)\n\nAnd that view should now prompt for a username and password (and\naccept tokens).\n\nIf you would like to protect all of your views, that is easy too, just\nadd a little config. By setting ``app.config['FLASK_AUTH_ALL']=True``\nbefore initializing the extension, an ``@app.before_request`` is added\nthat will require auth for all pages, and it will add the user as\n``flask.g.user``.\n\nOne last small feature, is that you can also set the authentication\nrealm. The default is 'Login Required', but it can be set with\n``app.config['FLASK_AUTH_REALM']`` before initialization.\n\n\nUsing Tokens\n============\n\nTokens are based on the username and password, and thus invalid\nwhenever the user's password is changed. To get a user password, you\ncan serve it out to the user with something like\n\n.. code-block:: python\n\n import flask\n from flask_htpasswd import HtPasswdAuth\n\n app = flask.Flask(__name__)\n app.config['FLASK_HTPASSWD_PATH'] = '/path/to/.htpasswd'\n app.config['FLASK_SECRET'] = 'Hey Hey Kids, secure me!'\n htpasswd = HtPasswdAuth(app)\n \n\n @app.route('/')\n @htpasswd.required\n def index(user):\n return flask.jsonify({'token': htpasswd.generate_token(user)})\n\n app.run(debug=True)\n\nIt can then be used by the user by adding it to the header of their requests, something like:\n\n.. code-block:: python\n\n import requests\n\n requests.get('http://localhost:5000/', headers={'Authorization': 'token '})\n\n\nRelease Notes\n=============\n\n0.3.1\n`````\n\n- Corrected deprecated passlib API call\n\n0.3.0\n`````\n\n- Added function to reload user database\n- Added user to ``flask.g`` with FLASK_AUTH_ALL=True\n\n0.2.0\n`````\n\n- Python 3 compatability\n\nAcknowledgements\n================\n\nThis is largely based on a combination of:\n\n- http://flask-basicauth.readthedocs.org/en/latest/\n- http://flask.pocoo.org/snippets/8/\n- http://blog.miguelgrinberg.com/post/restful-authentication-with-flask\n\n\nLinks\n`````\n\n* `documentation\n `_\n* `development version\n `_",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/carsongee/flask-htpasswd",
"keywords": null,
"license": "BSD New",
"maintainer": null,
"maintainer_email": null,
"name": "flask-htpasswd",
"package_url": "https://pypi.org/project/flask-htpasswd/",
"platform": "any",
"project_url": "https://pypi.org/project/flask-htpasswd/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://github.com/carsongee/flask-htpasswd"
},
"release_url": "https://pypi.org/project/flask-htpasswd/0.3.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Basic authentication support via htpasswd files in flask applications",
"version": "0.3.1"
},
"last_serial": 2815877,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "f3d8f7e8ecde71a674c79eba7a39876c",
"sha256": "093c1426df343c16a3617c4ca2a142b58111364d8b6b7ff4dfbe7e2bcec5ba3d"
},
"downloads": -1,
"filename": "flask-htpasswd-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "f3d8f7e8ecde71a674c79eba7a39876c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5566,
"upload_time": "2015-04-02T03:38:55",
"url": "https://files.pythonhosted.org/packages/bd/fe/f1a293bb65df3d049b573750e258735f77c88e2faa78c52434e0186cdefe/flask-htpasswd-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "c9f6bfb3707fb6412dbbda4200518531",
"sha256": "635ff2f5d5802632696053c0d8962a2fef2e2d1e5551c55c5afe3c405219a47d"
},
"downloads": -1,
"filename": "flask-htpasswd-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "c9f6bfb3707fb6412dbbda4200518531",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5805,
"upload_time": "2015-04-02T04:22:57",
"url": "https://files.pythonhosted.org/packages/21/17/7034ed4f9ad146e929ed2708450e7972679796660ce13303b95cb06f3931/flask-htpasswd-0.1.1.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "840538fcafa18b6e2bef7725375e3c7e",
"sha256": "e01cb1e31cbf03eef0d29a4d867b0ea85e0334c374b00b382c4ad69a9a43a6bd"
},
"downloads": -1,
"filename": "flask-htpasswd-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "840538fcafa18b6e2bef7725375e3c7e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6634,
"upload_time": "2015-06-27T14:51:42",
"url": "https://files.pythonhosted.org/packages/8f/4a/946b254fae0cd29619da522fb216c29cb9e5f2e762f107389f591a15ec68/flask-htpasswd-0.2.0.tar.gz"
}
],
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "ca4af196a5d4c2c50ff294a225ab9d5c",
"sha256": "8696e8e2c01d58f368526ebed592c9ce917a105e61deb7f53b0452da8fad06e5"
},
"downloads": -1,
"filename": "flask-htpasswd-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "ca4af196a5d4c2c50ff294a225ab9d5c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6777,
"upload_time": "2015-06-28T21:37:37",
"url": "https://files.pythonhosted.org/packages/3b/4f/27195333bcd6e7e3ff27229e49a68a0a9d7ef5083ba026671df2fdcbdd8f/flask-htpasswd-0.3.0.tar.gz"
}
],
"0.3.1": [
{
"comment_text": "",
"digests": {
"md5": "db9ccbd84a94fea70cd018a3e6866b3c",
"sha256": "74d54342603783bfc167bf92b9f69519ec9e7b0a19568da6f6bae66f42a1f919"
},
"downloads": -1,
"filename": "flask_htpasswd-0.3.1-py2-none-any.whl",
"has_sig": false,
"md5_digest": "db9ccbd84a94fea70cd018a3e6866b3c",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 7739,
"upload_time": "2017-04-20T01:32:57",
"url": "https://files.pythonhosted.org/packages/a7/e0/2e51503912c89206a54676e42cda60a7a486daedd099a44a458a9c87f03b/flask_htpasswd-0.3.1-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c98a72650b442ac9fd6de05b30cbefd5",
"sha256": "ed6c4262a6881326520cb16ca7cefd9fcf0dc6e830d0e61a524ea33583a99b5a"
},
"downloads": -1,
"filename": "flask_htpasswd-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c98a72650b442ac9fd6de05b30cbefd5",
"packagetype": "bdist_wheel",
"python_version": "3.6",
"requires_python": null,
"size": 7736,
"upload_time": "2017-04-20T01:33:54",
"url": "https://files.pythonhosted.org/packages/1c/a3/719f46b03d3895b990e251aca563578ea7fb87c54fb6f7b4bf1b4d669364/flask_htpasswd-0.3.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "67aff04b75c326c80c86e16ea6364559",
"sha256": "2af73b12dee1f7a510f4def5aa87885452c23e9645346edb5270a5987cf00193"
},
"downloads": -1,
"filename": "flask-htpasswd-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "67aff04b75c326c80c86e16ea6364559",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6809,
"upload_time": "2017-04-20T01:32:56",
"url": "https://files.pythonhosted.org/packages/b8/35/00a7ea3a65504b08715068b6fd3615b2c9fd734e4e7c46590ebebc1d96b4/flask-htpasswd-0.3.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "db9ccbd84a94fea70cd018a3e6866b3c",
"sha256": "74d54342603783bfc167bf92b9f69519ec9e7b0a19568da6f6bae66f42a1f919"
},
"downloads": -1,
"filename": "flask_htpasswd-0.3.1-py2-none-any.whl",
"has_sig": false,
"md5_digest": "db9ccbd84a94fea70cd018a3e6866b3c",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 7739,
"upload_time": "2017-04-20T01:32:57",
"url": "https://files.pythonhosted.org/packages/a7/e0/2e51503912c89206a54676e42cda60a7a486daedd099a44a458a9c87f03b/flask_htpasswd-0.3.1-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c98a72650b442ac9fd6de05b30cbefd5",
"sha256": "ed6c4262a6881326520cb16ca7cefd9fcf0dc6e830d0e61a524ea33583a99b5a"
},
"downloads": -1,
"filename": "flask_htpasswd-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c98a72650b442ac9fd6de05b30cbefd5",
"packagetype": "bdist_wheel",
"python_version": "3.6",
"requires_python": null,
"size": 7736,
"upload_time": "2017-04-20T01:33:54",
"url": "https://files.pythonhosted.org/packages/1c/a3/719f46b03d3895b990e251aca563578ea7fb87c54fb6f7b4bf1b4d669364/flask_htpasswd-0.3.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "67aff04b75c326c80c86e16ea6364559",
"sha256": "2af73b12dee1f7a510f4def5aa87885452c23e9645346edb5270a5987cf00193"
},
"downloads": -1,
"filename": "flask-htpasswd-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "67aff04b75c326c80c86e16ea6364559",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6809,
"upload_time": "2017-04-20T01:32:56",
"url": "https://files.pythonhosted.org/packages/b8/35/00a7ea3a65504b08715068b6fd3615b2c9fd734e4e7c46590ebebc1d96b4/flask-htpasswd-0.3.1.tar.gz"
}
]
}