{ "info": { "author": "Lu\u00eds Maia", "author_email": "luis.maia@xfel.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Oauth2 Client\n=============\n\nSmall Python library responsible for managing users authentication using\nOAUTH 2.0 Client Backend Application strategy (from non web software to\nweb Oauth2 providers)\n\n*Repository:*\n\n- https://git.xfel.eu/gitlab/ITDM/oauth2_xfel_client\n\n*Dependencies:*\n\n- oauthlib (https://pypi.python.org/pypi/oauthlib)\n- requests (https://github.com/kennethreitz/requests)\n- requests-oauthlib (https://github.com/requests/requests-oauthlib)\n\n\nInstallation\n------------\n\nPython project\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n1. Install requirements, if never done before\n\n 1.1. For OS X distributions::\n\n sudo port install python35\n sudo port\n\n sudo port select --set python3 python35\n\n sudo port install py35-pip\n sudo port select --set pip pip35\n\n sudo port install py35-nose\n sudo port select --set nosetests nosetests-3.5\n\n 1.2. For Linux distributions::\n\n sudo apt-get update\n sudo apt-get install python3.5\n\n\n2. Make oauth2_xfel_client library available in your python environment\n\n 2.1. Install it via pip::\n\n # Install dependencies from local wheels files\n pip install --no-index --upgrade --find-links ./external_dependencies/*\n\n # Install dependencies from the pypi\n pip install -r requirements.txt\n\n Or as a normal python project (via .egg file)::\n\n python setup.py install\n\n Running this command the \"compiled\" `oauth2_xfel_client-5.1.1-py3.4.egg` file\n is generated under the current Python installation site-packages folder.\n\n 2.2. Install it as a normal python project (via Wheel)::\n\n python setup.py bdist_wheel\n\n Running this command 2 folders are generated under the current Python\n installation site-packages folder:\n\n - `oauth2_xfel_client` with the sources;\n - `oauth2_xfel_client-5.1.1.dist-info/` with Wheels configuration files.\n\n3. To identify your Python site-packages folder run::\n\n python -c \"from distutils.sysconfig import get_python_lib; print(get_python_lib())\"\n\n\nUsage\n-----\n\nTo use this project you need to import it.\n\nIf you want interact directly with this Library you should import `Oauth2ClientBackend` class::\n\n from oauth2_xfel_client.oauth2_client_backend import Oauth2ClientBackend\n\nOr import everything::\n\n import oauth2_xfel_client\n\n1. Connection to the Oauth2Client::\n\n from oauth2_xfel_client.oauth2_client_backend import \\\n Oauth2ClientBackend as Oauth2Client\n\n # Necessary configuration variables to establish a connection\n # Go to https://in.xfel.eu/metadata/oauth/applications to make a token for\n # the metadata catalogue.\n user_id = '201ed15ff071a63e76cb0b91a1ab17b36d5f92d24b6df4497aa646e39c46a324'\n user_secret = 'a8ae80f5e96531f19bf2d2b6102f5a537196aca44a673ad36533310e07529757'\n user_email = 'luis.maia@xfel.eu'\n\n # URLs for the metadata catalogue\n token_url = 'https://in.xfel.eu/metadata/oauth/token'\n refresh_url = 'https://in.xfel.eu/metadata/oauth/token'\n auth_url = 'https://in.xfel.eu/metadata/oauth/authorize'\n scope = ''\n\n # Generate the connection\n oauth_client_valid = Oauth2Client(client_id=user_id,\n client_secret=user_secret,\n scope=scope,\n token_url=token_url,\n refresh_url=refresh_url,\n auth_url=auth_url,\n session_token=None)\n\n\n2. Interaction with the oauth2Client:\n\n 2.1 Example data_group_types::\n\n current_token = oauth_client_valid.get_session_token()\n\n\nDevelopment & Testing\n---------------------\n\nWhen developing, and before commit changes, please validate that:\n\n1. All tests continue passing successfully (to validate that run *nosetests*)::\n\n # Go to the source code directory\n cd oauth2_xfel_client\n\n # Run all tests\n nosetests .\n\n # Run all tests and get information about coverage for all files inside oauth2_xfel_client package\n pip install nose-cov\n nosetests --with-cov --cover-erase --cover-inclusive --cov-report term-missing --cov oauth2_xfel_client\n\n # Run all tests with xunit\n nosetests --where=./oauth2_xfel_client/ --with-xunit --xunit-file=pythonTest.xml\n\n # If you don't want use nosetests you can simply run the test class\n python oauth2_xfel_client/tests/oauth2_client_backend_test.py\n\n2. Code keeps respecting pycodestyle code conventions (to validate that run **pycodestyle**)::\n\n pycodestyle .\n\n3. To generate all the wheels files for the dependencies, execute::\n\n # Generate Wheels to its dependencies\n pip wheel --wheel-dir=./external_dependencies -r requirements.txt\n pip wheel --wheel-dir=./external_dependencies --find-links=./external_dependencies -r requirements.txt\n\n # Generate Wheels to itself and dependencies\n pip wheel --wheel-dir=./external_dependencies .\n pip wheel --wheel-dir=./external_dependencies --find-links=./external_dependencies .\n\nGuarantee that you have the desired versions in requirements.txt and setup.py files.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://git.xfel.eu/gitlab/ITDM/oauth2_xfel_client", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "oauth2-xfel-client", "package_url": "https://pypi.org/project/oauth2-xfel-client/", "platform": "any", "project_url": "https://pypi.org/project/oauth2-xfel-client/", "project_urls": { "Homepage": "https://git.xfel.eu/gitlab/ITDM/oauth2_xfel_client" }, "release_url": "https://pypi.org/project/oauth2-xfel-client/5.1.1/", "requires_dist": null, "requires_python": "", "summary": "Python OAUTH 2.0 Client used for Backend Application strategy login against European XFEL Web Applications", "version": "5.1.1" }, "last_serial": 5717372, "releases": { "5.1.0": [ { "comment_text": "", "digests": { "md5": "260dcfb4ebf9c040f3fbdb411050476f", "sha256": "3c226e2c929845632d54b181213a234aa4dd3a5eb6ab457fbd6906af74da145f" }, "downloads": -1, "filename": "oauth2_xfel_client-5.1.0-py3.6.egg", "has_sig": false, "md5_digest": "260dcfb4ebf9c040f3fbdb411050476f", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 11804, "upload_time": "2019-08-21T15:47:39", "url": "https://files.pythonhosted.org/packages/3f/c8/b24291381383dcc4c5a42c6198126fbdbfaf436ce9763cba010b72331339/oauth2_xfel_client-5.1.0-py3.6.egg" } ], "5.1.1": [ { "comment_text": "", "digests": { "md5": "eb9229713a595ca5ed74172a84c15955", "sha256": "8a7cb95c4d88b02305cf33f4cf12f27d4c1c460ba5b286b26172312dc6e0b893" }, "downloads": -1, "filename": "oauth2_xfel_client-5.1.1-py3.6.egg", "has_sig": false, "md5_digest": "eb9229713a595ca5ed74172a84c15955", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 13666, "upload_time": "2019-08-21T16:28:47", "url": "https://files.pythonhosted.org/packages/f4/8b/f1de59b5924d0c0c9f8dd66d252e68f935bca6e0660e6af6c09047deffa8/oauth2_xfel_client-5.1.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "f0ad994f8cf5135e29618c22b8d2771d", "sha256": "0a946cf46d40259f4830f8070a88a9b3da707f43db32e084a0000d8863f54bc4" }, "downloads": -1, "filename": "oauth2_xfel_client-5.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f0ad994f8cf5135e29618c22b8d2771d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11323, "upload_time": "2019-08-22T21:04:38", "url": "https://files.pythonhosted.org/packages/35/0c/0dc2e1e516204c4955c7d060887d2016907a9c4cd2768a461325f75f53c5/oauth2_xfel_client-5.1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb9229713a595ca5ed74172a84c15955", "sha256": "8a7cb95c4d88b02305cf33f4cf12f27d4c1c460ba5b286b26172312dc6e0b893" }, "downloads": -1, "filename": "oauth2_xfel_client-5.1.1-py3.6.egg", "has_sig": false, "md5_digest": "eb9229713a595ca5ed74172a84c15955", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 13666, "upload_time": "2019-08-21T16:28:47", "url": "https://files.pythonhosted.org/packages/f4/8b/f1de59b5924d0c0c9f8dd66d252e68f935bca6e0660e6af6c09047deffa8/oauth2_xfel_client-5.1.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "f0ad994f8cf5135e29618c22b8d2771d", "sha256": "0a946cf46d40259f4830f8070a88a9b3da707f43db32e084a0000d8863f54bc4" }, "downloads": -1, "filename": "oauth2_xfel_client-5.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f0ad994f8cf5135e29618c22b8d2771d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11323, "upload_time": "2019-08-22T21:04:38", "url": "https://files.pythonhosted.org/packages/35/0c/0dc2e1e516204c4955c7d060887d2016907a9c4cd2768a461325f75f53c5/oauth2_xfel_client-5.1.1-py3-none-any.whl" } ] }