{ "info": { "author": "Lance Bragstad", "author_email": "lbragstad@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "================\nfernet-inspector\n================\n\nA tool for inspecting the contents of a Keystone Fernet token, with respect to\nthe server it was generated from. The contents of a token can then be unpacked\nand mapped using the appropriate token format. This tool is designed to be an\ninspection tool and does not guarantee consistent format of the token payload.\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install fernet-inspector\n\nUsage\n-----\n\n.. code:: bash\n\n >>> fernet-inspector -h\n usage: fernet-inspector [-h] [-k KEY_REPOSITORY] token\n\n Inspect the contents of a Keystone Fernet token from the host it was issued\n from.\n\n positional arguments:\n token token to decrypt\n\n optional arguments:\n -h, --help show this help message and exit\n -k KEY_REPOSITORY, --key-repository KEY_REPOSITORY\n location of Fernet key repository.\n\nYou should be able to decrypt a Fernet token and get the resulting payload:\n\n.. code:: bash\n\n >>> fernet-inspector \n [2, '\\xb0>\\xd9\\x14\\x03kF\\xb3\\x94\\xc9@A\\x9e\\x12\\xda\\x0f', 1, 'Z\\xce\\xd8U5ZH\\xf6\\xae\\xd8n@;\\x9a\\x98`', 1442338543.238753, ['\\xf0\\xa8\\x03T\\x07\\xbaJk\\x8c;G\\x9cG\\xab\\xdfX']]\n\nThis tool is only meant to supply information about a token. It's not intended\nto make assumptions about a particular token format, or assertions about the\norder in which the data was packed.\n\n.. WARNING::\n\n The order and contents of any particular token format are subject to change\n at any time.\n\nNow you can map to the appropriate payload based on the first element of the\npayload, which is the token ``version``. In this case, the first element is\n``2``, which means we are dealing with a ``ProjectScopedPayload`` of the\n``keystone.token.providers.fernet.token_formatter.py:TokenFormatter`` class.\n\nHandling Audit IDs\n~~~~~~~~~~~~~~~~~~\n\nAudit IDs can be converted to their ``base64`` representation with the\nfollowing:\n\n.. code:: bash\n\n >>> import base64\n >>> base64.urlsafe_b64encode('\\xf0\\xa8\\x03T\\x07\\xbaJk\\x8c;G\\x9cG\\xab\\xdfX')\n '8KgDVAe6SmuMOecR6vfWA=='\n\nHandling UUIDs\n~~~~~~~~~~~~~~\n\nMost unique identifiers packed into the token are converted from ``UUID.hex``\nto their respective ``UUID.bytes`` representation. This results in a shorter\noverall token. The ``UUID.bytes`` representation of the token can be converted\nback to ``UUID.hex`` with the following:\n\n.. code:: bash\n\n >>> import uuid\n >>> uuid.UUID(bytes='\\xb0>\\xd9\\x14\\x03kF\\xb3\\x94\\xc9@A\\x9e\\x12\\xda\\x0f').hex\n 'b03ed914036b46b394c940419e12da0f'\n\nHandling Timestamps\n~~~~~~~~~~~~~~~~~~~\n\nThe expiration of a token is converted to an integer because it saves space in\nthe token. The integer can be converted back to the original ``datetime``\nobject with the following:\n\n.. code:: bash\n\n >>> import datetime\n >>> datetime.datetime.utcfromtimestamp(1442338543.238753)\n datetime.datetime(2015, 9, 15, 17, 35, 43, 238753)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lbragstad/fernet-inspector", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "fernet_inspector", "package_url": "https://pypi.org/project/fernet_inspector/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fernet_inspector/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/lbragstad/fernet-inspector" }, "release_url": "https://pypi.org/project/fernet_inspector/0.1.6/", "requires_dist": null, "requires_python": null, "summary": "inspect fernet tokens generated by keystone", "version": "0.1.6" }, "last_serial": 1763195, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cc7616a9b26c28fb28ccce9171888ba3", "sha256": "1cb071ece81c776d7303b59677f1d20bd666c6d3162ab9b533cf06546154ac35" }, "downloads": -1, "filename": "fernet_inspector-0.1.tar.gz", "has_sig": false, "md5_digest": "cc7616a9b26c28fb28ccce9171888ba3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8306, "upload_time": "2015-09-15T17:41:25", "url": "https://files.pythonhosted.org/packages/64/41/6b6fe50eab46116657ffd1a64c9743c5778036edf1014ff923a1fd1df9a4/fernet_inspector-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d63b008af4f7ef3d45d5c94945772942", "sha256": "5efa6c2330caa96857d7e0f86c4125939e698593db6668b3040e4fbe19d80cea" }, "downloads": -1, "filename": "fernet_inspector-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d63b008af4f7ef3d45d5c94945772942", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8364, "upload_time": "2015-09-15T18:26:39", "url": "https://files.pythonhosted.org/packages/ce/99/a66362efd057fbc2739d097afd7129072d410cedd0852bb4e0286dbb6202/fernet_inspector-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "067ce2732d37fff3ebf6d44d21396f75", "sha256": "b2761598285fc098dfd4d53c1872c9e81196458d34560e78c5a0cb41d81eb31d" }, "downloads": -1, "filename": "fernet_inspector-0.1.2.tar.gz", "has_sig": false, "md5_digest": "067ce2732d37fff3ebf6d44d21396f75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8406, "upload_time": "2015-09-15T18:34:07", "url": "https://files.pythonhosted.org/packages/5a/58/91e2683ee61fbc9954986b964802c1d376934ed73da52c17d24e934bb170/fernet_inspector-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "eb951cec3506fe34294c4cd6db11f018", "sha256": "b5021e5bf66c09638dfcecc58ee579b1b9ff08f634f13b84b8c6fc1ccf05d75f" }, "downloads": -1, "filename": "fernet_inspector-0.1.3.tar.gz", "has_sig": false, "md5_digest": "eb951cec3506fe34294c4cd6db11f018", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8424, "upload_time": "2015-09-17T13:48:10", "url": "https://files.pythonhosted.org/packages/8c/56/4c3e0e58e71d851db42d2cc64541ddbba96e630175289077b3dc9b7a6aab/fernet_inspector-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "eebb3ab79dee2b404ca49e46f3f8d031", "sha256": "4db6903e9a4e9c0cf8bcc5cf78c0c4523781452691cecd0fd4b2de6e5eab6153" }, "downloads": -1, "filename": "fernet_inspector-0.1.4.tar.gz", "has_sig": false, "md5_digest": "eebb3ab79dee2b404ca49e46f3f8d031", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8416, "upload_time": "2015-09-17T13:54:42", "url": "https://files.pythonhosted.org/packages/00/d7/0f78e7fbea00d0c8b580916025527f6a0f7eb4dfb0e7673063e19a490487/fernet_inspector-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5c4ad1f5062256bce45deb3c82a93810", "sha256": "716deb485ece06503676b6082f5521067343195388ba51c069b8e6fa660ec357" }, "downloads": -1, "filename": "fernet_inspector-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5c4ad1f5062256bce45deb3c82a93810", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8426, "upload_time": "2015-10-11T16:01:12", "url": "https://files.pythonhosted.org/packages/84/d9/3ff1154f35b92933073ace6c7fd4d37fd5e3cc4f559a4dc1f428baa3eb79/fernet_inspector-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "2e46028b31212001e6b8ff2fd4025c6e", "sha256": "0227142c24b4aff702db7bbd7af8285df4c53a3c4d7e2629f7f05300b51a3ed9" }, "downloads": -1, "filename": "fernet_inspector-0.1.6.tar.gz", "has_sig": false, "md5_digest": "2e46028b31212001e6b8ff2fd4025c6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8423, "upload_time": "2015-10-11T16:04:04", "url": "https://files.pythonhosted.org/packages/a5/72/5234fec8aa7bc9b3b8326306ff9166645052539077d5acd1f1214bc6e78b/fernet_inspector-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e46028b31212001e6b8ff2fd4025c6e", "sha256": "0227142c24b4aff702db7bbd7af8285df4c53a3c4d7e2629f7f05300b51a3ed9" }, "downloads": -1, "filename": "fernet_inspector-0.1.6.tar.gz", "has_sig": false, "md5_digest": "2e46028b31212001e6b8ff2fd4025c6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8423, "upload_time": "2015-10-11T16:04:04", "url": "https://files.pythonhosted.org/packages/a5/72/5234fec8aa7bc9b3b8326306ff9166645052539077d5acd1f1214bc6e78b/fernet_inspector-0.1.6.tar.gz" } ] }