{ "info": { "author": "Jorge Eduardo Cardona", "author_email": "jorgeecardona@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License" ], "description": "django-apikey\n=============\nKey authentication for django. Can be used with django-piston easily.\n\nBased on https://github.com/scoursen/django-apikey.\n\n\nInstallation\n------------\n::\n\n pip install django-apikey\n\n\nConfiguration\n-------------\n\nAdd 'apikey' to your settings.py:\n::\n\n INSTALLED_APPS = (\n ...\n 'apikey',\n ....\n )\n\nA Question\n----------\n\nWhat is a Token and a Key? and which are the differences between them?\n\nToken\n.....\n\nA Token is generated with::\n\n Token.objects.create(user)\n\nand it can be used to authenticate requests with Django-Piston as long as it remain active, which is configured in settings.py::\n\n TOKEN_VALID_SECONDS = 3600\n\nThe header used to send the token is configured in settings.py with::\n\n TOKEN_AUTH_HEADER = 'X-Auth-Token'\n\nTo ask for a token in a resource handler use it like this::\n\n from apikey.auth import TokenAuthentication\n from piston.handler import BaseHandler\n from piston.resource import Resource\n from app.models import Item\n \n class ItemHandler(BaseHandler):\n allowed_methods = ('GET', )\n\tfields = ('name', 'id')\n model = Item\n \n def read(self, request):\n return Item.objects.all()\n \n handler = Resource(\n handler=ItemHandler, authentication=TokenAuthentication())\n \nThe token remains active TOKEN_VALID_SECONDS after each request, and it should be created in a request authenticated with the username/email and password/key, or Basic, Digest.\n\n\nApiKey\n......\n\nApiKey is basically a key used to authenticate the requests that replace an email/username and password in all the API request.\n\nYou can change the authorization header by setting the APIKEY_AUTHORIZATION_HEADER in settings.py:\n::\n\n APIKEY_AUTHORIZATION_HEADER = 'App-Authorization'\n\n\nTo add api authentication with piston write this in your handlers::\n\n from apikey.auth import ApiKeyAuthentication\n from piston.handler import BaseHandler\n from piston.resource import Resource\n from app.models import Item\n \n class ItemHandler(BaseHandler):\n allowed_methods = ('GET', )\n\tfields = ('name', 'id')\n model = Item\n \n def read(self, request):\n return Item.objects.all()\n \n handler = Resource(\n handler=ItemHandler, authentication=ApiKeyAuthentication())\n\n\nThanks\n------\n\nThis project is base on the one of Steve Coursen https://github.com/scoursen/django-apikey but with several simplifications, and adds.\n\nLicense\n-------\n\nThis software is licensed under the New BSD License.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/jorgeecardona/django-apikey", "keywords": "django authentication piston", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-apikey", "package_url": "https://pypi.org/project/django-apikey/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-apikey/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://www.github.com/jorgeecardona/django-apikey" }, "release_url": "https://pypi.org/project/django-apikey/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Simple Key and Token authentication for Django.", "version": "0.2.0" }, "last_serial": 789095, "releases": { "0.1.0": [], "0.1.1": [], "0.1.2": [], "0.1.3": [], "0.1.4": [], "0.1.5": [], "0.1.6": [ { "comment_text": "", "digests": { "md5": "80983af36fe54c2fbbb55d8ee403703e", "sha256": "d408e261f20117cd253d21b8d5017e132d80c79738aeb6db5556544c6a63925e" }, "downloads": -1, "filename": "django-apikey-0.1.6.tar.gz", "has_sig": false, "md5_digest": "80983af36fe54c2fbbb55d8ee403703e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2214, "upload_time": "2011-06-25T00:15:07", "url": "https://files.pythonhosted.org/packages/a4/f9/52b2d7f27d410bab9090b25f071d1772a553d1c19bccb89905624ca98efc/django-apikey-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "8a83e64495e5d47b90bdae0cc456a756", "sha256": "dfbf79629f35d30150d8129bff78f8ac6c2ad7fae64354314e5913e7daa687c7" }, "downloads": -1, "filename": "django-apikey-0.1.7.tar.gz", "has_sig": false, "md5_digest": "8a83e64495e5d47b90bdae0cc456a756", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2257, "upload_time": "2011-06-25T00:16:47", "url": "https://files.pythonhosted.org/packages/d3/ea/3e15d312b4ff2a819cd2cf2e2ddb6e96390c81a5a7589dcb86b631f4474b/django-apikey-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "58f6c6899eb9c168d24c48662cdda0d3", "sha256": "ae6091c21bd3ec072c2009fd46d051aefdec77226731bc7743b29c97667d732a" }, "downloads": -1, "filename": "django-apikey-0.1.8.tar.gz", "has_sig": false, "md5_digest": "58f6c6899eb9c168d24c48662cdda0d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2491, "upload_time": "2011-06-25T00:26:32", "url": "https://files.pythonhosted.org/packages/c9/7b/33b20610cdb8484fdac64c20281c018236871666af74213e90ef1d3beef8/django-apikey-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "186d9ecd3f7e2717cedc0e87711eb71e", "sha256": "9e4cf8860d90dbdf0aa2df90ed4ffd732e87010d285df1ca7fe1cbab11227f4b" }, "downloads": -1, "filename": "django-apikey-0.2.0.tar.gz", "has_sig": false, "md5_digest": "186d9ecd3f7e2717cedc0e87711eb71e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3346, "upload_time": "2011-07-05T06:07:53", "url": "https://files.pythonhosted.org/packages/59/83/1efbd9d351ff1d3968e17862cd8f02c63b701aa033d290dda1aa37559f54/django-apikey-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "186d9ecd3f7e2717cedc0e87711eb71e", "sha256": "9e4cf8860d90dbdf0aa2df90ed4ffd732e87010d285df1ca7fe1cbab11227f4b" }, "downloads": -1, "filename": "django-apikey-0.2.0.tar.gz", "has_sig": false, "md5_digest": "186d9ecd3f7e2717cedc0e87711eb71e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3346, "upload_time": "2011-07-05T06:07:53", "url": "https://files.pythonhosted.org/packages/59/83/1efbd9d351ff1d3968e17862cd8f02c63b701aa033d290dda1aa37559f54/django-apikey-0.2.0.tar.gz" } ] }