{ "info": { "author": "Randall Degges", "author_email": "rdegges@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: Public Domain", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# python-basicauth\n\nA dead simple HTTP basic auth encoder and decoder. Why? Because HTTP should be\ndrop dead easy. That's why.\n\n\n![HTTP Basic Auth?!](https://github.com/rdegges/python-basicauth/raw/master/http_basic_auth.jpg)\n\n\n## Install\n\nTo install ``python-basicauth``, simply run ``pip install basicauth`` and\nyou'll get the latest version installed automatically.\n\n\n## Usage\n\nTo generate an encoded basic auth string:\n\n``` python\n>>> from basicauth import encode\n>>> username, password = 'rdegges', 'omghax!!!'\n>>> encoded_str = encode(username, password)\n>>> print encoded_str\n'Basic cmRlZ2dlczpvbWdoYXglMjElMjElMjE='\n```\n\nTo decode an encoded basic auth string:\n\n``` python\n>>> from basicauth import decode\n>>> encoded_str = 'Basic cmRlZ2dlczpvbWdoYXglMjElMjElMjE=' # From the example above.\n>>> username, password = decode(encoded_str)\n>>> print (username, password)\n('rdegges', 'omghax!!!')\n```\n\nWe can also decode the hash directly:\n\n``` python\n>>> from basicauth import decode\n>>> encoded_str = 'cmRlZ2dlczpvbWdoYXglMjElMjElMjE=' # From the example above.\n>>> username, password = decode(encoded_str)\n>>> print (username, password)\n('rdegges', 'omghax!!!')\n```\n\nAnd if there are errors:\n\n``` python\n>>> from basicauth import decode, DecodeError\n>>> encoded_str = 'lol omg cmRlZ2dlczpvbWdoYXglMjElMjElMjE=' # Invalid hash.\n>>> username, password = decode(encoded_str)\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"basicauth/__init__.py\", line 49, in decode\n raise DecodeError\nbasicauth.DecodeError\n```\n\n**NOTE**: The [HTTP Basic Authentication spec](http://www.ietf.org/rfc/rfc2617.txt)\ndoesn **NOT** allow you to include any colon characters (`:`) in the username\nfield. Colons are allowed in the password field -- but that's it.\n\n\n## Tests\n\n[![Build Status](https://secure.travis-ci.org/rdegges/python-basicauth.png?branch=master)](http://travis-ci.org/rdegges/python-basicauth)\n\nWant to run the tests? No problem:\n\n``` bash\n$ git clone git://github.com/rdegges/python-basicauth.git\n$ cd python-basicauth\n$ python setup.py develop\n...\n$ pip install -r requirements.txt # Install test dependencies.\n$ nosetests\n.............\n----------------------------------------------------------------------\nRan 13 tests in 0.166s\n\nOK\n```\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rdegges/python-basicauth", "keywords": "python security basicauth http", "license": "UNLICENSE", "maintainer": "", "maintainer_email": "", "name": "basicauth", "package_url": "https://pypi.org/project/basicauth/", "platform": "", "project_url": "https://pypi.org/project/basicauth/", "project_urls": { "Homepage": "https://github.com/rdegges/python-basicauth" }, "release_url": "https://pypi.org/project/basicauth/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "An incredibly simple HTTP basic auth implementation.", "version": "0.4.1" }, "last_serial": 2650284, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "20a898c3497e329cf611a6a21fd20a58", "sha256": "c317dd288b874c7f2093dcae83d4ca92f088039682395654d15474ce1ac00217" }, "downloads": -1, "filename": "basicauth-0.1.tar.gz", "has_sig": false, "md5_digest": "20a898c3497e329cf611a6a21fd20a58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3689, "upload_time": "2012-05-01T03:13:15", "url": "https://files.pythonhosted.org/packages/0a/30/93d70f403d3af52abb86cdfc4417ce13e7fee0e9db97455c4b94bfcf77d4/basicauth-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "70011cc5ab0b3e309a71bef2ba97ac4b", "sha256": "e94a0638741cafb5e271d2d1449bcf7139a25c49ea374a941443d8244b28d084" }, "downloads": -1, "filename": "basicauth-0.2.tar.gz", "has_sig": false, "md5_digest": "70011cc5ab0b3e309a71bef2ba97ac4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58767, "upload_time": "2012-05-16T03:26:34", "url": "https://files.pythonhosted.org/packages/28/43/baf896ebedbd4fc763d22252c6fbeda3b36eec9266b5760e16bec41d7c0e/basicauth-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1a20ac1c6cce38a1e5caf439776c7675", "sha256": "a1304a4063148315926ab5eb5d84e7e18d78dc9cda8299d9f4c698e6a5785b29" }, "downloads": -1, "filename": "basicauth-0.3.tar.gz", "has_sig": false, "md5_digest": "1a20ac1c6cce38a1e5caf439776c7675", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59479, "upload_time": "2014-04-24T23:30:46", "url": "https://files.pythonhosted.org/packages/08/e9/0d1343e98853d984928c7398f9be60b8b068d70e7c82ffed6a7711aa8758/basicauth-0.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "129ef4530b2b64f0f43fd70631ce97ab", "sha256": "c02b5e542c1f5786f2cb410c2c63484a842a3195bc08c66c72faef01ab29ea94" }, "downloads": -1, "filename": "basicauth-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "129ef4530b2b64f0f43fd70631ce97ab", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4540, "upload_time": "2017-02-17T19:22:42", "url": "https://files.pythonhosted.org/packages/c3/af/de5e24b52d13733ef79aee4700541153bb8e5ff8c1b60a4029040880ff34/basicauth-0.4.0-py2.py3-none-any.whl" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f21d3a8b4a82f1fac8916bfdfd130002", "sha256": "d79ebe09ec4a46955539ed2e66a6543375511e0f00b3c37be735d15f8e63ac02" }, "downloads": -1, "filename": "basicauth-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f21d3a8b4a82f1fac8916bfdfd130002", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4541, "upload_time": "2017-02-17T19:30:33", "url": "https://files.pythonhosted.org/packages/76/47/08d21ffcc837bebf3306b8295f5d179f9bc498f6235ebf4a4e38be57839c/basicauth-0.4.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f21d3a8b4a82f1fac8916bfdfd130002", "sha256": "d79ebe09ec4a46955539ed2e66a6543375511e0f00b3c37be735d15f8e63ac02" }, "downloads": -1, "filename": "basicauth-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f21d3a8b4a82f1fac8916bfdfd130002", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4541, "upload_time": "2017-02-17T19:30:33", "url": "https://files.pythonhosted.org/packages/76/47/08d21ffcc837bebf3306b8295f5d179f9bc498f6235ebf4a4e38be57839c/basicauth-0.4.1-py2.py3-none-any.whl" } ] }