{ "info": { "author": "Cyril Panshine", "author_email": "kipanshi@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Internet :: WWW/HTTP" ], "description": "=============\npyramid_odesk\n=============\n\n``pyramid_odesk`` allows your users to authorize via `odesk`_\non your `pyramid`_ project.\n\nYou can find it on `pypi`_ as ``pyramid_odesk``. Also don't forget to check the `documentation`_.\n\n.. _`odesk`: https://odesk.com/\n.. _`pyramid`: http://www.pylonsproject.org/\n.. _`pypi`: http://pypi.python.org/pypi/pyramid_odesk\n.. _`documentation`: http://pythonhosted.org/pyramid_odesk/\n\n\nRequirements\n------------\n`pyramid-redis-sessions`_ is used to store session in `Redis`_ database, so you need to install\n`Redis`_ and configure it to listen to port ``127.0.0.1``.\n\nOther packages are installed automatically::\n\n pyramid\n pyramid_redis_sessions\n python-odesk\n\nTo activate ``jinja2`` renderer, install::\n\n pip install pyramid_jinja2\n\n.. _`pyramid-redis-sessions`: https://github.com/ericrasmussen/pyramid_redis_sessions\n.. _`Redis`: http://redis.io/\n\n\nInstallation\n------------\nInstall with pip::\n\n pip install pyramid_odesk\n\nor using ``easy_install``::\n\n easy_install pyramid_odesk\n\nYou need to create `oDesk API keys`_ of the type ``Web`` and set appropriate permissions to the generated API key.\n\n.. _`oDesk API keys`: https://www.odesk.com/services/api/keys\n\n\nUsage\n-----\nYou can take a look at the `pyramid_odesk_example`_ application or use\nthe instructions below.\n\nInclude following settings in your ``*.ini`` file::\n\n [app:main]\n\n ...\n\n # Redis session settings\n redis.sessions.secret = FILL ME\n\n # oDesk settings\n odesk.api.key = FILL ME\n odesk.api.secret = FILL ME\n\nThen in your project's ``__init__.py`` define the following function::\n\n def get_acl_group(user_uid, request):\n \"\"\"Here goes your ACL logic.\"\"\"\n # All authenticated users have ``view`` permission\n return 'view'\n\nThis function should return list of ACL group `principals`_ or None if user\nis not allowed to have any access groups. See pyramid documentation for `security`_ and `tutorial`_.\n\nDefine a RootFactory in your ``models.py``::\n\n class RootFactory(object):\n \"\"\"This object sets the security for our application.\"\"\"\n __acl__ = [\n (Allow, Authenticated, 'view'),\n (Deny, Authenticated, 'login'),\n (Allow, Everyone, 'login'),\n ]\n\n def __init__(self, request):\n pass\n\nNow register ``get_acl_group()`` function in the config registry to make authorization work. Put in your main method::\n\n def get_acl_group(request):\n return ('view',)\n\n def main(global_config, **settings):\n \"\"\"Main app configuration binding.\"\"\"\n\n config = Configurator(settings=settings,\n root_factory=\"myapp.models.RootFactory\")\n\n # ACL authorization callback for pyramid-odesk\n config.registry.get_acl_group = get_acl_group\n\n # External includes\n config.include('pyramid_odesk')\n\n # Views and routing goes here\n # ...\n #\n config.add_view('myapp.views.MainPage',\n renderer='templates/main.jinja2',\n permission='view')\n\n return config.make_wsgi_app()\n\n.. _`principals`: http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/glossary.html#term-principal\n.. _`security`: http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/security.html\n.. _`tutorial`: http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/tutorials/wiki2/authorization.html\n.. _`pyramid_odesk_example`: https://github.com/kipanshi/pyramid_odesk_example\n\nYou can provide custom ``forbidden.jinja2`` template by overriding asset in your ``__init__.py``::\n\n # Override forbidden template config.override_asset(\n to_override='pyramid_odesk:templates/forbidden.jinja2',\n override_with='myapp:templates/forbidden.jinja2')\n\nSee template example in `pyramid_odesk/templates/forbidden.jinja2`_.\n\nThe \"Logout\" action is done also via POST request with CSRF protection,\nsee example of \"Logout\" buttion in `pyramid_odesk_example/templates/layout.jinja2`_.\n\n.. _`pyramid_odesk/templates/forbidden.jinja2`: https://github.com/kipanshi/pyramid_odesk/tree/master/pyramid_odesk/templates/forbidden.jinja2\n.. _`pyramid_odesk_example/templates/layout.jinja2`: https://github.com/kipanshi/pyramid_odesk_example/blob/master/pyramid_odesk_example/templates/layout.jinja2\n\n\nContacts\n--------\nThe project is made by Cyril Panshine (`@CyrilPanshine`_). Bug reports and pull requests are very much welcomed!\n\n.. _`@CyrilPanshine`: https://twitter.com/CyrilPanshine\n\n\n1.1.5\n-----\n- Due to oDesk Public API change we need to get user information now from\n ``client.hr.get_user_me()``\n\n1.1.4\n-----\n- Implement bugfix for case when session is broken and\n request token and secret are not set.\n\n1.1.3\n-----\n- Store first and last name in the session for further usage in templates\n\n1.1.2\n-----\n- Login and Logout actions are performed via POST and has protection\n against CSRF attacks\n\n1.1.1\n-----\n- Fix ``BaseHandler`` obscuring ``AttributeError`` during dispatch\n\n1.1\n---\n- Use ``override_offset`` for overriding ``forbidden.jinja2`` template.\n- If user is authenticated but is not authrized for some view,\n render ``forbidden`` page with **Log out** link instead of redirect\n to avoid redirect loop\n\n1.0\n---\n- Initial version.", "description_content_type": null, "docs_url": "https://pythonhosted.org/pyramid_odesk/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kipanshi/pyramid_odesk", "keywords": "web pyramid pylons authentication odesk oauth", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyramid_odesk", "package_url": "https://pypi.org/project/pyramid_odesk/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_odesk/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kipanshi/pyramid_odesk" }, "release_url": "https://pypi.org/project/pyramid_odesk/1.1.5/", "requires_dist": null, "requires_python": null, "summary": "pyramid_odesk", "version": "1.1.5" }, "last_serial": 1021043, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "123f3d710b29f1836f46803f7b442adf", "sha256": "a1f87de83b4f29599dccbf2c4b6cc9030f6d253e13184964bedacf67c15f9682" }, "downloads": -1, "filename": "pyramid_odesk-1.0.tar.gz", "has_sig": false, "md5_digest": "123f3d710b29f1836f46803f7b442adf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5485, "upload_time": "2013-11-13T21:53:37", "url": "https://files.pythonhosted.org/packages/c8/b4/7b9219c224317fb3c7b98eb153bb186f658d9e3bba835ab5be749b36993e/pyramid_odesk-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "d09a03d025f647c802aa5c7b5d95c3e4", "sha256": "3b7c6b018d806933a89b971a73a1d93260574cf7e4a6b8068a7822dced2b80e3" }, "downloads": -1, "filename": "pyramid_odesk-1.1.tar.gz", "has_sig": false, "md5_digest": "d09a03d025f647c802aa5c7b5d95c3e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5821, "upload_time": "2013-11-16T11:18:48", "url": "https://files.pythonhosted.org/packages/05/60/c0849616e5367478b57e1d3e6841c550cff3ca74bd796c7e2844f0abbdb0/pyramid_odesk-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "36427ee7c556bb8cb80c1e23e1eea197", "sha256": "52ad3c742667d41de95b73bf9ad236d17169f38301c7c21fbd2ad96b6bd06b9a" }, "downloads": -1, "filename": "pyramid_odesk-1.1.1.tar.gz", "has_sig": false, "md5_digest": "36427ee7c556bb8cb80c1e23e1eea197", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5872, "upload_time": "2013-11-22T11:22:11", "url": "https://files.pythonhosted.org/packages/d5/bc/7cb0ef0eb0308b5bc2dec361d69ec46af21debde912583cc18a095cb4827/pyramid_odesk-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "3220fab3298d01f10d6bb605c2cf5e6e", "sha256": "abb9228d53e6e5650793bc4d40a88db5ff51d4baca67c15c9f4b37c60cd618c4" }, "downloads": -1, "filename": "pyramid_odesk-1.1.2.tar.gz", "has_sig": false, "md5_digest": "3220fab3298d01f10d6bb605c2cf5e6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6682, "upload_time": "2014-01-13T11:33:17", "url": "https://files.pythonhosted.org/packages/2c/be/52189d941779df193629f3b06dc796f6f65a82638243ef01be1288bda43a/pyramid_odesk-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "1aca834421b45bf8e2c018c816911a5c", "sha256": "99cf87501bc3482eaf4401b4cddf9827b8f4a09b8cc501da01fef871223cbc93" }, "downloads": -1, "filename": "pyramid_odesk-1.1.3.tar.gz", "has_sig": false, "md5_digest": "1aca834421b45bf8e2c018c816911a5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6738, "upload_time": "2014-01-13T13:20:43", "url": "https://files.pythonhosted.org/packages/bd/e7/30d9b23e77e848cf875dd41236de36015964a766395d173728375d4eba80/pyramid_odesk-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "4a8df7359e0c3240634649034e62349b", "sha256": "397d52c7ae42aa6b62c93188cfc3f3f87e273cb556f8581acc88042b79fc022f" }, "downloads": -1, "filename": "pyramid_odesk-1.1.4.tar.gz", "has_sig": false, "md5_digest": "4a8df7359e0c3240634649034e62349b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6925, "upload_time": "2014-02-25T04:55:14", "url": "https://files.pythonhosted.org/packages/fe/97/a746c659e8969f379eec24ae8452cb80eacbaf4912560902e68f549cfe3c/pyramid_odesk-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "d73e19dfbf465b5f1c6b8f6e1ed38cdd", "sha256": "8fd3e266742010733d2a9e7f00b1a3994de3ee8a90ebec4552b7280351d5279a" }, "downloads": -1, "filename": "pyramid_odesk-1.1.5.tar.gz", "has_sig": false, "md5_digest": "d73e19dfbf465b5f1c6b8f6e1ed38cdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7002, "upload_time": "2014-03-06T11:34:45", "url": "https://files.pythonhosted.org/packages/ad/75/183d910cc9e7024efcd9b3bbdd9d3dbf4712fe74136e8085f0ff1c10442a/pyramid_odesk-1.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d73e19dfbf465b5f1c6b8f6e1ed38cdd", "sha256": "8fd3e266742010733d2a9e7f00b1a3994de3ee8a90ebec4552b7280351d5279a" }, "downloads": -1, "filename": "pyramid_odesk-1.1.5.tar.gz", "has_sig": false, "md5_digest": "d73e19dfbf465b5f1c6b8f6e1ed38cdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7002, "upload_time": "2014-03-06T11:34:45", "url": "https://files.pythonhosted.org/packages/ad/75/183d910cc9e7024efcd9b3bbdd9d3dbf4712fe74136e8085f0ff1c10442a/pyramid_odesk-1.1.5.tar.gz" } ] }