{ "info": { "author": "Waqas Bhatti", "author_email": "waqas.afzal.bhatti@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP :: Session" ], "description": "[![Build Status](https://ci.wbhatti.org/buildStatus/icon?job=authnzerver)](https://ci.wbhatti.org/job/authnzerver)\n\nThis is a small server meant to help add authentication (authn) and\nauthorization (authz) to other HTTP servers. It's built using\n[Tornado](http://www.tornadoweb.org), [SQLAlchemy](https://www.sqlalchemy.org/),\n[cryptography](https://cryptography.io),\n[argon2-cffi](https://argon2-cffi.readthedocs.io/en/stable/),\n[python-diskcache](http://www.grantjenks.com/docs/diskcache/), and\n[uvloop](https://github.com/MagicStack/uvloop).\n\nI wrote it to help with the login/logout/signup flows for the\n[LCC-Server](https://github.com/waqasbhatti/lcc-server) and extracted much of\nthe code from there. It builds on the auth bits there and is eventually meant to\nreplace them. It can do the following things:\n\n- handle user sign-ups, logins, and logouts\n- handle user email verification, password changes, and editing user properties\n- handle API key issuance, verification, and rate-limits\n\nTODO items include:\n\n- handling access and rate-limit checks for arbitrary schemes of user roles,\n permissions, and target objects. There is a [built-in\n scheme](https://github.com/waqasbhatti/authnzerver/blob/29d382099e8d9d5645bc3faec256d6a6f802247b/authnzerver/permissions.py#L17)\n of permissions and user roles, originally from the LCC-Server where this code\n was extracted from, but it may not be useful for general purposes.\n- handling social logins using Twitter, Github, and Google.\n\nAuthnzerver talks to a frontend server over HTTP. Communications are secured\nwith symmetric encryption using the [cryptography](https://cryptography.io)\npackage's [Fernet scheme](https://cryptography.io/en/latest/fernet/), so you'll\nneed a pre-shared key that both Authnzerver and your frontend server know.\n\n\n## Installation\n\nAuthnzerver is [available at PyPI](https://pypi.org/project/authnzerver/), but\nis very much a work in progress at the moment. Don't install it (or trust it)\nuntil it has reached v0.1.\n\nWith that said, it can be installed (preferably in a virtualenv) using `pip`:\n\n```bash\n(venv) $ pip install authnzerver\n\n# use pip install authnzerver --pre for unstable releases\n```\n\n\n## Running the server\n\nThere is a single executable that will be in your `$PATH` if you have a\nvirtualenv activated and the package installed: `authnzrv`.\n\n`authnzrv --help` will list all the options available:\n\n```\n--authdb An SQLAlchemy database URL to indicate where\n the local authentication DB is. This should\n be in the form discussed at: https://docs.sq\n lalchemy.org/en/latest/core/engines.html#dat\n abase-urls\n--autosetup If this is True, will automatically generate\n an SQLite authentication database in the\n basedir if there isn't one present and the\n value of the authdb option is also None.\n (default True)\n--backgroundworkers number of background workers to use\n (default 4)\n--basedir The base directory containing secret files\n and the auth DB if --autosetup was used.\n--cachedir Path to the cache directory used by the\n authnzerver.\n--debugmode start up in debug mode if set to 1. (default\n 0)\n--envfile Path to a file containing environ variables\n for testing/development.\n--port Run on the given port. (default 13431)\n--secret Path to the file containing the secret key.\n This is relative to the path given in the\n basedir option.\n--serve Bind to given address and serve content.\n (default 127.0.0.1)\n--sessionexpiry This sets the session-expiry time in days.\n (default 30)\n```\n\nThere's an example systemd `.service` file available in the `deploy` directory\nto run this server automatically on startup.\n\n\n## Configuring the server\n\nUse the following environmental variables to configure the server.\n\n```\n# listen address and port settings\nAUTHNZERVER_PORT={{ authnzerver_listenport }}\nAUTHNZERVER_LISTEN={{ authnzerver_listenaddr }}\n\n# cache and base directory locations\nAUTHNZERVER_CACHEDIR={{ authnzerver_cachedir }}\nAUTHNZERVER_BASEDIR={{ authnzerver_basedir }}\n\n# secret token and authentication DB URL\nAUTHNZERVER_SECRET={{ authnzerver_secretkey }}\nAUTHNZERVER_AUTHDB={{ authnzerver_authdb }}\n\n# session expiry time in days\nAUTHNZERVER_SESSIONEXPIRY={{ authnzerver_sessionexpiry }}\n\n# email settings for sending emails to users\nAUTHNZERVER_EMAILSENDER={{ authnzerver_emailsender }}\nAUTHNZERVER_EMAILSERVER={{ authnzerver_emailserver }}\nAUTHNZERVER_EMAILPORT={{ authnzerver_emailport }}\nAUTHNZERVER_EMAILUSER={{ authnzerver_emailuser }}\nAUTHNZERVER_EMAILPASS={{ authnzerver_emailpass }}\n```\n\nYou can also provide all of these at once using an environment file. This is not\nrecommended for production but is useful for development. If you go this route,\nuse the `--envfile` option to point to an appropriate environment file.\n\nAt a minimum, you must provide:\n\n- a pre-shared key as an environmental variable: `AUTHNZERVER_SECRETKEY`.\n- an SQLAlchemy [database\n URL](https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls)\n indicating where the server should store authentication information. Provide\n this either in the `AUTHNZERVER_AUTHDB` environmental variable or the\n `--authdb` option to the executable.\n\nIf neither of these are provided, and the command-line option `--autosetup` is\nTrue (by default), the server will prompt you for admin credentials during the\nfirst start up, generate a pre-shared secret key and initialize an SQLite\nauthentication database in the directory pointed to by the `--basedir`\ncommand-line option.\n\n\n## HTTP API and example frontend client\n\nSee [API.md](https://github.com/waqasbhatti/authnzerver/blob/master/docs/API.md) for\ndetails.\n\nIf you'll be using this with a Tornado based server, there is an example\nfrontend client BaseHandler class available in\n[frontendbase.py](https://github.com/waqasbhatti/authnzerver/blob/master/authnzerver/frontendbase.py).\n\nSee the [docstring for the initialize function](https://github.com/waqasbhatti/authnzerver/blob/518a9d396910feaa9dae5c8eb31330b186919c9e/authnzerver/frontendbase.py#L155) for details on how to pass\nsettings bits to the BaseHandler.\n\nYou can use the `BaseHandler` class like so:\n\n```python\nfrom authnzerver.frontendbase import BaseHandler\n\nclass MyFrontendHandler(BaseHandler):\n\n async def post(self):\n \"\"\"This is an auth-enabled POST handler.\"\"\"\n\n # check if we have the required 'Authorization'\n # bearer token value provided as an API key\n if not self.keycheck['status'] == 'ok':\n\n self.set_status(403)\n retdict = {\n 'status':'failed',\n 'result':None,\n 'message':\"Sorry, you don't have access.\"\n }\n self.write(retdict)\n raise tornado.web.Finish()\n\n # do other stuff here if all is well\n```\n\n\n## License\n\nAuthnzerver is provided under the MIT License. See the LICENSE file for details.\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/waqasbhatti/authnzerver", "keywords": "authentication authorization tornado", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "authnzerver", "package_url": "https://pypi.org/project/authnzerver/", "platform": "", "project_url": "https://pypi.org/project/authnzerver/", "project_urls": { "Homepage": "https://github.com/waqasbhatti/authnzerver" }, "release_url": "https://pypi.org/project/authnzerver/0.0.1.post0.dev58/", "requires_dist": [ "tornado (>=5.1)", "cryptography (>=2.3)", "SQLAlchemy (>=1.2.11)", "argon2-cffi (>=18.3.0)", "fuzzywuzzy (>=0.17.0)", "diskcache (>=3.0.6)", "uvloop (>=0.11.0)", "confusable-homoglyphs (>=3.2.0)" ], "requires_python": ">=3.6", "summary": "A small authentication-authorization server.", "version": "0.0.1.post0.dev58" }, "last_serial": 5561600, "releases": { "0.0.1.post0.dev14": [ { "comment_text": "", "digests": { "md5": "7bc81ce4db365597e33730c706c1f8b5", "sha256": "257ee409a39308a321e6db51e731569971ec64d4f772dd30353fb8d0711b42c0" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev14-py3-none-any.whl", "has_sig": false, "md5_digest": "7bc81ce4db365597e33730c706c1f8b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 100859, "upload_time": "2019-03-17T04:00:42", "url": "https://files.pythonhosted.org/packages/3f/26/26a20733d640be32f6ce7214d7ad89fbc657c6094ead6cf12a53fa0fcf74/authnzerver-0.0.1.post0.dev14-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "470e66f6e3d503f183eb4fccb893d83b", "sha256": "4bd165a956446ecd8542d90f5bb71d8c6b9cfb8a5d8913838c0e38d5d58c00c2" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev14.tar.gz", "has_sig": false, "md5_digest": "470e66f6e3d503f183eb4fccb893d83b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 96883, "upload_time": "2019-03-17T04:00:45", "url": "https://files.pythonhosted.org/packages/1f/29/412ff9d03734e75ce3f1e96ce222e630d3cabd39ff3afe1439436d984742/authnzerver-0.0.1.post0.dev14.tar.gz" } ], "0.0.1.post0.dev4": [ { "comment_text": "", "digests": { "md5": "e2489052a856d91e9ee9577f5ef25784", "sha256": "d8be1dffee5ab4996ae5c3f2496ef2b3a22b82319f99e3606023c2fbd20a729c" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev4-py3-none-any.whl", "has_sig": false, "md5_digest": "e2489052a856d91e9ee9577f5ef25784", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 98557, "upload_time": "2019-03-14T04:35:08", "url": "https://files.pythonhosted.org/packages/72/d7/ff72cf0b26a4436e3eff298e71ebf7f0587b50a68c461f36a5a032921533/authnzerver-0.0.1.post0.dev4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22a5303a237d1427d531f47cb13bb09d", "sha256": "b18534068902a956e097596d3ccb4c049c5f4435f2b329f387175a6aab04d1cf" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev4.tar.gz", "has_sig": false, "md5_digest": "22a5303a237d1427d531f47cb13bb09d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 94804, "upload_time": "2019-03-14T04:35:11", "url": "https://files.pythonhosted.org/packages/16/4b/45890431b86333ccbde1af54db485acd7ac08478bae9ac3fd301a4407777/authnzerver-0.0.1.post0.dev4.tar.gz" } ], "0.0.1.post0.dev58": [ { "comment_text": "", "digests": { "md5": "4a7116ebea5a8deb8b7fe057d06cc885", "sha256": "6550a0354fceb4fbff3e1a5cc835c67381cd6c08ca7146ea0055a1e001d0305b" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev58-py3-none-any.whl", "has_sig": false, "md5_digest": "4a7116ebea5a8deb8b7fe057d06cc885", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 115420, "upload_time": "2019-07-20T21:14:55", "url": "https://files.pythonhosted.org/packages/89/de/907be19f6fb41edec2e497e054523530386d1bc68ef554b53cd1b7bef3cc/authnzerver-0.0.1.post0.dev58-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5167034d82535af09861a05f2a6febfd", "sha256": "763ada4d42eea58cc34e7fc807b98567b1488edef11159b8548a01e1eef94539" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev58.tar.gz", "has_sig": false, "md5_digest": "5167034d82535af09861a05f2a6febfd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 103135, "upload_time": "2019-07-20T21:15:02", "url": "https://files.pythonhosted.org/packages/03/a6/cac6f7e4d82163a2a17d9314eab259cf1d5288c8e290fc2301f0a2eaeb25/authnzerver-0.0.1.post0.dev58.tar.gz" } ], "0.0.1.post0.dev6": [ { "comment_text": "", "digests": { "md5": "7bba355c6b0a4d9008be491d9da1d6fc", "sha256": "d7d4ff3eb888f50b40af9fe3529965df0d1776a48a9458fc78d9ed4646c8b25d" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev6-py3-none-any.whl", "has_sig": false, "md5_digest": "7bba355c6b0a4d9008be491d9da1d6fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 98568, "upload_time": "2019-03-14T04:43:14", "url": "https://files.pythonhosted.org/packages/b7/fc/75df8112d8b18cb7443fd46b81f31298b21fba6b692de35522e44ca1acf6/authnzerver-0.0.1.post0.dev6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8decc0707ac61125a2d81641e91c64d", "sha256": "822da0f41b447cc0ae5cdf9964cae48d6707514a93acacb9ee22f4958d803955" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev6.tar.gz", "has_sig": false, "md5_digest": "e8decc0707ac61125a2d81641e91c64d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 94810, "upload_time": "2019-03-14T04:43:15", "url": "https://files.pythonhosted.org/packages/08/c4/f259fc4e4ad948cffffc2a42e92269d496b7f5754813bba4b4af1ccaa632/authnzerver-0.0.1.post0.dev6.tar.gz" } ], "0.0.1.post0.dev8": [ { "comment_text": "", "digests": { "md5": "ed93e57721d03f871a75668d2d7ee639", "sha256": "d9ff64a73b08eae7e8779875da0c5f2affa43377f44223dd90bfd05deabd21e2" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev8-py3-none-any.whl", "has_sig": false, "md5_digest": "ed93e57721d03f871a75668d2d7ee639", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 98639, "upload_time": "2019-03-14T05:04:20", "url": "https://files.pythonhosted.org/packages/0d/49/a9b64c385a34273206c0325650c9b330079c190ebb75009cfb43aaffd86e/authnzerver-0.0.1.post0.dev8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc3debb381afbcc16e1d578dd8e8122d", "sha256": "1d5234b905c58df034f8c6ebdf70d064cc4458299c839ab84d48f3ac107affaa" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev8.tar.gz", "has_sig": false, "md5_digest": "dc3debb381afbcc16e1d578dd8e8122d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 94980, "upload_time": "2019-03-14T05:04:22", "url": "https://files.pythonhosted.org/packages/19/3b/dfef60cfba05078557d915a684882a78fafaae577f41580f4b7eb8fc4cfe/authnzerver-0.0.1.post0.dev8.tar.gz" } ], "0.0.1.post0.dev9": [ { "comment_text": "", "digests": { "md5": "480a356e21f576dfc6c76c7124e7853a", "sha256": "1c02818666afa63700adc2ce9049c9e6e565e2ac8d0f4e8342bda15fdde31db2" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev9-py3-none-any.whl", "has_sig": false, "md5_digest": "480a356e21f576dfc6c76c7124e7853a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 98643, "upload_time": "2019-03-14T05:27:27", "url": "https://files.pythonhosted.org/packages/36/1a/63b051e41d523dbc6fe26f78afb353f1c54ce90fcdcc6df618555f5c488f/authnzerver-0.0.1.post0.dev9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4643ab31718e01e4e822d6ecf51ec5e3", "sha256": "89ebc0bdd00e927df1321de70b428a1405caa0c11a65b6c40e67cf7c7b7f897b" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev9.tar.gz", "has_sig": false, "md5_digest": "4643ab31718e01e4e822d6ecf51ec5e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 94980, "upload_time": "2019-03-14T05:27:29", "url": "https://files.pythonhosted.org/packages/81/65/20e79a04ed4650fd50c3bfc1d26375198175805a5d18a28835a617d8b94c/authnzerver-0.0.1.post0.dev9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4a7116ebea5a8deb8b7fe057d06cc885", "sha256": "6550a0354fceb4fbff3e1a5cc835c67381cd6c08ca7146ea0055a1e001d0305b" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev58-py3-none-any.whl", "has_sig": false, "md5_digest": "4a7116ebea5a8deb8b7fe057d06cc885", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 115420, "upload_time": "2019-07-20T21:14:55", "url": "https://files.pythonhosted.org/packages/89/de/907be19f6fb41edec2e497e054523530386d1bc68ef554b53cd1b7bef3cc/authnzerver-0.0.1.post0.dev58-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5167034d82535af09861a05f2a6febfd", "sha256": "763ada4d42eea58cc34e7fc807b98567b1488edef11159b8548a01e1eef94539" }, "downloads": -1, "filename": "authnzerver-0.0.1.post0.dev58.tar.gz", "has_sig": false, "md5_digest": "5167034d82535af09861a05f2a6febfd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 103135, "upload_time": "2019-07-20T21:15:02", "url": "https://files.pythonhosted.org/packages/03/a6/cac6f7e4d82163a2a17d9314eab259cf1d5288c8e290fc2301f0a2eaeb25/authnzerver-0.0.1.post0.dev58.tar.gz" } ] }