{ "info": { "author": "Farzad Ghanei", "author_email": "farzad.ghanei@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "********\nMiniAuth\n********\n\n.. image:: https://travis-ci.org/farzadghanei/miniauth.svg?branch=master\n :target: https://travis-ci.org/farzadghanei/miniauth\n\n\nMiniAuth is a small program (and a Python library) for user authentication.\nwith handy features, making it easy to use in different contexts and integrate with other programs.\n\nMiniAuth is simple and portable, runs on Python versions 2.7 and Python 3.4+ and\nhas no dependencies other than Python standard library.\n\nWhen the Python package is installed, the `miniauth` CLI entrypoint is provided to manage and use a local database of users,\nusing a SQLite backend.\n\nFeatures:\n\n* Passwords are stored salted and hashed. The hash is configurable per record, default is a secure choice (sha512)\n* Supports enabling/disabling users\n* Credentials can be specified in different ways: command line arguments, standard input, files\n* When used as a Python library, a custom storage can be used instead of default SQLite storage\n\nHere is how to create a user and password, then verifying the credentials:\n\n.. code-block::\n\n $ miniauth save testuser\n Password:\n\n $ miniauth verify testuser\n Password:\n # exit codes report the result of verification\n\n\nBy default a SQLite DB file is created in current working directory named `miniauth.db`.\nThe path to this file can be configured with the `--storage` option.\n\nWhen verifying the credentials, the password can be specified as an argument, or\nread from standard input or a file.\n\n.. code-block::\n\n $ miniauth --storage=user.db --verbose save testuser --password testpassword\n No DB detected on \"user.db\". Creating latest DB schema ...\n DB schema updated to version user.db on \"1\"\n created user testuser\n\n # read password from arguments\n $ miniauth --storage=user.db --verbose verify testuser testpassword\n user testuser credentials are correct\n\n # read password from a file\n $ cat file_with_password\n testpassword\n $ miniauth --storage=user.db --verbose verify testuser --password-file file_with_password\n user testuser credentials are correct\n\n # read username and password from a file\n $ cat file_with_creds\n testuser\n testpassword\n $ miniauth --storage=user.db --verbose verify --creds-file file_with_creds\n user testuser credentials are correct\n\n\nAuthenticating users can be done in other Python applications using miniauth as a library.\n\n.. code-block:: python\n\n >>> from miniauth.auth import MiniAuth\n >>> auth = MiniAuth('users.db')\n >>> auth.create_user('user', 'password')\n True\n >>> auth.verify_user('user', 'password')\n True\n >>> auth.verify_user('user', 'invalidpassword')\n False\n\n\nMiniAuth can use storage backends other than the default SQLite based one.\nStorage classes should inherit `AbstractStorage` and implement the abstract methods.\n\n.. code-block:: python\n\n >>> from miniauth.storage import AbstractStorage\n >>> class CustomStorage(AbstractStorage):\n ... # implement abstract methods\n ... pass\n >>> auth = MiniAuth('', CustomStorage())\n\n\nInstallation\n============\n\n.. code-block:: bash\n\n $ pip install miniauth\n\n\nOr installing from source:\n\n.. code-block:: bash\n\n $ python setup.py install\n\n\nDevelopment\n===========\n\nSource code is on `GitHub `_\n\nIn development/test environments `pytest `_, `mock `_\n, `pycodestyle `_ and `mypy `_ are required.\n\n\n.. code-block:: bash\n\n # on dev/test env\n $ pip install -r requirements/dev.txt\n\n\nTests\n-----\n\n`Tox `_ is most convenient to run tests with, since it handles virtualenvs\n\n.. code-block:: bash\n\n $ tox\n\nOr when development dependencies are installed (preferably with a virtual environment),\ntests can be run by directly calling `pytest`.\n\n.. code-block:: bash\n\n $ pytest\n\n\nLicense\n=======\nMiniAuth is an open source project released under the terms of MIT license.\n\nThe MIT License (MIT)\n\nCopyright (c) 2018-2019 Farzad Ghanei\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/farzadghanei/miniauth", "keywords": "auth userdb", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "miniauth", "package_url": "https://pypi.org/project/miniauth/", "platform": "", "project_url": "https://pypi.org/project/miniauth/", "project_urls": { "Homepage": "https://github.com/farzadghanei/miniauth" }, "release_url": "https://pypi.org/project/miniauth/0.2.0/", "requires_dist": [ "pytest; extra == 'dev'", "mock; extra == 'dev'", "typing; extra == 'dev'", "pycodestyle; extra == 'dev'" ], "requires_python": "", "summary": "Simple local user authentication", "version": "0.2.0" }, "last_serial": 5000304, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "95c814e568b6dc664e62979acf07950f", "sha256": "82c43a917c60c5d2d39db9570bc86ffdb3c101114f95c9dd72e7636bc19d5c31" }, "downloads": -1, "filename": "miniauth-0.1.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "95c814e568b6dc664e62979acf07950f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13903, "upload_time": "2019-03-24T14:59:37", "url": "https://files.pythonhosted.org/packages/a7/db/44ab94ee679fc3cd054101b70bdd5a60a7b383954526b3d9bc890c14301f/miniauth-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3fe183a343b614aa584873f38c9b957", "sha256": "8c66898780cc98d01d8873c90855cfc036aa238b1610b7f1ff602ad68e3d9b80" }, "downloads": -1, "filename": "miniauth-0.1.0.tar.gz", "has_sig": true, "md5_digest": "b3fe183a343b614aa584873f38c9b957", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11080, "upload_time": "2019-03-24T15:00:08", "url": "https://files.pythonhosted.org/packages/0f/48/d90e82cde79b7229915d234fe65478f47e0f779b87aad2c169ef38673e61/miniauth-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "783c7c2b0c7ab8942630212d73e33e07", "sha256": "cb32b664799c0cb408e9aca4e1e6e8e8ae4a839b03789549424a6bb41f81da06" }, "downloads": -1, "filename": "miniauth-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "783c7c2b0c7ab8942630212d73e33e07", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14851, "upload_time": "2019-03-28T22:00:47", "url": "https://files.pythonhosted.org/packages/c4/1f/5c3c78e7ae004e48b0de7bf7db15ba033a563cdb1f42d8d8d119b4822878/miniauth-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c95dbe1109e43c1043046c02d1878c13", "sha256": "11805e1309cdb699cb96ff213e4f88a17270c2d8b1f02a22d7a863320cc19b65" }, "downloads": -1, "filename": "miniauth-0.2.0.tar.gz", "has_sig": true, "md5_digest": "c95dbe1109e43c1043046c02d1878c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11924, "upload_time": "2019-03-28T22:01:00", "url": "https://files.pythonhosted.org/packages/e4/49/37f02f35d688fb7ff55b61ec8f3bdf05e5a1487e1df8d4437f114efaf509/miniauth-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "783c7c2b0c7ab8942630212d73e33e07", "sha256": "cb32b664799c0cb408e9aca4e1e6e8e8ae4a839b03789549424a6bb41f81da06" }, "downloads": -1, "filename": "miniauth-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "783c7c2b0c7ab8942630212d73e33e07", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14851, "upload_time": "2019-03-28T22:00:47", "url": "https://files.pythonhosted.org/packages/c4/1f/5c3c78e7ae004e48b0de7bf7db15ba033a563cdb1f42d8d8d119b4822878/miniauth-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c95dbe1109e43c1043046c02d1878c13", "sha256": "11805e1309cdb699cb96ff213e4f88a17270c2d8b1f02a22d7a863320cc19b65" }, "downloads": -1, "filename": "miniauth-0.2.0.tar.gz", "has_sig": true, "md5_digest": "c95dbe1109e43c1043046c02d1878c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11924, "upload_time": "2019-03-28T22:01:00", "url": "https://files.pythonhosted.org/packages/e4/49/37f02f35d688fb7ff55b61ec8f3bdf05e5a1487e1df8d4437f114efaf509/miniauth-0.2.0.tar.gz" } ] }