{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Security", "Topic :: Software Development :: Libraries" ], "description": "Xiongxiong Decoder\r\n==================\r\n\r\nBearer token decoder for Python (>= 2.7 and 3).\r\n\r\nInstallation\r\n------------\r\n\r\nUsing ``pip``:\r\n\r\n::\r\n\r\n pip install xiongxiong\r\n\r\n``Xiongxiong`` Class\r\n--------------------\r\n\r\nThe class *must* be instantiated with the private key and, optionally,\r\nthe hashing algorithm (defaults to ``sha1``).\r\n\r\nFor example:\r\n\r\n.. code:: python\r\n\r\n from xiongxiong import Xiongxiong\r\n xiongxiong = Xiongxiong(privateKey, 'md5')\r\n\r\nn.b., An exception will be thrown if the specified hashing algorithm is\r\nnot supported. If you are using Python greater than 2.7.9 or 3.2, you\r\nwill have access to all the algorithms supported by your platform's\r\ninstance of OpenSSL; otherwise you are limited to MD5, SHA1, SHA224,\r\nSHA256, SHA384 and SHA512.\r\n\r\nObviously, the private key and hashing algorithm must match those used\r\nby a token's encoder in order to successfully decode it.\r\n\r\n``xiongxiong(accessToken)``\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n``xiongxiong(basicLogin, basicPassword)``\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nAn instantiation of the ``Xiongxiong`` class is callable and will decode\r\nthe seed data, expiration and validate from the bearer token/basic\r\nauthentication pair, returning a ``Token`` object (see below).\r\n\r\n``Token`` Object\r\n----------------\r\n\r\nThe decoded ``Token`` is built, called by the above function, in such a\r\nway that its properties are read-only. (The factory function shouldn't\r\nbe invoked directly and has been designed to be a private module\r\nfunction, insofar as Python allows.) It nonetheless has the following\r\nmembers:\r\n\r\n- ``.data`` The original seed data, which will be split into a list by\r\n ``:`` characters, wherever possible (a string, otherwise).\r\n- ``.expiration`` The expiration time (``datetime.datetime``)\r\n- ``.valid`` The validity of the token/basic pair (Boolean).\r\n\r\nFor example, continuing from the above:\r\n\r\n.. code:: python\r\n\r\n from datetime import datetime\r\n\r\n tokenData = xiongxiong(someBearerToken)\r\n\r\n if tokenData.valid:\r\n expiresIn = tokenData.expiration - datetime.now()\r\n print('Token expires in %d seconds.' % expiresIn.seconds)\r\n print('Contents: %s' % tokenData.data)\r\n\r\nThe validity property (``valid``) will return ``false`` if the token\r\ncan't be authenticated, otherwise it will test whether the token has\r\npassed its best before date.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wtsi-hgi/xiongxiong", "keywords": "bearer token decoder authentication", "license": "AGPLv3", "maintainer": "", "maintainer_email": "", "name": "xiongxiong", "package_url": "https://pypi.org/project/xiongxiong/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/xiongxiong/", "project_urls": { "Homepage": "https://github.com/wtsi-hgi/xiongxiong" }, "release_url": "https://pypi.org/project/xiongxiong/0.7.4/", "requires_dist": null, "requires_python": null, "summary": "Bearer token decoder", "version": "0.7.4" }, "last_serial": 1513135, "releases": { "0.7.3": [ { "comment_text": "", "digests": { "md5": "600b95e61be8148e49c4b4f96525bcf7", "sha256": "5a9be88e0a41ecfabec4a986a99c692167bb424e0bee656e1e6d97bc3c8d5064" }, "downloads": -1, "filename": "xiongxiong-0.7.3.tar.gz", "has_sig": false, "md5_digest": "600b95e61be8148e49c4b4f96525bcf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4035, "upload_time": "2015-03-04T15:22:52", "url": "https://files.pythonhosted.org/packages/bd/68/f9cd5ab84476f3a7ae2cb2dd90051549a9b690b3dbc1444ed29543fc8a75/xiongxiong-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "48666c02f7a7874163049f676bf0d42e", "sha256": "6e742328b2cfaad2d03ce8cae661ff4f2be4c035b9c1bdab7e1fc06ea7043a52" }, "downloads": -1, "filename": "xiongxiong-0.7.4.tar.gz", "has_sig": false, "md5_digest": "48666c02f7a7874163049f676bf0d42e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4093, "upload_time": "2015-04-20T15:30:01", "url": "https://files.pythonhosted.org/packages/7e/bc/a387aadbda938b5093ab3fb869c10a49f0956cdb0f7b0189de9b3f9ab116/xiongxiong-0.7.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "48666c02f7a7874163049f676bf0d42e", "sha256": "6e742328b2cfaad2d03ce8cae661ff4f2be4c035b9c1bdab7e1fc06ea7043a52" }, "downloads": -1, "filename": "xiongxiong-0.7.4.tar.gz", "has_sig": false, "md5_digest": "48666c02f7a7874163049f676bf0d42e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4093, "upload_time": "2015-04-20T15:30:01", "url": "https://files.pythonhosted.org/packages/7e/bc/a387aadbda938b5093ab3fb869c10a49f0956cdb0f7b0189de9b3f9ab116/xiongxiong-0.7.4.tar.gz" } ] }