{ "info": { "author": "Globo.com", "author_email": "entretenimento1@corp.globo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 3.6" ], "description": "aio-alf |build-status|\n===========\n\naiohttp OAuth 2 Client\n---------------------\n\n`aio-alf` is a OAuth 2 Client base on the aiohttp's AsyncHTTPClient\n\nFeatures\n--------\n\n* Automatic token retrieving and renewing\n* Token expiration control\n* Automatic retry on status 401 (UNAUTHORIZED)\n\nUsage\n-----\n\nInitialize the client and use it as a AsyncHTTPClient object.\n\n.. code-block:: python\n\n from aioalf.client import Client\n from aioalf.httpclient import HTTPRequest\n\n client = Client(\n token_endpoint='http://example.com/token',\n client_id='client-id',\n client_secret='secret')\n\n resource_uri = 'http://example.com/resource'\n\n response = await client.request(\n 'POST',\n resource_uri,\n data='{\"name\": \"alf\"}',\n headers={'Content-Type': 'application/json'}\n )\n\n\nAlternatively one can pass directly a string to the fetch client\n\n.. code-block:: python\n\n # ...\n response = await client.request(\n 'POST',\n 'http://example.com/resource',\n data='{\"name\": \"alf\"}',\n headers={'Content-Type': 'application/json'}\n )\n\nImplicit Flow\n-------------\n\nSupport for OAuth2 implict flow to enable it, call `use_implicit_flow` with a `TokenStorage`\nobject and a port range, it defaults to the range (32000, 32009).\n\nExample:\n\n.. code-block:: python\n\n await use_implicit_flow(TokenStorage(), (30000, 30009))\n\n async with Client(token_endpoint='https://token.endpoint',\n client_id='glBQ3nYU/8/kaVi/bIgXGA==',\n client_secret='') as client:\n response = await client.request('GET', 'http://example.com/resource')\n text = await response.text()\n print(response.status)\n\nThe library has a really simple in memory token storage, you should subclass and overwrite\nits methods if you need to persist the token for a longer period.\n\n\nHow it works?\n-------------\n\nBefore any request the client tries to retrieve a token on the endpoint,\nexpecting a JSON response with the ``access_token`` and ``expires_in`` keys.\n\nThe client keeps the token until it is expired, according to the ``expires_in``\nvalue.\n\nAfter getting the token, the request is issued with a `Bearer authorization\nheader `_:\n\n.. code-block::\n\n GET /resource/1 HTTP/1.1\n Host: example.com\n Authorization: Bearer token\n\nIf the request fails with a 401 (UNAUTHORIZED) status, a new token is retrieved\nfrom the endpoint and the request is retried. This happens only once, if it\nfails again the error response is returned.\n\n\nTroubleshooting\n---------------\n\nIn case of an error retrieving a token, the error response will be returned,\nthe real request won't happen.\n\n\nRelated projects\n----------------\n\nThis project tries to be an adaptation to aiohttp of\n`alf `_\n\n\n.. |build-status| image:: https://secure.travis-ci.org/globocom/aio-alf.png?branch=master\n :target: https://travis-ci.org/globocom/aio-alf\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/globocom/aio-alf", "keywords": "oauth client client_credentials aiohttp", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aio-alf", "package_url": "https://pypi.org/project/aio-alf/", "platform": "", "project_url": "https://pypi.org/project/aio-alf/", "project_urls": { "Homepage": "https://github.com/globocom/aio-alf" }, "release_url": "https://pypi.org/project/aio-alf/0.4.0/", "requires_dist": null, "requires_python": "", "summary": "OAuth Client For aiohttp", "version": "0.4.0" }, "last_serial": 4864736, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "459b407b9f6d5072075bebd401f8d18d", "sha256": "0e2f15a40fee96e6f4c5e304b314e874b30ea219c2b66ebceaf8730b1ca39d0d" }, "downloads": -1, "filename": "aio_alf-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "459b407b9f6d5072075bebd401f8d18d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6729, "upload_time": "2017-12-03T11:28:34", "url": "https://files.pythonhosted.org/packages/a0/38/cf971bca561a3787bc91d51338ba2b49adee0447de8bcd295476df45c03a/aio_alf-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3e8eb60960cf77305ad61898a9b70db", "sha256": "260c3b7ddc840d48622ce998fee7ec1410f706139a9e87a6e7444900f5138a5c" }, "downloads": -1, "filename": "aio_alf-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b3e8eb60960cf77305ad61898a9b70db", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6725, "upload_time": "2017-12-03T11:28:36", "url": "https://files.pythonhosted.org/packages/77/b8/c592f0b519bb2907d2c055deb55e3def5dd82d972137d5f991e79e216df7/aio_alf-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "901f126d2d45d0ed0b268b51403c55fc", "sha256": "79e9cd8ae13d66662e089af5d571eb6157fdeaa101da75787b213073a24246b6" }, "downloads": -1, "filename": "aio-alf-0.1.3.tar.gz", "has_sig": false, "md5_digest": "901f126d2d45d0ed0b268b51403c55fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4000, "upload_time": "2017-12-03T11:28:38", "url": "https://files.pythonhosted.org/packages/a4/32/8d42c9f453d1b639a1f964d1f6d3da5341f385a2a51c84e658aa893f9ba4/aio-alf-0.1.3.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5e5d62c66a425298e367d161c49e3449", "sha256": "4933636182ca9a68fc5489111f63dbea64c6e41f20622bee0178f6c086696b25" }, "downloads": -1, "filename": "aio-alf-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5e5d62c66a425298e367d161c49e3449", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4148, "upload_time": "2018-03-20T13:39:56", "url": "https://files.pythonhosted.org/packages/8a/a7/ce5faf5469fee0303d3999704b21f87aa20b4b1ed40cee5acd80e04d4741/aio-alf-0.1.5.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "478b4b78b02700c79216201d2c11fd02", "sha256": "d2dbf9031173fcb3b0672803de37e31a98e4a7b5b0b35e816b52094c86c4dc59" }, "downloads": -1, "filename": "aio-alf-0.2.2.tar.gz", "has_sig": false, "md5_digest": "478b4b78b02700c79216201d2c11fd02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5591, "upload_time": "2018-03-21T16:12:50", "url": "https://files.pythonhosted.org/packages/81/33/7ac3d4a6fae8b9bd3e2f467a2715764fea5ee3e973c1e6d09d82e297d5a9/aio-alf-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "b0ddb944d00b256ae3f7f9fecf824010", "sha256": "a17282a72527fcfd2ea27c1efc39b098d935694250273d20546c9cfc689860b9" }, "downloads": -1, "filename": "aio-alf-0.2.3.tar.gz", "has_sig": false, "md5_digest": "b0ddb944d00b256ae3f7f9fecf824010", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5589, "upload_time": "2018-04-04T14:27:28", "url": "https://files.pythonhosted.org/packages/2d/c5/5fb45797e9d54907fa26c7d100929c5b5c673a8543a4a0edddbd69850e16/aio-alf-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "57e6406e9f81ae93ab45f25e5565edfd", "sha256": "fbd929ac049c59e6730f665c8d69f00086358750e38b99fd8c597ccb7a7f986c" }, "downloads": -1, "filename": "aio-alf-0.3.0.tar.gz", "has_sig": false, "md5_digest": "57e6406e9f81ae93ab45f25e5565edfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5856, "upload_time": "2018-09-11T18:11:09", "url": "https://files.pythonhosted.org/packages/7e/be/2cfed8a27d0731cbc6c8f036ed13c935968c4d2d43c2ce99da25917dd963/aio-alf-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "8ec55469b32448fff01f11e9f1b1eb70", "sha256": "b4f01c74c00b1aba1cc6a465f57ee1c8e4b071adb53cb399c2fcd3e2f99f6c75" }, "downloads": -1, "filename": "aio-alf-0.3.1.tar.gz", "has_sig": false, "md5_digest": "8ec55469b32448fff01f11e9f1b1eb70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5862, "upload_time": "2018-09-11T18:14:49", "url": "https://files.pythonhosted.org/packages/7b/d7/1a2d6dd9470ab3822eae797749604c25bb72c94afe7c9c795f7cf17fcf71/aio-alf-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "931b76e720c26be7c105aaeb41734597", "sha256": "3a7b353eaf98a7e61a4127a9354862ffd622ca4ce5f163340b95d2c02aa44659" }, "downloads": -1, "filename": "aio-alf-0.3.2.tar.gz", "has_sig": false, "md5_digest": "931b76e720c26be7c105aaeb41734597", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5861, "upload_time": "2018-09-12T17:06:03", "url": "https://files.pythonhosted.org/packages/51/37/b2d565da633ea89d78095847031690d1dd1bd321bfca317486b1352ed50e/aio-alf-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "e08d8e4b46219944359284d52803fcfb", "sha256": "3fe2a79ba3aca30f4f215fa36f1f06113752a33517a334b1a6c22ac661601f86" }, "downloads": -1, "filename": "aio-alf-0.3.3.tar.gz", "has_sig": false, "md5_digest": "e08d8e4b46219944359284d52803fcfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5868, "upload_time": "2018-09-12T17:09:54", "url": "https://files.pythonhosted.org/packages/e9/42/7751d23e91da6f78e2fc4fc2fd04ec5b18a38608a8fc58e1ba3bb5742e31/aio-alf-0.3.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "73f2b4b7ffca6eeb941a1425e3d55a87", "sha256": "da674407da968315af052e6acf03f6644449ebe3cab933029be892d59c78edc3" }, "downloads": -1, "filename": "aio-alf-0.4.0.tar.gz", "has_sig": false, "md5_digest": "73f2b4b7ffca6eeb941a1425e3d55a87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5886, "upload_time": "2019-02-25T14:25:22", "url": "https://files.pythonhosted.org/packages/1b/3c/712e3193d157a78551ac87d482fdee9765b7aaed9fcfedfab4581ed40125/aio-alf-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73f2b4b7ffca6eeb941a1425e3d55a87", "sha256": "da674407da968315af052e6acf03f6644449ebe3cab933029be892d59c78edc3" }, "downloads": -1, "filename": "aio-alf-0.4.0.tar.gz", "has_sig": false, "md5_digest": "73f2b4b7ffca6eeb941a1425e3d55a87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5886, "upload_time": "2019-02-25T14:25:22", "url": "https://files.pythonhosted.org/packages/1b/3c/712e3193d157a78551ac87d482fdee9765b7aaed9fcfedfab4581ed40125/aio-alf-0.4.0.tar.gz" } ] }